diff --git a/.circleci/config.yml b/.circleci/config.yml index 92afe9183..183808490 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,6 +53,9 @@ workflows: - prep-build-test: requires: - prep-deps + - prep-build-test-mv3: + requires: + - prep-deps - prep-build-test-flask: requires: - prep-deps @@ -62,6 +65,9 @@ workflows: - prep-build-storybook: requires: - test-storybook + - prep-build-ts-migration-dashboard: + requires: + - prep-deps - test-lint: requires: - prep-deps @@ -133,6 +139,12 @@ workflows: - benchmark: requires: - prep-build-test + - user-actions-benchmark: + requires: + - prep-build-test + - stats-module-load-init: + requires: + - prep-build-test-mv3 - job-publish-prerelease: requires: - prep-deps @@ -140,7 +152,11 @@ workflows: - prep-build-beta - prep-build-flask - prep-build-storybook + - prep-build-ts-migration-dashboard + - prep-build-test-mv3 - benchmark + - user-actions-benchmark + - stats-module-load-init - all-tests-pass - job-publish-release: filters: @@ -157,6 +173,12 @@ workflows: only: develop requires: - prep-build-storybook + - job-publish-ts-migration-dashboard: + filters: + branches: + only: develop + requires: + - prep-build-ts-migration-dashboard jobs: create_release_pull_request: @@ -200,8 +222,8 @@ jobs: - persist_to_workspace: root: . paths: - - node_modules - - build-artifacts + - node_modules + - build-artifacts validate-lavamoat-config: executor: node-browsers-medium-plus @@ -224,9 +246,25 @@ jobs: - checkout - attach_workspace: at: . - - run: - name: build:dist - command: yarn dist + - when: + condition: + not: + matches: + pattern: /^master$/ + value: << pipeline.git.branch >> + steps: + - run: + name: build:dist + command: yarn build dist + - when: + condition: + matches: + pattern: /^master$/ + value: << pipeline.git.branch >> + steps: + - run: + name: build:prod + command: yarn build prod - run: name: build:debug command: find dist/ -type f -exec md5sum {} \; | sort -k 2 @@ -244,7 +282,7 @@ jobs: at: . - run: name: build:dist - command: yarn build --build-type beta prod + command: yarn build --build-type beta dist - run: name: build:debug command: find dist/ -type f -exec md5sum {} \; | sort -k 2 @@ -268,7 +306,7 @@ jobs: at: . - run: name: build:dist - command: yarn build --build-type flask prod + command: yarn build --build-type flask dist - run: name: build:debug command: find dist/ -type f -exec md5sum {} \; | sort -k 2 @@ -305,6 +343,26 @@ jobs: - dist-test-flask - builds-test-flask + prep-build-test-mv3: + executor: node-browsers-medium-plus + steps: + - checkout + - attach_workspace: + at: . + - run: + name: Build extension in mv3 for testing + command: yarn build:test:mv3 + - run: + name: Move test build to 'dist-test' to avoid conflict with production build + command: mv ./dist ./dist-test-mv3 + - run: + name: Move test zips to 'builds-test' to avoid conflict with production build + command: mv ./builds ./builds-test-mv3 + - persist_to_workspace: + root: . + paths: + - dist-test-mv3 + - builds-test-mv3 prep-build-test: executor: node-browsers-medium-plus @@ -341,6 +399,20 @@ jobs: paths: - storybook-build + prep-build-ts-migration-dashboard: + executor: node-browsers + steps: + - checkout + - attach_workspace: + at: . + - run: + name: Build TypeScript migration dashboard + command: yarn ts-migration:dashboard:build + - persist_to_workspace: + root: . + paths: + - development/ts-migration-dashboard/build + test-storybook: executor: node-browsers steps: @@ -419,7 +491,6 @@ jobs: name: Validate release candidate changelog command: yarn lint:changelog:rc - test-deps-audit: executor: node-browsers steps: @@ -573,6 +644,69 @@ jobs: root: . paths: - test-artifacts + + user-actions-benchmark: + executor: node-browsers-medium-plus + steps: + - checkout + - run: + name: Re-Install Chrome + command: ./.circleci/scripts/chrome-install.sh + - attach_workspace: + at: . + - run: + name: Move test build to dist + command: mv ./dist-test ./dist + - run: + name: Move test zips to builds + command: mv ./builds-test ./builds + - run: + name: Run page load benchmark + command: yarn user-actions-benchmark:chrome --out test-artifacts/chrome/benchmark/user_actions.json --retries 2 + - store_artifacts: + path: test-artifacts + destination: test-artifacts + - persist_to_workspace: + root: . + paths: + - test-artifacts + + stats-module-load-init: + executor: node-browsers-medium-plus + steps: + - checkout + - run: + name: Re-Install Chrome + command: ./.circleci/scripts/chrome-install.sh + - attach_workspace: + at: . + - run: + name: Move test build to dist + command: mv ./dist-test-mv3 ./dist + - run: + name: Move test zips to builds + command: mv ./builds-test-mv3 ./builds + - run: + name: Run page load benchmark + command: | + mkdir -p test-artifacts/chrome/mv3 + cp -R development/charts/flamegraph test-artifacts/chrome/mv3/initialisation + cp -R development/charts/flamegraph/chart test-artifacts/chrome/mv3/initialisation/background + cp -R development/charts/flamegraph/chart test-artifacts/chrome/mv3/initialisation/ui + cp -R development/charts/table test-artifacts/chrome/mv3/load_time + - run: + name: Run page load benchmark + command: yarn mv3:stats:chrome --out test-artifacts/chrome/mv3 + - run: + name: Record bundle size at commit + command: ./.circleci/scripts/bundle-stats-commit.sh + - store_artifacts: + path: test-artifacts + destination: test-artifacts + - persist_to_workspace: + root: . + paths: + - test-artifacts job-publish-prerelease: executor: node-browsers @@ -622,6 +756,9 @@ jobs: - store_artifacts: path: storybook-build destination: storybook + - store_artifacts: + path: development/ts-migration-dashboard/build + destination: ts-migration-dashboard - run: name: build:announce command: ./development/metamaskbot-build-announce.js @@ -648,7 +785,7 @@ jobs: steps: - add_ssh_keys: fingerprints: - - "3d:49:29:f4:b2:e8:ea:af:d1:32:eb:2a:fc:15:85:d8" + - '3d:49:29:f4:b2:e8:ea:af:d1:32:eb:2a:fc:15:85:d8' - checkout - attach_workspace: at: . @@ -658,6 +795,23 @@ jobs: git remote add storybook git@github.com:MetaMask/metamask-storybook.git yarn storybook:deploy + job-publish-ts-migration-dashboard: + executor: node-browsers + steps: + - add_ssh_keys: + fingerprints: + - "8b:21:e3:20:7c:c9:db:82:74:2d:86:d6:11:a7:2f:49" + - checkout + - attach_workspace: + at: . + - run: + name: ts-migration-dashboard:deploy + command: | + git remote add ts-migration-dashboard git@github.com:MetaMask/metamask-extension-ts-migration-dashboard.git + git config user.name "MetaMask Bot" + git config user.email metamaskbot@users.noreply.github.com + yarn ts-migration:dashboard:deploy + test-unit: executor: node-browsers steps: @@ -670,7 +824,7 @@ jobs: - run: name: test:coverage:jest command: yarn test:coverage:jest - - run: + - run: name: Validate coverage thresholds command: | if ! git diff --exit-code jest.config.js development/jest.config.js; then diff --git a/.circleci/scripts/bundle-stats-commit.sh b/.circleci/scripts/bundle-stats-commit.sh new file mode 100755 index 000000000..db5fe101b --- /dev/null +++ b/.circleci/scripts/bundle-stats-commit.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash + +set -e +set -u +set -o pipefail + +if [[ "${CI:-}" != 'true' ]] +then + printf '%s\n' 'CI environment variable must be set to true' + exit 1 +fi + +if [[ "${CIRCLECI:-}" != 'true' ]] +then + printf '%s\n' 'CIRCLECI environment variable must be set to true' + exit 1 +fi + +if [[ "${CIRCLE_BRANCH}" != "develop" ]] +then + printf 'This is not develop branch' + exit 0 +fi + +if [[ -z "${GITHUB_TOKEN:-}" ]] +then + printf '%s\n' 'GITHUB_TOKEN environment variable must be set' + exit 1 +elif [[ -z "${GITHUB_TOKEN_USER:-}" ]] +then + printf '%s\n' 'GITHUB_TOKEN_USER environment variable must be set' + exit 1 +fi + +mkdir temp + +git config --global user.email "metamaskbot@users.noreply.github.com" + +git config --global user.name "MetaMask Bot" + +git clone git@github.com:MetaMask/extension_bundlesize_stats.git temp + +if [[ -f "temp/stats/bundle_size_stats-${CIRCLE_SHA1}.json" ]] +then + printf 'Bundle size of the commit is already recorded' + cd .. + rm -rf temp + exit 0 +fi + +cp -R test-artifacts/chrome/mv3/bundle_size_stats.json temp/stats + +echo " bundle_size_stats-${CIRCLE_SHA1}.json" >> temp/stats/fileList.txt + +mv temp/stats/bundle_size_stats.json "temp/stats/bundle_size_stats-${CIRCLE_SHA1}.json" + +cd temp + +git add . + +git commit --message "Bundle size at commit: ${CIRCLE_SHA1}" + +repo_slug="$CIRCLE_PROJECT_USERNAME/extension_bundlesize_stats" +git push "https://$GITHUB_TOKEN_USER:$GITHUB_TOKEN@github.com/$repo_slug" main + +cd .. + +rm -rf temp diff --git a/.circleci/scripts/create-lavamoat-viz.sh b/.circleci/scripts/create-lavamoat-viz.sh index db1dc3979..4f2df2cdb 100755 --- a/.circleci/scripts/create-lavamoat-viz.sh +++ b/.circleci/scripts/create-lavamoat-viz.sh @@ -14,4 +14,4 @@ mkdir -p "${BUILD_DEST}" yarn lavamoat:debug:build # generate viz -npx lavamoat-viz --dest "${BUILD_DEST}" \ No newline at end of file +npx lavamoat-viz --dest "${BUILD_DEST}" diff --git a/.circleci/scripts/deps-install.sh b/.circleci/scripts/deps-install.sh index 7ea3da9cb..1c450a9bc 100755 --- a/.circleci/scripts/deps-install.sh +++ b/.circleci/scripts/deps-install.sh @@ -13,4 +13,4 @@ har_files=(./*.har) if [[ -f "${har_files[0]}" ]] then mv ./*.har build-artifacts/yarn-install-har/ -fi \ No newline at end of file +fi diff --git a/.circleci/scripts/validate-lavamoat-policy.sh b/.circleci/scripts/validate-lavamoat-policy.sh index d674cd3f0..177fabe0b 100755 --- a/.circleci/scripts/validate-lavamoat-policy.sh +++ b/.circleci/scripts/validate-lavamoat-policy.sh @@ -4,7 +4,7 @@ set -e set -u set -o pipefail -yarn lavamoat:auto +yarn lavamoat:auto:ci if git diff --exit-code then diff --git a/.depcheckrc.yml b/.depcheckrc.yml index 2652ffb2b..8883375e7 100644 --- a/.depcheckrc.yml +++ b/.depcheckrc.yml @@ -12,6 +12,8 @@ ignores: # dev deps # + # all @types/* packages are imported implicitly by TypeScript + - '@types/*' # safety fallback for npm lifecycle scripts, not used normally - '@lavamoat/preinstall-always-fail' # used in testing + ci @@ -20,7 +22,7 @@ ignores: - '@metamask/phishing-warning' # statically hosted as part of some e2e tests - '@metamask/test-dapp' - '@metamask/design-tokens' # Only imported in index.css - - '@tsconfig/node14' # required dynamically by TS, used in tsconfig.json + - '@tsconfig/node16' # required dynamically by TS, used in tsconfig.json - '@sentry/cli' # invoked as `sentry-cli` - 'chromedriver' - 'depcheck' # ooo meta @@ -42,6 +44,8 @@ ignores: - 'css-loader' - 'sass-loader' - 'resolve-url-loader' + # jest environments + - 'jest-environment-jsdom' # files depcheck should not parse ignorePatterns: diff --git a/.eslintrc.base.js b/.eslintrc.base.js index 47c379969..b4e93c1c9 100644 --- a/.eslintrc.base.js +++ b/.eslintrc.base.js @@ -63,5 +63,14 @@ module.exports = { // a browser context. For instance, we may import polyfills which change // global variables, or we may import stylesheets. 'import/no-unassigned-import': 'off', + + // import/no-named-as-default-member checks if default imports also have + // named exports matching properties used on the default import. Example: + // in confirm-seed-phrase-component.test.js we import sinon from 'sinon' + // and later access sinon.spy. spy is also exported from sinon directly and + // thus triggers the error. Turning this rule off to prevent churn when + // upgrading eslint and dependencies. This rule should be evaluated and + // if agreeable turned on upstream in @metamask/eslint-config + 'import/no-named-as-default-member': 'off', }, }; diff --git a/.eslintrc.js b/.eslintrc.js index 2001994f4..31c60bd51 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -8,6 +8,8 @@ module.exports = { 'app/vendor/**', 'builds/**/*', 'development/chromereload.js', + 'development/charts/**', + 'development/ts-migration-dashboard/build/**', 'dist/**/*', 'node_modules/**/*', ], @@ -277,6 +279,20 @@ module.exports = { { maxSize: 50, inlineMaxSize: 50 }, ], 'jest/no-restricted-matchers': 'off', + /** + * jest/prefer-to-be is a new rule that was disabled to reduce churn + * when upgrading eslint. It should be considered for use and enabled + * in a future PR if agreeable. + */ + 'jest/prefer-to-be': 'off', + /** + * jest/lowercase-name was renamed to jest/prefer-lowercase-title this + * change was made to essentially retain the same state as the original + * eslint-config-jest until it is updated. At which point the following + * two lines can be deleted. + */ + 'jest/lowercase-name': 'off', + 'jest/prefer-lowercase-title': ['error', { ignore: ['describe'] }], }, }, /** @@ -328,5 +344,11 @@ module.exports = { sourceType: 'script', }, }, + { + files: ['ui/pages/settings/*.js'], + rules: { + 'sort-keys': ['error', 'asc', { natural: true }], + }, + }, ], }; diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 95077129c..0eaf7de40 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -4,5 +4,5 @@ contact_links: url: https://community.metamask.io/c/feature-requests-ideas/ about: Request new features and vote on the ones that are important to you - name: Get support or ask a question - url: https://metamask.zendesk.com/hc/en-us/requests/new + url: https://metamask.zendesk.com/hc/en-us about: Use the MetaMask support system to get help and ask questions diff --git a/.gitignore b/.gitignore index 693537314..c86fb82db 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,8 @@ jest-coverage/ dist builds/ builds.zip +development/ts-migration-dashboard/build +development/ts-migration-dashboard/intermediate test-artifacts test-builds @@ -45,7 +47,9 @@ notes.txt .nyc_output +# MetaMask configuration .metamaskrc +.metamaskprodrc # TypeScript tsout/ diff --git a/.iyarc b/.iyarc index 0d2a2e59f..bbd5d06c1 100644 --- a/.iyarc +++ b/.iyarc @@ -2,4 +2,4 @@ GHSA-93q8-gq69-wqmw GHSA-257v-vj4p-3w2h GHSA-wm7h-9275-46v2 -GHSA-pfrx-2q88-qq97 \ No newline at end of file +GHSA-pfrx-2q88-qq97 diff --git a/.metamaskrc.dist b/.metamaskrc.dist index 8ab56bf00..0554ac85e 100644 --- a/.metamaskrc.dist +++ b/.metamaskrc.dist @@ -5,8 +5,12 @@ SEGMENT_WRITE_KEY= ONBOARDING_V2= SWAPS_USE_DEV_APIS= COLLECTIBLES_V1= -TOKEN_DETECTION_V2= -ADD_POPULAR_NETWORKS= +PUBNUB_PUB_KEY= +PUBNUB_SUB_KEY= +TOKEN_ALLOWANCE_IMPROVEMENTS= + +; Set this to '1' to enable support for Sign-In with Ethereum [EIP-4361](https://eips.ethereum.org/EIPS/eip-4361) +SIWE_V1= ; Set this to test changes to the phishing warning page. PHISHING_WARNING_PAGE_URL= diff --git a/.prettierignore b/.prettierignore index a98c312ad..75bdc6e52 100644 --- a/.prettierignore +++ b/.prettierignore @@ -11,3 +11,4 @@ app/vendor/** test/e2e/send-eth-with-private-key-test/** *.scss development/chromereload.js +development/ts-migration-dashboard/filesToConvert.json diff --git a/.storybook/2.DOCUMENTATION.stories.mdx b/.storybook/2.DOCUMENTATION.stories.mdx index da30c959e..17fb97396 100644 --- a/.storybook/2.DOCUMENTATION.stories.mdx +++ b/.storybook/2.DOCUMENTATION.stories.mdx @@ -50,7 +50,7 @@ import React from 'react'; import BuyIcon from '../icon/overview-buy-icon.component'; -// The mdx file to document component API and usage +// The mdx file to document props and usage import README from './README.mdx'; import Button from '.'; @@ -149,7 +149,7 @@ Now the storybook components are complete, the `README.mdx` documentation should import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'; - + import Button from '.'; @@ -167,9 +167,9 @@ Buttons communicate actions that users can take. -## Component API +## Props - diff --git a/.storybook/3.COLORS.stories.mdx b/.storybook/3.COLORS.stories.mdx index 507fade1c..fce6ef662 100644 --- a/.storybook/3.COLORS.stories.mdx +++ b/.storybook/3.COLORS.stories.mdx @@ -1,20 +1,12 @@ import { Meta } from '@storybook/addon-docs'; -import ActionaleMessage from '../ui/components/ui/actionable-message'; import designTokenDiagramImage from './images/design.token.graphic.svg'; - + # Color Color is used to express style and communicate meaning. - - -
- ## Design tokens We are importing design tokens as CSS variables from [@metamask/design-tokens](https://github.com/MetaMask/design-tokens) repo to help consolidate colors and enable theming across all MetaMask products. diff --git a/.storybook/4.SHADOW.stories.mdx b/.storybook/4.SHADOW.stories.mdx new file mode 100644 index 000000000..84d6984ee --- /dev/null +++ b/.storybook/4.SHADOW.stories.mdx @@ -0,0 +1,307 @@ +import { Meta, Canvas, Story } from '@storybook/addon-docs'; + + + +# Shadow + +Shadows convey elevation of elements on a surface + +## Size + +There are 4 different sizes of shadow in MetaMask + +
+
+ XS +
+
+ SM +
+
+ MD +
+
+ LG +
+
+ +| Size | CSS | +| ------ | ----------------------- | +| **XS** | `var(--shadow-size-xs)` | +| **SM** | `var(--shadow-size-sm)` | +| **MD** | `var(--shadow-size-md)` | +| **LG** | `var(--shadow-size-lg)` | + +## Color + +As well as the neutral colors for shadow 2 other colors exist that are used for the primary and error/danger button hover states + +
+
+ Default +
+
+ Primary +
+
+ Error/Danger +
+
+ +| Color | CSS | +| ----------- | ----------------------------- | +| **neutral** | `var(--color-shadow-default)` | +| **primary** | `var(--color-primary-shadow)` | +| **danger** | `var(--color-error-shadow)` | + +## Example usage + +Using both size and color tokens, different shadows can be applied to components + +
+
+
+ Card +
+
+ Dropdown +
+
+ Toast +
+
+ Modal +
+
+
+
+ Button Primary Hover +
+
+ Button Error/Danger Hover +
+
+
+ +| Component | JS | CSS | +| ------------------------ | ---------------------------------------------------------------- | --- | +| **Card** | `box-shadow: var(--shadow-size-xs) var(--color-shadow-default);` | +| **Dropdown** | `box-shadow: var(--shadow-size-sm) var(--color-shadow-default);` | +| **Toast** | `box-shadow: var(--shadow-size-md) var(--color-shadow-default);` | +| **Modal** | `box-shadow: var(--shadow-size-lg) var(--color-shadow-default);` | +| **Button Primary Hover** | `box-shadow: var(--shadow-size-sm) var(--color-primary-shadow);` | +| **Button Danger Hover** | `box-shadow: var(--shadow-size-sm) var(--color-error-shadow);` | + +## Takeaways + +- Try to avoid using static media queries in your code +- Try to use the provided SCSS mixins + +### ❌ Don't do this + +Don't use static media queries in your code + +```css +/** +* Don't do this +* Static box-shadows create inconsistency in elevation of elements +**/ +.card { + box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2); +} +``` + +### ✅ Do this + +Do use the provided shadow design token css variables + +```css +.card { + box-shadow: var(--shadow-size-xs) var(--color-shadow-default); +} +``` + +## References + +- [Shadow design tokens](https://metamask.github.io/design-tokens/?path=/docs/shadows-shadows--shadow) +- [Figma light theme colors library(shadows page)](https://www.figma.com/file/kdFzEC7xzSNw7cXteqgzDW/%5BColor%5D-Light-Theme?node-id=753%3A719)(internal use only) +- [Figma dark theme colors library(shadows page)](https://www.figma.com/file/rLKsoqpjyoKauYnFDcBIbO/%5BColor%5D-Dark-Theme?node-id=522%3A1022)(internal use only) diff --git a/.storybook/5.BREAKPOINTS.stories.mdx b/.storybook/5.BREAKPOINTS.stories.mdx new file mode 100644 index 000000000..1ddd2c420 --- /dev/null +++ b/.storybook/5.BREAKPOINTS.stories.mdx @@ -0,0 +1,125 @@ +import { Meta } from '@storybook/addon-docs'; + + + +# Breakpoints + +Breakpoints are used for responsive layout + +## Screen Sizes + +There are 4 screen sizes that make up the breakpoints for the MetaMask extension + +- base: `0px` +- sm: `576px` +- md: `768px` +- lg: `1280px` + +### SCSS + +There are Sass variables and mixins available for use for both min and max screens sizes + +### Variables + +```css +$screen-sm-max /* 575px */ +$screen-md-max /* 767px */ +$screen-lg-max /* 1279px */ + +$screen-sm-min /* 576px */ +$screen-md-min /* 768px */ +$screen-lg-min /* 1280px */ +``` + +### Mixins + +```css +/* Max screen size */ +@include screen-sm-max { + /* equivalent css @media screen and (max-width: 575px) */ +} +@include screen-md-max { + /* equivalent css @media screen and (max-width: 767px) */ +} +@include screen-lg-max { + /* equivalent css @media screen and (max-width: 1279px) */ +} + +/* Min screen size */ +@include screen-sm-min { + /* equivalent css @media screen and (min-width: 576px) */ +} +@include screen-md-min { + /* equivalent css @media screen and (min-width: 768px) */ +} +@include screen-lg-min { + /* equivalent css @media screen and (min-width: 1280px) */ +} +``` + +Migrating from the old sass variables to the new mixins looks like this + +```css +/* Max width */ +/* Instead of the media query and sass variable */ +@media screen and (max-width: $break-small) { + right: 16px; +} + +/* Use the sass mixin */ +@include screen-sm-max { + right: 16px; +} + +/* Min width */ +/* Instead of the media query and sass variable */ +@media screen and (min-width: $break-large) { + left: 16px; +} + +/* Use the sass mixin */ +@include screen-sm-min { + left: 16px; +} +``` + +## Takeaways + +- Try to avoid using static media queries in your code. +- Try to use the provided SCSS mixins + +### ❌ Don't do this + +Don't use static media queries in your code. + +```css +/** +* Don't do this +* Static media queries create inconsistency and could break the UI if we want to update them in future +**/ +.account-menu { + @media screen and (min-width: 769px) { + right: calc((100vw - 80vw) / 2); + } + + @media screen and (min-width: 1281px) { + right: calc((100vw - 65vw) / 2); + } +} +``` + +### ✅ Do this + +Do use the provided Sass mixins + +```css +.account-menu { + @include screen-md-min { + right: calc((100vw - 80vw) / 2); + } + + @include screen-lg-min { + right: calc((100vw - 65vw) / 2); + } +} +``` diff --git a/.storybook/metamask-storybook-theme.js b/.storybook/metamask-storybook-theme.js index 49f8c814d..2bba8734c 100644 --- a/.storybook/metamask-storybook-theme.js +++ b/.storybook/metamask-storybook-theme.js @@ -7,6 +7,6 @@ export default create({ brandTitle: 'MetaMask Storybook', // Typography - fontBase: 'Euclid, Roboto, Helvetica, Arial, sans-serif', + fontBase: 'Euclid Circular B, Roboto, Helvetica, Arial, sans-serif', fontCode: 'Inconsolata, monospace', }); diff --git a/.storybook/preview.js b/.storybook/preview.js index 517e7820a..d068ba34d 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -30,9 +30,10 @@ addParameters({ storySort: { order: [ 'Getting Started', - 'Design Tokens', + 'Foundations', + ['Color', 'Shadow', 'Breakpoints'], 'Components', - ['UI', 'App'], + ['UI', 'App', 'Component Library'], 'Pages', ], }, diff --git a/.storybook/test-data.js b/.storybook/test-data.js index 44038239d..44aca95a6 100644 --- a/.storybook/test-data.js +++ b/.storybook/test-data.js @@ -1,3 +1,4 @@ +import { draftTransactionInitialState } from '../ui/ducks/send'; const state = { invalidCustomNetwork: { state: 'CLOSED', @@ -15,99 +16,99 @@ const state = { }, networkList: [ { - blockExplorerUrl: "https://etherscan.io", - chainId: "0x1", + blockExplorerUrl: 'https://etherscan.io', + chainId: '0x1', iconColor: 'var(--mainnet)', isATestNetwork: false, - labelKey: "mainnet", - providerType: "mainnet", - rpcUrl: "https://mainnet.infura.io/v3/", - ticker: "ETH", + labelKey: 'mainnet', + providerType: 'mainnet', + rpcUrl: 'https://mainnet.infura.io/v3/', + ticker: 'ETH', viewOnly: true, }, { - blockExplorerUrl: "https://ropsten.etherscan.io", - chainId: "0x3", + blockExplorerUrl: 'https://ropsten.etherscan.io', + chainId: '0x3', iconColor: 'var(--ropsten)', isATestNetwork: true, - labelKey: "ropsten", - providerType: "ropsten", - rpcUrl: "https://ropsten.infura.io/v3/", - ticker: "ETH", + labelKey: 'ropsten', + providerType: 'ropsten', + rpcUrl: 'https://ropsten.infura.io/v3/', + ticker: 'ETH', viewOnly: true, }, { - blockExplorerUrl: "https://rinkeby.etherscan.io", - chainId: "0x4", + blockExplorerUrl: 'https://rinkeby.etherscan.io', + chainId: '0x4', iconColor: 'var(--rinkeby)', isATestNetwork: true, - labelKey: "rinkeby", - providerType: "rinkeby", - rpcUrl: "https://rinkeby.infura.io/v3/", - ticker: "ETH", + labelKey: 'rinkeby', + providerType: 'rinkeby', + rpcUrl: 'https://rinkeby.infura.io/v3/', + ticker: 'ETH', viewOnly: true, }, { - blockExplorerUrl: "https://goerli.etherscan.io", - chainId: "0x5", + blockExplorerUrl: 'https://goerli.etherscan.io', + chainId: '0x5', iconColor: 'var(--goerli)', isATestNetwork: true, - labelKey: "goerli", - providerType: "goerli", - rpcUrl: "https://goerli.infura.io/v3/", - ticker: "ETH", + labelKey: 'goerli', + providerType: 'goerli', + rpcUrl: 'https://goerli.infura.io/v3/', + ticker: 'ETH', viewOnly: true, }, { - blockExplorerUrl: "https://kovan.etherscan.io", - chainId: "0x2a", + blockExplorerUrl: 'https://kovan.etherscan.io', + chainId: '0x2a', iconColor: 'var(--kovan)', isATestNetwork: true, - labelKey: "kovan", - providerType: "kovan", - rpcUrl: "https://kovan.infura.io/v3/", - ticker: "ETH", + labelKey: 'kovan', + providerType: 'kovan', + rpcUrl: 'https://kovan.infura.io/v3/', + ticker: 'ETH', viewOnly: true, }, { - blockExplorerUrl: "", - chainId: "0x539", + blockExplorerUrl: '', + chainId: '0x539', iconColor: 'var(--localhost)', isATestNetwork: true, - label: "Localhost 8545", - providerType: "rpc", - rpcUrl: "http://localhost:8545", - ticker: "ETH", + label: 'Localhost 8545', + providerType: 'rpc', + rpcUrl: 'http://localhost:8545', + ticker: 'ETH', }, { - blockExplorerUrl: "https://bscscan.com", - chainId: "0x38", + blockExplorerUrl: 'https://bscscan.com', + chainId: '0x38', iconColor: 'var(--localhost)', isATestNetwork: false, - label: "Binance Smart Chain", - providerType: "rpc", - rpcUrl: "https://bsc-dataseed.binance.org/", - ticker: "BNB", + label: 'Binance Smart Chain', + providerType: 'rpc', + rpcUrl: 'https://bsc-dataseed.binance.org/', + ticker: 'BNB', }, { - blockExplorerUrl: "https://cchain.explorer.avax.network/", - chainId: "0xa86a", + blockExplorerUrl: 'https://cchain.explorer.avax.network/', + chainId: '0xa86a', iconColor: 'var(--localhost)', isATestNetwork: false, - label: "Avalanche", - providerType: "rpc", - rpcUrl: "https://api.avax.network/ext/bc/C/rpc", - ticker: "AVAX", + label: 'Avalanche', + providerType: 'rpc', + rpcUrl: 'https://api.avax.network/ext/bc/C/rpc', + ticker: 'AVAX', }, { - blockExplorerUrl: "https://polygonscan.com", - chainId: "0x89", + blockExplorerUrl: 'https://polygonscan.com', + chainId: '0x89', iconColor: 'var(--localhost)', isATestNetwork: false, - label: "Polygon", - providerType: "rpc", - rpcUrl: "https://polygon-rpc.com", - ticker: "MATIC", + label: 'Polygon', + providerType: 'rpc', + rpcUrl: 'https://polygon-rpc.com', + ticker: 'MATIC', }, ], metamask: { @@ -132,7 +133,7 @@ const state = { '0x', ], occurrences: 12, - unlisted: false + unlisted: false, }, '0xc00e94cb662c3520282e6f5717214004a7f26888': { address: '0xc00e94cb662c3520282e6f5717214004a7f26888', @@ -153,23 +154,18 @@ const state = { '0x', ], occurrences: 12, - unlisted: false + unlisted: false, }, '0xfffffffff15abf397da76f1dcc1a1604f45126db': { address: '0xfffffffff15abf397da76f1dcc1a1604f45126db', symbol: 'FSW', decimals: 18, name: 'Falconswap', - iconUrl: 'https://assets.coingecko.com/coins/images/12256/thumb/falconswap.png?1598534184', - aggregators: [ - 'CoinGecko', - '1inch', - 'Paraswap', - 'Zapper', - 'Zerion', - ], + iconUrl: + 'https://assets.coingecko.com/coins/images/12256/thumb/falconswap.png?1598534184', + aggregators: ['CoinGecko', '1inch', 'Paraswap', 'Zapper', 'Zerion'], occurrences: 12, - unlisted: false + unlisted: false, }, '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f': { address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', @@ -192,70 +188,70 @@ const state = { '0x', ], occurrences: 12, - unlisted: false + unlisted: false, }, '0x6b175474e89094c44da98b954eedeac495271d0f': { address: '0x6b175474e89094c44da98b954eedeac495271d0f', symbol: 'META', decimals: 18, image: 'metamark.svg', - unlisted: false + unlisted: false, }, '0xB8c77482e45F1F44dE1745F52C74426C631bDD52': { address: '0xB8c77482e45F1F44dE1745F52C74426C631bDD52', symbol: '0X', decimals: 18, image: '0x.svg', - unlisted: false + unlisted: false, }, '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984': { address: '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984', symbol: 'AST', decimals: 18, image: 'ast.png', - unlisted: false + unlisted: false, }, '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2': { address: '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2', symbol: 'BAT', decimals: 18, image: 'BAT_icon.svg', - unlisted: false + unlisted: false, }, '0xe83cccfabd4ed148903bf36d4283ee7c8b3494d1': { address: '0xe83cccfabd4ed148903bf36d4283ee7c8b3494d1', symbol: 'CVL', decimals: 18, image: 'CVL_token.svg', - unlisted: false + unlisted: false, }, '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e': { address: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e', symbol: 'GLA', decimals: 18, image: 'gladius.svg', - unlisted: false + unlisted: false, }, '0x467Bccd9d29f223BcE8043b84E8C8B282827790F': { address: '0x467Bccd9d29f223BcE8043b84E8C8B282827790F', symbol: 'GNO', decimals: 18, image: 'gnosis.svg', - unlisted: false + unlisted: false, }, '0xff20817765cb7f73d4bde2e66e067e58d11095c2': { address: '0xff20817765cb7f73d4bde2e66e067e58d11095c2', symbol: 'OMG', decimals: 18, image: 'omg.jpg', - unlisted: false + unlisted: false, }, '0x8e870d67f660d95d5be530380d0ec0bd388289e1': { address: '0x8e870d67f660d95d5be530380d0ec0bd388289e1', symbol: 'WED', decimals: 18, image: 'wed.png', - unlisted: false + unlisted: false, }, }, networkDetails: { @@ -281,83 +277,84 @@ const state = { swapsFeatureIsLive: false, swapsQuoteRefreshTime: 60000, }, - "snapStates": {}, - "snaps": { - "local:http://localhost:8080/": { - "enabled": true, - "id": "local:http://localhost:8080/", - "initialPermissions": { - "snap_confirm": {} + snapStates: {}, + snaps: { + 'local:http://localhost:8080/': { + enabled: true, + id: 'local:http://localhost:8080/', + initialPermissions: { + snap_confirm: {}, }, - "manifest": { - "description": "An example MetaMask Snap.", - "initialPermissions": { - "snap_confirm": {} + manifest: { + description: 'An example MetaMask Snap.', + initialPermissions: { + snap_confirm: {}, }, - "manifestVersion": "0.1", - "proposedName": "MetaMask Example Snap", - "repository": { - "type": "git", - "url": "https://github.com/MetaMask/snaps-skunkworks.git" + manifestVersion: '0.1', + proposedName: 'MetaMask Example Snap', + repository: { + type: 'git', + url: 'https://github.com/MetaMask/snaps-skunkworks.git', }, - "source": { - "location": { - "npm": { - "filePath": "dist/bundle.js", - "iconPath": "images/icon.svg", - "packageName": "@metamask/example-snap", - "registry": "https://registry.npmjs.org/" - } + source: { + location: { + npm: { + filePath: 'dist/bundle.js', + iconPath: 'images/icon.svg', + packageName: '@metamask/example-snap', + registry: 'https://registry.npmjs.org/', + }, }, - "shasum": "3lEt0yUu080DwV78neROaAAIQWXukSkMnP4OBhOhBnE=" + shasum: '3lEt0yUu080DwV78neROaAAIQWXukSkMnP4OBhOhBnE=', }, - "version": "0.6.0" + version: '0.6.0', }, - "permissionName": "wallet_snap_local:http://localhost:8080/", - "sourceCode": "(...)", - "status": "stopped", - "svgIcon": "...", - "version": "0.6.0" - }, - "Filecoin Snap": { - "enabled": true, - "id": "npm:http://localhost:8080/", - "initialPermissions": { - "snap_confirm": {}, - "eth_accounts": {}, - "snap_manageState": {}, + permissionName: 'wallet_snap_local:http://localhost:8080/', + sourceCode: '(...)', + status: 'stopped', + svgIcon: '...', + version: '0.6.0', + }, + 'Filecoin Snap': { + enabled: true, + id: 'npm:http://localhost:8080/', + initialPermissions: { + snap_confirm: {}, + eth_accounts: {}, + snap_manageState: {}, }, - "manifest": { - "description": "This swap provides developers everywhere access to an entirely new data storage paradigm, even letting your programs store data autonomously. Learn more.", - "initialPermissions": { - "snap_confirm": {}, - "eth_accounts": {}, - "snap_manageState": {}, + manifest: { + description: + 'This swap provides developers everywhere access to an entirely new data storage paradigm, even letting your programs store data autonomously. Learn more.', + initialPermissions: { + snap_confirm: {}, + eth_accounts: {}, + snap_manageState: {}, }, - "manifestVersion": "0.1", - "proposedName": "Filecoin Snap", - "repository": { - "type": "git", - "url": "https://github.com/MetaMask/snaps-skunkworks.git" + manifestVersion: '0.1', + proposedName: 'Filecoin Snap', + repository: { + type: 'git', + url: 'https://github.com/MetaMask/snaps-skunkworks.git', }, - "source": { - "location": { - "npm": { - "filePath": "dist/bundle.js", - "iconPath": "images/icon.svg", - "packageName": "@metamask/example-snap", - "registry": "https://registry.npmjs.org/" - } + source: { + location: { + npm: { + filePath: 'dist/bundle.js', + iconPath: 'images/icon.svg', + packageName: '@metamask/example-snap', + registry: 'https://registry.npmjs.org/', + }, }, - "shasum": "3lEt0yUu080DwV78neROaAAIQWXukSkMnP4OBhOhBnE=" + shasum: '3lEt0yUu080DwV78neROaAAIQWXukSkMnP4OBhOhBnE=', }, - "version": "0.6.0" + version: '0.6.0', }, - "permissionName": "wallet_snap_npm:http://localhost:8080/", - "sourceCode": "(...)", - "status": "stopped", - "svgIcon": "...", - "version": "0.6.0" + permissionName: 'wallet_snap_npm:http://localhost:8080/', + sourceCode: '(...)', + status: 'stopped', + svgIcon: '...', + version: '0.6.0', }, }, accountArray: [ @@ -486,32 +483,46 @@ const state = { ], detectedTokens: [ { - address: "0x514910771AF9Ca656af840dff83E8264EcF986CA", + address: '0x514910771AF9Ca656af840dff83E8264EcF986CA', decimals: 18, - symbol: "LINK", - image: "https://crypto.com/price/coin-data/icon/LINK/color_icon.png", - aggregators:[ - "coinGecko","oneInch","paraswap","zapper","zerion" - ] + symbol: 'LINK', + image: 'https://crypto.com/price/coin-data/icon/LINK/color_icon.png', + aggregators: ['coinGecko', 'oneInch', 'paraswap', 'zapper', 'zerion'], }, { - address: "0xc00e94Cb662C3520282E6f5717214004A7f26888", + address: '0xc00e94Cb662C3520282E6f5717214004A7f26888', decimals: 18, - symbol: "COMP", - image: "https://crypto.com/price/coin-data/icon/COMP/color_icon.png", - aggregators:[ - "bancor","cmc","cryptocom","coinGecko","oneInch","paraswap","pmm","zapper","zerion","zeroEx" - ] + symbol: 'COMP', + image: 'https://crypto.com/price/coin-data/icon/COMP/color_icon.png', + aggregators: [ + 'bancor', + 'cmc', + 'cryptocom', + 'coinGecko', + 'oneInch', + 'paraswap', + 'pmm', + 'zapper', + 'zerion', + 'zeroEx', + ], }, { - address: "0xfffffffFf15AbF397dA76f1dcc1A1604F45126DB", + address: '0xfffffffFf15AbF397dA76f1dcc1A1604F45126DB', decimals: 18, - symbol: "FSW", - image: "https://assets.coingecko.com/coins/images/12256/thumb/falconswap.png?1598534184", - aggregators:[ - "aave", "cmc","coinGecko","oneInch","paraswap","zapper","zerion" - ] - } + symbol: 'FSW', + image: + 'https://assets.coingecko.com/coins/images/12256/thumb/falconswap.png?1598534184', + aggregators: [ + 'aave', + 'cmc', + 'coinGecko', + 'oneInch', + 'paraswap', + 'zapper', + 'zerion', + ], + }, ], pendingTokens: {}, customNonceValue: '', @@ -559,18 +570,18 @@ const state = { swapsWelcomeMessageHasBeenShown: true, defaultHomeActiveTabName: 'Assets', provider: { - type: 'ropsten', + type: 'rinkeby', ticker: 'ETH', nickname: '', rpcUrl: '', - chainId: '0x3', + chainId: '0x4', }, previousProviderStore: { - type: 'ropsten', + type: 'rinkeby', ticker: 'ETH', nickname: '', rpcUrl: '', - chainId: '0x3', + chainId: '0x4', }, network: '3', accounts: { @@ -1304,7 +1315,7 @@ const state = { subjects: { 'https://app.uniswap.org': { permissions: { - 'eth_accounts': { + eth_accounts: { invoker: 'https://app.uniswap.org', parentCapability: 'eth_accounts', id: 'a7342e4b-beae-4525-a36c-c0635fd03359', @@ -1318,14 +1329,14 @@ const state = { }, }, }, - "local:http://localhost:8080/": { + 'local:http://localhost:8080/': { permissions: { - 'snap_confirm': { - invoker: "local:http://localhost:8080/", + snap_confirm: { + invoker: 'local:http://localhost:8080/', parentCapability: 'snap_confirm', id: 'a7342F4b-beae-4525-a36c-c0635fd03359', date: 1620710693178, - caveats: [] + caveats: [], }, }, }, @@ -1423,30 +1434,30 @@ const state = { pendingApprovals: {}, pendingApprovalCount: 0, subjectMetadata: { - "http://localhost:8080": { + 'http://localhost:8080': { extensionId: null, iconUrl: null, - name: "Hello, Snaps!", - origin: "http://localhost:8080", - subjectType: "website" + name: 'Hello, Snaps!', + origin: 'http://localhost:8080', + subjectType: 'website', }, - "https://metamask.github.io": { + 'https://metamask.github.io': { extensionId: null, iconUrl: null, - name: "Snaps Iframe Execution Environment", - origin: "https://metamask.github.io", - subjectType: "website" + name: 'Snaps Iframe Execution Environment', + origin: 'https://metamask.github.io', + subjectType: 'website', }, - "local:http://localhost:8080/": { + 'local:http://localhost:8080/': { extensionId: null, iconUrl: null, - name: "MetaMask Example Snap", - origin: "local:http://localhost:8080/", - subjectType: "snap", - svgIcon: "...", - version: "0.6.0" - } - } + name: 'MetaMask Example Snap', + origin: 'local:http://localhost:8080/', + subjectType: 'snap', + svgIcon: '...', + version: '0.6.0', + }, + }, }, appState: { shouldClose: false, @@ -1455,7 +1466,14 @@ const state = { open: false, modalState: { name: null, - props: {}, + props: { + token: { + address: '0xaD6D458402F60fD3Bd25163575031ACDce07538D', + symbol: 'DAI', + decimals: 18, + }, + history: {}, + }, }, previousModalState: { name: null, @@ -1507,6 +1525,12 @@ const state = { amount: { error: 'amount', }, + currentTransactionUUID: 'test-uuid', + draftTransactions: { + 'test-uuid': { + ...draftTransactionInitialState, + }, + }, }, confirmTransaction: { txData: { diff --git a/.yarnrc b/.yarnrc index 2088d635c..5455c6c5d 100644 --- a/.yarnrc +++ b/.yarnrc @@ -1 +1 @@ -ignore-scripts true \ No newline at end of file +ignore-scripts true diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fd2689d6..78c96256a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,7 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [10.18.0] ### Added -- Add setApprovalForAll confirmation view so granted permissions are displayed in a digested manner, instead of a simple contract interaction([#15010](https://github.com/MetaMask/metamask-extension/pull/15010)) +- Add setApprovalForAll confirmation view so granted permissions are displayed in a digested manner, instead of a simple contract interaction([#15010](https://github.com/MetaMask/metamask-extension/pull/15010)) - Add warning when performing a Send directly to a token contract([#13588](https://github.com/MetaMask/metamask-extension/pull/13588)) ### Changed @@ -131,7 +131,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix switching between ETH and USD in the amount field on the send screen ([#13827](https://github.com/MetaMask/metamask-extension/pull/13827)) - Fix addition of 'add recipient' events to the send flow change logs so that 'contact' and 'recent' recipient are correctly distinguished ([#14771](https://github.com/MetaMask/metamask-extension/pull/14771)) - Fix lock button sizing for text exceeding button boundaries ([#14335](https://github.com/MetaMask/metamask-extension/pull/14335)) -- Fix all "MetaMask" instances wrongly written as "Metamask" +- Fix all "MetaMask" instances wrongly written as "Metamask" - ([#14851](https://github.com/MetaMask/metamask-extension/pull/14851)) - ([#14848](https://github.com/MetaMask/metamask-extension/pull/14848)) - Fix design break on the Settings navbar for certain locales ([#14012](https://github.com/MetaMask/metamask-extension/pull/14012)) diff --git a/README.md b/README.md index 835cfe3bb..7d7c5f19b 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ To learn how to contribute to the MetaMask project itself, visit our [Internal D ## Building locally -- Install [Node.js](https://nodejs.org) version 14 +- Install [Node.js](https://nodejs.org) version 16 - If you are using [nvm](https://github.com/creationix/nvm#installation) (recommended) running `nvm use` will automatically choose the right node version for you. - Install [Yarn](https://yarnpkg.com/en/docs/install) - Install dependencies: `yarn setup` (not the usual install command) @@ -72,9 +72,9 @@ Our e2e test suite can be run on either Firefox or Chrome. In either case, start ```console --browser Set the browser used; either 'chrome' or 'firefox'. ---leave-running Leaves the browser running after a test fails, along with anything else +--leave-running Leaves the browser running after a test fails, along with anything else that the test used (ganache, the test dapp, etc.). - + --retries Set how many times the test should be retried upon failure. Default is 0. ``` @@ -91,20 +91,25 @@ Whenever you change dependencies (adding, removing, or updating, either in `pack * The `allow-scripts` configuration in `package.json` * Run `yarn allow-scripts auto` to update the `allow-scripts` configuration automatically. This config determines whether the package's install/postinstall scripts are allowed to run. Review each new package to determine whether the install script needs to run or not, testing if necessary. * Unfortunately, `yarn allow-scripts auto` will behave inconsistently on different platforms. macOS and Windows users may see extraneous changes relating to optional dependencies. -* The LavaMoat policy files. The _tl;dr_ is to run `yarn lavamoat:auto` to update these files, but there can be devils in the details. Continue reading for more information. +* The LavaMoat policy files. The _tl;dr_ is to run `yarn lavamoat:auto` to update these files, but there can be devils in the details: * There are two sets of LavaMoat policy files: - * The production LavaMoat policy files (`lavamoat/browserify/*/policy.json`), which are re-generated using `yarn lavamoat:background:auto`. + * The production LavaMoat policy files (`lavamoat/browserify/*/policy.json`), which are re-generated using `yarn lavamoat:background:auto`. Add `--help` for usage. * These should be regenerated whenever the production dependencies for the background change. * The build system LavaMoat policy file (`lavamoat/build-system/policy.json`), which is re-generated using `yarn lavamoat:build:auto`. * This should be regenerated whenever the dependencies used by the build system itself change. * Whenever you regenerate a policy file, review the changes to determine whether the access granted to each package seems appropriate. * Unfortunately, `yarn lavamoat:auto` will behave inconsistently on different platforms. macOS and Windows users may see extraneous changes relating to optional dependencies. + * If you keep getting policy failures even after regenerating the policy files, try regenerating the policies after a clean install by doing: + * `rm -rf node_modules/ && yarn setup && yarn lavamoat:auto` * Keep in mind that any kind of dynamic import or dynamic use of globals may elude LavaMoat's static analysis. Refer to the LavaMoat documentation or ask for help if you run into any issues. ## Architecture +- [Visual of the controller heirarchy and dependencies as of summer 2022.](https://gist.github.com/rekmarks/8dba6306695dcd44967cce4b6a94ae33) +- [Visual of the entire codebase.](https://mango-dune-07a8b7110.1.azurestaticapps.net/?repo=metamask%2Fmetamask-extension) + [![Architecture Diagram](./docs/architecture.png)][1] ## Other Docs @@ -114,7 +119,12 @@ Whenever you change dependencies (adding, removing, or updating, either in `pack - [How to add a new translation to MetaMask](./docs/translating-guide.md) - [Publishing Guide](./docs/publishing.md) - [How to use the TREZOR emulator](./docs/trezor-emulator.md) -- [Developing on MetaMask](./development/README.md) +- [Developing on MetaMask](./development/README.md) - [How to generate a visualization of this repository's development](./development/gource-viz.sh) +## Dapp Developer Resources +- [Extend MetaMask's features w/ MetaMask Snaps.](https://docs.metamask.io/guide/snaps.html) +- [Prompt your users to add and switch to a new network.](https://medium.com/metamask/connect-users-to-layer-2-networks-with-the-metamask-custom-networks-api-d0873fac51e5) +- [Change the logo that appears when your dapp connects to MetaMask.](https://docs.metamask.io/guide/defining-your-icon.html) + [1]: http://www.nomnoml.com/#view/%5B%3Cactor%3Euser%5D%0A%0A%5Bmetamask-ui%7C%0A%20%20%20%5Btools%7C%0A%20%20%20%20%20react%0A%20%20%20%20%20redux%0A%20%20%20%20%20thunk%0A%20%20%20%20%20ethUtils%0A%20%20%20%20%20jazzicon%0A%20%20%20%5D%0A%20%20%20%5Bcomponents%7C%0A%20%20%20%20%20app%0A%20%20%20%20%20account-detail%0A%20%20%20%20%20accounts%0A%20%20%20%20%20locked-screen%0A%20%20%20%20%20restore-vault%0A%20%20%20%20%20identicon%0A%20%20%20%20%20config%0A%20%20%20%20%20info%0A%20%20%20%5D%0A%20%20%20%5Breducers%7C%0A%20%20%20%20%20app%0A%20%20%20%20%20metamask%0A%20%20%20%20%20identities%0A%20%20%20%5D%0A%20%20%20%5Bactions%7C%0A%20%20%20%20%20%5BbackgroundConnection%5D%0A%20%20%20%5D%0A%20%20%20%5Bcomponents%5D%3A-%3E%5Bactions%5D%0A%20%20%20%5Bactions%5D%3A-%3E%5Breducers%5D%0A%20%20%20%5Breducers%5D%3A-%3E%5Bcomponents%5D%0A%5D%0A%0A%5Bweb%20dapp%7C%0A%20%20%5Bui%20code%5D%0A%20%20%5Bweb3%5D%0A%20%20%5Bmetamask-inpage%5D%0A%20%20%0A%20%20%5B%3Cactor%3Eui%20developer%5D%0A%20%20%5Bui%20developer%5D-%3E%5Bui%20code%5D%0A%20%20%5Bui%20code%5D%3C-%3E%5Bweb3%5D%0A%20%20%5Bweb3%5D%3C-%3E%5Bmetamask-inpage%5D%0A%5D%0A%0A%5Bmetamask-background%7C%0A%20%20%5Bprovider-engine%5D%0A%20%20%5Bhooked%20wallet%20subprovider%5D%0A%20%20%5Bid%20store%5D%0A%20%20%0A%20%20%5Bprovider-engine%5D%3C-%3E%5Bhooked%20wallet%20subprovider%5D%0A%20%20%5Bhooked%20wallet%20subprovider%5D%3C-%3E%5Bid%20store%5D%0A%20%20%5Bconfig%20manager%7C%0A%20%20%20%20%5Brpc%20configuration%5D%0A%20%20%20%20%5Bencrypted%20keys%5D%0A%20%20%20%20%5Bwallet%20nicknames%5D%0A%20%20%5D%0A%20%20%0A%20%20%5Bprovider-engine%5D%3C-%5Bconfig%20manager%5D%0A%20%20%5Bid%20store%5D%3C-%3E%5Bconfig%20manager%5D%0A%5D%0A%0A%5Buser%5D%3C-%3E%5Bmetamask-ui%5D%0A%0A%5Buser%5D%3C%3A--%3A%3E%5Bweb%20dapp%5D%0A%0A%5Bmetamask-contentscript%7C%0A%20%20%5Bplugin%20restart%20detector%5D%0A%20%20%5Brpc%20passthrough%5D%0A%5D%0A%0A%5Brpc%20%7C%0A%20%20%5Bethereum%20blockchain%20%7C%0A%20%20%20%20%5Bcontracts%5D%0A%20%20%20%20%5Baccounts%5D%0A%20%20%5D%0A%5D%0A%0A%5Bweb%20dapp%5D%3C%3A--%3A%3E%5Bmetamask-contentscript%5D%0A%5Bmetamask-contentscript%5D%3C-%3E%5Bmetamask-background%5D%0A%5Bmetamask-background%5D%3C-%3E%5Bmetamask-ui%5D%0A%5Bmetamask-background%5D%3C-%3E%5Brpc%5D%0A diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index 7951a4640..9b6290245 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -157,6 +157,9 @@ "addMemo": { "message": "Notiz hinzufügen" }, + "addMoreNetworks": { + "message": "weitere Netzwerke manuell hinzufügen" + }, "addNetwork": { "message": "Netzwerk hinzufügen" }, @@ -282,9 +285,6 @@ "approvedAsset": { "message": "Genehmigtes Asset" }, - "areYouDeveloper": { - "message": "Sind Sie ein Entwickler?" - }, "areYouSure": { "message": "Sind Sie sicher?" }, @@ -438,7 +438,7 @@ "message": "$1 mit Wyre kaufen" }, "buyWithWyreDescription": { - "message": "Wyre ermöglicht Ihnen die Verwendung einer Kreditkarte zum direkten Einzahlen von $1 auf Ihr MetaMask-Konto." + "message": "Einfaches Onboarding für Käufe bis zu 1000 $. Schnelle interaktive Überprüfung von Käufen mit hohem Limit. Unterstützt Debit-/Kreditkarte, Apple Pay, Banküberweisungen. Verfügbar in über 100 Ländern. Einzahlung von Token auf Ihr MetaMask-Konto" }, "bytes": { "message": "Bytes" @@ -466,6 +466,13 @@ "message": "Für eine Transaktion im Wert von $1 muss die Gasgebühr um mindestens 10 % erhöht werden, damit sie vom Netz erkannt wird.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwapForFee": { + "message": "Tausch für 1 $ abbrechen", + "description": "$1 could be e.g. $2.98, it is a cost for cancelling a Smart Transaction" + }, + "cancelSwapForFree": { + "message": "Tausch kostenlos abbrechen" + }, "cancellationGasFee": { "message": "Stornierungs-Gasgebühr" }, @@ -732,7 +739,7 @@ }, "customGasSettingToolTipMessage": { "message": "$1 verwenden, um den Gaspreis anzupassen. Das kann verwirrend sein, wenn Sie damit nicht vertraut sind. Interaktion auf eigene Gefahr.", - "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold font-weight" }, "customGasSubTitle": { "message": "Höhere Gebühren können Bearbeitungszeiten verkürzen, wofür es allerdings keine Garantie gibt." @@ -818,7 +825,7 @@ }, "depositCrypto": { "message": "$1 einzahlen", - "description": "$1 represents the cypto symbol to be purchased" + "description": "$1 represents the crypto symbol to be purchased" }, "description": { "message": "Beschreibung" @@ -1196,9 +1203,6 @@ "failureMessage": { "message": "Etwas ist schief gelaufen und wir konnten die Aktion nicht abschließen" }, - "fakeTokenWarning": { - "message": "Jeder kann ein Token erstellen, einschließlich der Erstellung gefälschter Versionen bestehender Token. Erfahren Sie mehr über $1" - }, "fast": { "message": "Schnell" }, @@ -1463,7 +1467,7 @@ }, "highGasSettingToolTipMessage": { "message": "Hohe Wahrscheinlichkeit, auch in volatilen Märkten. Verwenden Sie $1, um Schwankungen im Netzwerkverkehr, die z. B. durch den Ausfall beliebter NFTs entstehen, abzudecken.", - "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold font-weight" }, "highLowercase": { "message": "hoch" @@ -1766,7 +1770,7 @@ }, "lowGasSettingToolTipMessage": { "message": "Verwenden Sie $1, um auf einen günstigeren Preis zu warten. Zeitschätzungen sind viel ungenauer, da die Preise nicht vorhersehbar sind.", - "description": "$1 is key 'low' separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'low' separated here so that it can be passed in with bold font-weight" }, "lowLowercase": { "message": "niedrig" @@ -1810,7 +1814,7 @@ }, "mediumGasSettingToolTipMessage": { "message": "Verwenden Sie $1 für schnelle Verarbeitung zum aktuellen Marktpreis.", - "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold font-weight" }, "memo": { "message": " Memo" @@ -1943,6 +1947,9 @@ "network": { "message": "Netzwerk:" }, + "networkAddedSuccessfully": { + "message": "Netzwerk erfolgreich hinzugefügt!" + }, "networkDetails": { "message": "Netzwerkdetails" }, @@ -2059,6 +2066,9 @@ "message": "Nonce ist höher als vorgeschlagen nonce von $1", "description": "The next nonce according to MetaMask's internal logic" }, + "nft": { + "message": "NFT" + }, "nftTokenIdPlaceholder": { "message": "Token-ID eingeben" }, @@ -2130,7 +2140,7 @@ }, "notifications10ActionText": { "message": "Einstellungen ansehen", - "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." + "description": "The 'call to action' on the button, or link, of the 'Visit in Settings' notification. Upon clicking, users will be taken to Settings page." }, "notifications10DescriptionOne": { "message": "Die verbesserte Token-Erkennung ist derzeit in den Netzwerken Ethereum Mainnet, Polygon, BSC und Avalanche verfügbar. Es gibt bald mehr!" @@ -2225,7 +2235,7 @@ }, "notifications8ActionText": { "message": "Zu den erweiterten Einstellungen gehen", - "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced Settings page." + "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced settings page." }, "notifications8DescriptionOne": { "message": "Ab MetaMask v10.4.0 benötigen Sie kein Ledger Live mehr, um Ihr Ledger Gerät mit MetaMask zu verbinden.", @@ -2261,10 +2271,6 @@ "notificationsMarkAllAsRead": { "message": "Alle als gelesen markieren" }, - "numberOfNewTokensDetected": { - "message": "$1 neue Tokens in diesem Konto gefunden\n", - "description": "$1 is the number of new tokens detected" - }, "ofTextNofM": { "message": "von" }, @@ -2344,9 +2350,6 @@ "message": "Öffnen Sie MetaMask im Vollbildmodus, um Ihren Ledger über WebHID zu verbinden.", "description": "Shown to the user on the confirm screen when they are viewing MetaMask in a popup window but need to connect their ledger via webhid." }, - "openSourceCode": { - "message": "Prüfen Sie den Quellcode" - }, "optional": { "message": "Optional" }, @@ -2473,7 +2476,7 @@ }, "preferredLedgerConnectionType": { "message": "Bevorzugter Ledger-Verbindungstyp", - "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" + "description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message" }, "preparingSwap": { "message": "Swap wird vorbereitet ..." @@ -2877,6 +2880,12 @@ "showAdvancedGasInlineDescription": { "message": "Wählen Sie dies aus, um den Gaspreis und die Limitkontrollen direkt auf den Senden- und Bestätigen-Bildschirmen anzuzeigen." }, + "showCustomNetworkList": { + "message": "Benutzerdefinierte Netzwerkliste anzeigen" + }, + "showCustomNetworkListDescription": { + "message": "Diese Option zeigt eine Liste von Netzwerken mit vorausgefüllten Details an, sobald ein neues Netzwerk hinzugefügt wird." + }, "showFiatConversionInTestnets": { "message": "Umwandlung auf Testnets anzeigen" }, @@ -2967,10 +2976,6 @@ "snapInstallWarningCheck": { "message": "Um zu bestätigen, dass Sie alles verstanden haben, kreuzen Sie alles an." }, - "snapInstallWarningKeyAccess": { - "message": "Sie gewähren dem Snap „$1“ wichtige Zugriffsrechte. Dies kann nicht rückgängig gemacht werden und gibt „$1“ Kontrolle über Ihre Konten und Vermögenswerte. Stellen Sie sicher, dass Sie „$1“ vertrauen, bevor Sie fortfahren.", - "description": "The parameter is the name of the snap" - }, "snapRequestsPermission": { "message": "Für diesen Snap werden die folgenden Berechtigungen beantragt:" }, @@ -2986,6 +2991,9 @@ "snapsToggle": { "message": "Ein Snap wird nur ausgeführt, wenn er aktiviert ist" }, + "someNetworksMayPoseSecurity": { + "message": "Einige Netzwerke können Sicherheits- und/oder Datenschutzrisiken bergen. Informieren Sie sich über die Risiken, bevor Sie ein Netzwerk hinzufügen und nutzen." + }, "somethingWentWrong": { "message": "Hoppla! Da hat etwas nicht geklappt." }, @@ -3075,7 +3083,7 @@ "message": "Status" }, "statusConnected": { - "message": "Verbunden" + "message": "Verbinden" }, "statusNotConnected": { "message": "Nicht verbunden" @@ -3548,6 +3556,10 @@ "switchNetworks": { "message": "Netzwerk wechseln" }, + "switchToNetwork": { + "message": "Zu 1 $ wechseln", + "description": "$1 represents the custom network that has previously been added" + }, "switchToThisAccount": { "message": "Zu diesem Konto wechseln" }, @@ -3635,7 +3647,7 @@ }, "toggleTestNetworks": { "message": "$1 Test-Netzwerke", - "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open to the advanced settings where users can enable the display of test networks in the network dropdown." + "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open Settings > Advanced where users can enable the display of test networks in the network dropdown." }, "token": { "message": "Token" @@ -3664,12 +3676,6 @@ "tokenDetectionAlertMessage": { "message": "Die Token-Erkennung ist derzeit für $1 verfügbar. $2" }, - "tokenDetectionAnnouncement": { - "message": "Neu! Verbesserte Token Erkennung ist im Ethereum Mainnet als experimentelle Funktion verfügbar. $1" - }, - "tokenDetectionToggleDescription": { - "message": "Die Token-API von ConsenSys sammelt eine Liste von Token aus verschiedenen Token-Listen von Drittanbietern. Wenn Sie diese Funktion deaktivieren, werden keine neuen Token mehr erkannt, die zu Ihrer Wallet hinzugefügt werden, aber die Option zur Suche nach Token für den Import bleibt erhalten." - }, "tokenId": { "message": "Token-ID" }, @@ -3851,6 +3857,9 @@ "unknownCameraErrorTitle": { "message": "Hoppla! Etwas ist schiefgegangen ..." }, + "unknownCollection": { + "message": "Unbenannte Sammlung" + }, "unknownNetwork": { "message": "Unbekanntes privates Netzwerk" }, @@ -3901,12 +3910,6 @@ "usePhishingDetectionDescription": { "message": "Zeigt eine Warnung für Phishing-Domänen, die Ethereum Benutzer ansprechen" }, - "useTokenDetection": { - "message": "Token-Erkennung verwenden" - }, - "useTokenDetectionDescription": { - "message": "Wir verwenden Drittanbieter-API, um neue an Ihre Wallet gesendete Token zu erkennen und anzuzeigen. Deaktivieren Sie diese, wenn Sie nicht möchten, dass MetaMask Daten von diesen Diensten abruft." - }, "useTokenDetectionPrivacyDesc": { "message": "Die automatische Anzeige der an Ihr Konto gesendeten Token erfordert die Kommunikation mit Servern von Drittanbietern, um die Bilder der Token abzurufen. Diese Server haben Zugriff auf Ihre IP-Adresse." }, @@ -3962,7 +3965,7 @@ "description": "$1 is the action type. e.g (Account, Transaction, Swap)" }, "visitWebSite": { - "message": "Gehe zu unserer Webseite" + "message": "Besuchen Sie unsere Webseite" }, "walletConnectionGuide": { "message": "unsere Hardware-Wallet-Verbindungsanleitung" @@ -3987,6 +3990,9 @@ "walletCreationSuccessTitle": { "message": "Wallet-Erstellung erfolgreich" }, + "wantToAddThisNetwork": { + "message": "Möchten Sie dieses Netzwerk hinzufügen?" + }, "warning": { "message": "Warnung" }, @@ -4049,6 +4055,10 @@ "yesLetsTry": { "message": "Ja, versuchen wir es" }, + "youHaveAddedAll": { + "message": "Sie haben alle beliebten Netzwerke hinzugefügt. Sie können weitere Netzwerke entdecken 1 $ oder Sie können 2 $", + "description": "$1 is a link with the text 'here' and $2 is a button with the text 'add more networks manually'" + }, "youNeedToAllowCameraAccess": { "message": "Sie müssen Zugriff auf die Kamera erlauben, um diese Funktion nutzen zu können." }, diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index 649655d5e..1afdfcc9e 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -157,6 +157,9 @@ "addMemo": { "message": "Προσθήκη σημειώματος" }, + "addMoreNetworks": { + "message": "προσθέστε περισσότερα δίκτυα χειροκίνητα" + }, "addNetwork": { "message": "Προσθήκη Δικτύου" }, @@ -227,6 +230,10 @@ "alerts": { "message": "Ειδοποιήσεις" }, + "allOfYour": { + "message": "Όλα σας τα $1", + "description": "$1 is the symbol or name of the token that the user is approving spending" + }, "allowExternalExtensionTo": { "message": "Επιτρέψτε σε αυτή την εξωτερική επέκταση να:" }, @@ -263,6 +270,10 @@ "approve": { "message": "Έγκριση" }, + "approveAllTokensTitle": { + "message": "Δίνετε άδεια για να αποκτήσετε πρόσβαση σε όλα σας τα $1;", + "description": "$1 is the symbol of the token for which the user is granting approval" + }, "approveAndInstall": { "message": "Έγκριση και Εγκατάσταση" }, @@ -282,9 +293,6 @@ "approvedAsset": { "message": "Εγκεκριμένο περιουσιακό στοιχείο" }, - "areYouDeveloper": { - "message": "Είστε προγραμματιστής;" - }, "areYouSure": { "message": "Είστε βέβαιος/η;" }, @@ -438,7 +446,7 @@ "message": "Αγοράστε $1 με το Wyre" }, "buyWithWyreDescription": { - "message": "Το Wyre σας επιτρέπει να χρησιμοποιήσετε μια πιστωτική κάρτα για να καταθέσετε $1 απευθείας στον λογαριασμό σας MetaTask." + "message": "Εύκολη ενσωμάτωση για αγορές μέχρι και $ 1000. Γρήγορη διαδραστική επαλήθευση αγοράς υψηλού ορίου. Υποστηρίζει χρεωστικές/πιστωτικές κάρτες, Apple Pay, Τραπεζικές Μεταφορές. Διαθέσιμο σε 100+ χώρες. Καταθέσεις token στον λογαριασμό σας MetaMask" }, "bytes": { "message": "Bytes" @@ -466,6 +474,13 @@ "message": "Για να $1 τη συναλλαγή, τα τέλη συναλλαγής πρέπει να αυξηθούν κατά τουλάχιστον 10% ώστε να αναγνωριστούν από το δίκτυο.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwapForFee": { + "message": "Ακυρώστε τη συναλλαγή για ~$1", + "description": "$1 could be e.g. $2.98, it is a cost for cancelling a Smart Transaction" + }, + "cancelSwapForFree": { + "message": "Ακυρώστε τη συναλλαγή δωρεάν" + }, "cancellationGasFee": { "message": "Ακύρωση Χρέωσης Αερίου" }, @@ -732,7 +747,7 @@ }, "customGasSettingToolTipMessage": { "message": "Χρησιμοποιήστε 1 $ για να προσαρμόσετε την τιμή του τέλους συναλλαγής. Αυτό μπορεί να προκαλέσει σύγχυση, αν δεν είστε εξοικειωμένοι. Επεξεργαστείτε το με δικό σας ρίσκο.", - "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold font-weight" }, "customGasSubTitle": { "message": "Η αύξηση των τελών μπορεί να μειώσει τους χρόνους επεξεργασίας, αλλά αυτό δεν είναι εγγυημένο." @@ -818,7 +833,7 @@ }, "depositCrypto": { "message": "Κατάθεση $1", - "description": "$1 represents the cypto symbol to be purchased" + "description": "$1 represents the crypto symbol to be purchased" }, "description": { "message": "Περιγραφή" @@ -1196,9 +1211,6 @@ "failureMessage": { "message": "Κάτι πήγε λάθος και δεν μπορέσαμε να ολοκληρώσουμε την ενέργεια" }, - "fakeTokenWarning": { - "message": "Οποιοσδήποτε μπορεί να δημιουργήσει ένα token, συμπεριλαμβανομένης της δημιουργίας ψεύτικων εκδόσεων των υφιστάμενων tokens. Μάθετε περισσότερα γι'αυτό $1" - }, "fast": { "message": "Γρήγορα" }, @@ -1277,6 +1289,9 @@ "functionApprove": { "message": "Λειτουργία: Έγκριση" }, + "functionSetApprovalForAll": { + "message": "Λειτουργία: SetApprovalForAll" + }, "functionType": { "message": "Τύπος Λειτουργίας" }, @@ -1463,7 +1478,7 @@ }, "highGasSettingToolTipMessage": { "message": "Χρησιμοποιήστε $1 για να καλύψετε απότομες αυξήσεις της κίνησης του δικτύου λόγω των δημοφιλών ξεκινημάτων NFT.", - "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold font-weight" }, "highLowercase": { "message": "υψηλό" @@ -1617,6 +1632,9 @@ "invalidSeedPhrase": { "message": "Μη έγκυρη Μυστική Φράση Ανάκτησής" }, + "invalidSeedPhraseCaseSensitive": { + "message": "Μη έγκυρη εισαγωγή! Η Μυστική σας Φράση Ανάκτησης κάνει διάκριση πεζών-κεφαλαίων." + }, "ipfsGateway": { "message": "Πύλη IPFS" }, @@ -1766,7 +1784,7 @@ }, "lowGasSettingToolTipMessage": { "message": "Χρησιμοποιήστε 1 $ για να περιμένετε για μια φθηνότερη τιμή. Οι εκτιμήσεις του χρόνου είναι πολύ λιγότερο ακριβείς καθώς οι τιμές είναι κάπως απρόβλεπτες.", - "description": "$1 is key 'low' separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'low' separated here so that it can be passed in with bold font-weight" }, "lowLowercase": { "message": "χαμηλό" @@ -1810,7 +1828,7 @@ }, "mediumGasSettingToolTipMessage": { "message": "Χρησιμοποιήστε $1 για γρήγορη επεξεργασία στην τρέχουσα τιμή της αγοράς.", - "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold font-weight" }, "memo": { "message": "σημείωμα" @@ -1892,6 +1910,19 @@ "message": "επαληθεύστε τα στοιχεία δικτύου", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." }, + "mismatchedChainRecommendation": { + "message": "Σας προτείνουμε να $1 πριν συνεχίσετε.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key. The link will open to instructions for users to validate custom network details." + }, + "mismatchedNetworkName": { + "message": "Σύμφωνα με τις καταχωρήσεις μας, το όνομα δικτύου ίσως δεν ταιριάζει με το αναγνωριστικό αλυσίδας." + }, + "mismatchedNetworkSymbol": { + "message": "Το σύμβολο νομίσματος που υποβλήθηκε δεν ταιριάζει με αυτό που αναμενόταν για αυτό το αναγνωριστικό αλυσίδας." + }, + "mismatchedRpcUrl": { + "message": "Σύμφωνα με τις καταχωρήσεις μας, η τιμή RPC URL που υποβλήθηκε δεν ταιριάζει με κάποιον γνωστό πάροχο για αυτό το αναγνωριστικό αλυσίδας." + }, "missingNFT": { "message": "Δεν βλέπετε το NFT σας;" }, @@ -1943,6 +1974,9 @@ "network": { "message": "Δίκτυο:" }, + "networkAddedSuccessfully": { + "message": "Το δίκτυο προστέθηκε επιτυχώς!" + }, "networkDetails": { "message": "Λεπτομέρειες Δικτύου" }, @@ -2059,6 +2093,9 @@ "message": "Το Nonce είναι υψηλότερο από το προτεινόμενο nonce του $1", "description": "The next nonce according to MetaMask's internal logic" }, + "nft": { + "message": "NFT" + }, "nftTokenIdPlaceholder": { "message": "Εισάγετε το συλλεκτικό αναγνωριστικό" }, @@ -2130,7 +2167,7 @@ }, "notifications10ActionText": { "message": "Μετάβαση στις Ρυθμίσεις", - "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." + "description": "The 'call to action' on the button, or link, of the 'Visit in Settings' notification. Upon clicking, users will be taken to Settings page." }, "notifications10DescriptionOne": { "message": "Ο βελτιωμένος εντοπισμός token είναι προς το παρόν διαθέσιμος στα δίκτυα Ethereum Mainnet, Polygon, BSC και Avalanche. Περισσότερα προσεχώς!" @@ -2154,11 +2191,21 @@ "message": "Ενεργοποίηση dark mode" }, "notifications12Description": { - "message": "Το Dark Mode (σκουρόχρωμη λειτουργία) θα ενεργοποιηθεί για νέους χρήστες ανάλογα με τις προτιμήσεις του συστήματός τους. Εάν είστε ήδη χρήστης, ενεργοποιήστε τo dark mode με μη αυτόματο τρόπο στην ενότητα Ρυθμίσεις -> Πειραματικές." + "message": "Έφτασε επιτέλους το Dark Mode (σκουρόχρωμη λειτουργία)! Για να το ενεργοποιήσετε, μεταβείτε στις Ρυθμίσεις -> Πειραματικό και επιλέξτε μία από τις επιλογές εμφάνισης: Light, Dark, Σύστημα." }, "notifications12Title": { "message": "Θέλετε dark mode; Τώρα έχετε dark mode! 🕶️🦊" }, + "notifications13ActionText": { + "message": "Προβολή λίστας προσαρμοσμένων δικτύων" + }, + "notifications13Description": { + "message": "Τώρα μπορείτε να προσθέσετε εύκολα τα ακόλουθα δημοφιλή προσαρμοσμένα δίκτυα: Arbitrum, Avalanche, Binance Smart Chain, Fantom, Harmony, Optimism, Palm and Polygon! Για να ενεργοποιήσετε αυτήν τη λειτουργία, πηγάινετε στις Ρυθμίσεις -> Πειραματικό και ενεργοποιήστε το «Προβολή λίστας προσαρμοσμένων δικτύων»!", + "description": "Description of a notification in the 'See What's New' popup. Describes popular network feature." + }, + "notifications13Title": { + "message": "Προσθήκη Δημοφιλών Δικτύων" + }, "notifications1Description": { "message": "Οι χρήστες του MetaMask Mobile μπορούν τώρα να ανταλλάξουν tokens μέσα στο κινητό τους πορτοφόλι. Σαρώστε τον κωδικό QR για να πάρετε την εφαρμογή για κινητά και να αρχίσετε να ανταλλάζετε.", "description": "Description of a notification in the 'See What's New' popup. Describes the swapping on mobile feature." @@ -2225,7 +2272,7 @@ }, "notifications8ActionText": { "message": "Μεταβείτε στις Ρυθμίσεις για Προχωρημένους", - "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced Settings page." + "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced settings page." }, "notifications8DescriptionOne": { "message": "Από τη MetaMask v10.4.0 και μετά, δεν χρειάζεστε πλέον το Ledger Live για να συνδέσετε τη συσκευή Ledger με το MetaMask.", @@ -2261,10 +2308,6 @@ "notificationsMarkAllAsRead": { "message": "Επισήμανση όλων ως αναγνωσμένων" }, - "numberOfNewTokensDetected": { - "message": "$1 νέα token βρέθηκαν σε αυτόν τον λογαριασμό", - "description": "$1 is the number of new tokens detected" - }, "ofTextNofM": { "message": "από" }, @@ -2344,9 +2387,6 @@ "message": "Ανοίξτε το MetaMask σε πλήρη οθόνη για να συνδέσετε το ledger σας μέσω WebHID.", "description": "Shown to the user on the confirm screen when they are viewing MetaMask in a popup window but need to connect their ledger via webhid." }, - "openSourceCode": { - "message": "Ελέγξτε τον πηγαίο κώδικα" - }, "optional": { "message": "Προαιρετικό" }, @@ -2473,7 +2513,7 @@ }, "preferredLedgerConnectionType": { "message": "Προτιμώμενος Τύπος Σύνδεσης Ledger", - "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" + "description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message" }, "preparingSwap": { "message": "Προετοιμασία ανταλλαγής..." @@ -2676,6 +2716,14 @@ "revealTheSeedPhrase": { "message": "Αποκάλυψη φράσης ανάκτησης" }, + "revokeAllTokensTitle": { + "message": "Ανάκληση άδειας πρόσβασης σε όλα σας τα $1;", + "description": "$1 is the symbol of the token for which the user is revoking approval" + }, + "revokeApproveForAllDescription": { + "message": "Με την ανάκληση της άδειας, το ακόλουθο $1 δεν θα έχει πλέον πρόσβαση στο $2 σας", + "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" + }, "rinkeby": { "message": "Δοκιμαστικό Δίκτυο Rinkeby" }, @@ -2852,12 +2900,23 @@ "message": "Αποστολή $1", "description": "$1 represents the native currency symbol for the current network (e.g. ETH or BNB)" }, + "sendingToTokenContractWarning": { + "message": "Προειδοποίηση: πρόκειται να στείλετε ένα συμβόλαιο token το οποίο ίσως καταλήξει σε απώλεια χρημάτων. $1", + "description": "$1 is a clickable link with text defined by the 'learnMoreUpperCase' key. The link will open to a support article regarding the known contract address warning" + }, "setAdvancedPrivacySettings": { "message": "Ορίστε ρυθμίσεις απορρήτου για προχωρημένους" }, "setAdvancedPrivacySettingsDetails": { "message": "Το MetaMask χρησιμοποιεί αυτές τις αξιόπιστες υπηρεσίες τρίτων για να ενισχύσει τη χρηστικότητα και την ασφάλεια των προϊόντων." }, + "setApprovalForAll": { + "message": "Ρύθμιση Έγκρισης Όλων" + }, + "setApprovalForAllTitle": { + "message": "Έγκριση $1 χωρίς όριο δαπανών", + "description": "The token symbol that is being approved" + }, "settings": { "message": "Ρυθμίσεις" }, @@ -2877,6 +2936,12 @@ "showAdvancedGasInlineDescription": { "message": "Επιλέξτε αυτό για να εμφανίσετε τις τιμές αερίου και να περιορίσετε τα στοιχεία ελέγχου απευθείας στις οθόνες αποστολής και επιβεβαίωσης." }, + "showCustomNetworkList": { + "message": "Προβολή Λίστας Προσαρμοσμένων Δικτύων" + }, + "showCustomNetworkListDescription": { + "message": "Επιλέξτε αυτό για να εμφανιστεί μια λίστα δικτύων με προσυμπληρωμένα στοιχεία κατά την προσθήκη ενός νέου δικτύου." + }, "showFiatConversionInTestnets": { "message": "Εμφάνιση Μετατροπής σε Δοκιμαστικά Δίκτυα" }, @@ -2920,7 +2985,7 @@ "message": "Υπογραφή" }, "signNotice": { - "message": "Η υπογραφή αυτού του μηνύματος μπορεί να έχει\nεπικίνδυνες παρενέργειες. Υπογράφετε μηνύματα μόνο από\nτοποθεσίες που εμπιστεύεστε πλήρως με ολόκληρο τον λογαριασμό σας.\n  Αυτή η επικίνδυνη μέθοδος θα καταργηθεί σε μια μελλοντική έκδοση." + "message": "Η υπογραφή αυτού του μηνύματος μπορεί να έχει\nεπικίνδυνες παρενέργειες. Υπογράφετε μηνύματα μόνο από\nτοποθεσίες που εμπιστεύεστε πλήρως με ολόκληρο τον λογαριασμό σας.\n Αυτή η επικίνδυνη μέθοδος θα καταργηθεί σε μια μελλοντική έκδοση." }, "signatureRequest": { "message": "Αίτημα Υπογραφής" @@ -2967,10 +3032,6 @@ "snapInstallWarningCheck": { "message": "Για να επιβεβαιώσετε ότι καταλαβαίνετε, επιλέξτε όλα τα πλαίσια ελέγχου." }, - "snapInstallWarningKeyAccess": { - "message": "Παρέχετε βασική πρόσβαση στο snap \"$1\". Αυτή η ενέργεια είναι μη αναστρέψιμη και παραχωρεί στο \"$1\" τον έλεγχο των λογαριασμών και των περιουσιακών σας στοιχείων. Βεβαιωθείτε ότι εμπιστεύεστε το \"$1\" πριν συνεχίσετε.", - "description": "The parameter is the name of the snap" - }, "snapRequestsPermission": { "message": "Αυτό το snap αιτείται τις παρακάτω άδειες:" }, @@ -2986,6 +3047,9 @@ "snapsToggle": { "message": "Ένα snap θα εκτελεστεί μόνο εάν είναι ενεργοποιημένο" }, + "someNetworksMayPoseSecurity": { + "message": "Ορισμένα δίκτυα ενδέχεται να ενέχουν κινδύνους για την ασφάλεια ή/και το απόρρητο. Ενημερωθείτε για τους κινδύνους πριν προσθέσετε και χρησιμοποιήσετε ένα δίκτυο." + }, "somethingWentWrong": { "message": "Ουπς! Κάτι πήγε στραβά." }, @@ -3548,6 +3612,10 @@ "switchNetworks": { "message": "Αλλαγή Δικτύων" }, + "switchToNetwork": { + "message": "Εναλλαγή σε $1", + "description": "$1 represents the custom network that has previously been added" + }, "switchToThisAccount": { "message": "Εναλλαγή σε αυτόν τον λογαριασμό" }, @@ -3635,7 +3703,7 @@ }, "toggleTestNetworks": { "message": "$1 δοκιμαστικά δίκτυα", - "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open to the advanced settings where users can enable the display of test networks in the network dropdown." + "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open Settings > Advanced where users can enable the display of test networks in the network dropdown." }, "token": { "message": "Διακριτικό" @@ -3664,12 +3732,6 @@ "tokenDetectionAlertMessage": { "message": "Ο εντοπισμός token είναι επί του παρόντος διαθέσιμος στο $1. $2" }, - "tokenDetectionAnnouncement": { - "message": "Νέο! Η βελτιωμένη ανίχνευση token είναι διαθέσιμη στο Ethereum Mainnet ως πειραματικό χαρακτηριστικό. $1" - }, - "tokenDetectionToggleDescription": { - "message": "Το token API της ConsenSys δημιουργεί μια λίστα με token από διάφορες λίστες token τρίτων. Εάν το απενεργοποιήσετε, θα σταματήσει ο εντοπισμός νέων token που προστίθενται στο πορτοφόλι σας, αλλά θα διατηρηθεί η επιλογή αναζήτησης token για εισαγωγή." - }, "tokenId": { "message": "Αναγνωριστικό token" }, @@ -3851,6 +3913,9 @@ "unknownCameraErrorTitle": { "message": "Ουπς! Κάτι πήγε στραβά...." }, + "unknownCollection": { + "message": "Ανώνυμη συλλογή" + }, "unknownNetwork": { "message": "Άγνωστο Ιδιωτικό Δίκτυο" }, @@ -3901,12 +3966,6 @@ "usePhishingDetectionDescription": { "message": "Εμφάνιση μιας προειδοποίησης για τομείς Απάτης Ηλεκτρονικού Ψαρέματος που στοχεύουν χρήστες του Ethereum" }, - "useTokenDetection": { - "message": "Χρήση Ανίχνευσης Token" - }, - "useTokenDetectionDescription": { - "message": "Χρησιμοποιούμε API τρίτων για να εντοπίσουμε και να εμφανίσουμε νέα tokens που αποστέλλονται στο πορτοφόλι σας. Απενεργοποιήστε αν δεν θέλετε το MetaMask να τραβήξει δεδομένα από αυτές τις υπηρεσίες." - }, "useTokenDetectionPrivacyDesc": { "message": "Η αυτόματη εμφάνιση των token που αποστέλλονται στον λογαριασμό σας συνεπάγεται επικοινωνία με διακομιστές τρίτων για τη λήψη εικόνων των token. Αυτοί οι διακομιστές θα έχουν πρόσβαση στη διεύθυνση IP σας." }, @@ -3987,6 +4046,9 @@ "walletCreationSuccessTitle": { "message": "Επιτυχής δημιουργία πορτοφολιού" }, + "wantToAddThisNetwork": { + "message": "Θέλετε να προσθέσετε αυτό το δίκτυο;" + }, "warning": { "message": "Προειδοποίηση" }, @@ -4049,6 +4111,10 @@ "yesLetsTry": { "message": "Ναι, ας δοκιμάσουμε" }, + "youHaveAddedAll": { + "message": "Προσθέσατε όλα τα δημοφιλή δίκτυα. Μπορείτε να ανακαλύψετε περισσότερα δίκτυα $1 Ή μπορείτε να \n $2", + "description": "$1 is a link with the text 'here' and $2 is a button with the text 'add more networks manually'" + }, "youNeedToAllowCameraAccess": { "message": "Πρέπει να επιτρέψετε πρόσβαση στην κάμερα για να χρησιμοποιήσετε αυτήν τη λειτουργία." }, diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index a3ef3b742..89123a67c 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -18,13 +18,13 @@ "message": "After you’ve signed with your wallet, click on 'Get Signature' to receive the signature" }, "QRHardwareSignRequestGetSignature": { - "message": "Get Signature" + "message": "Get signature" }, "QRHardwareSignRequestSubtitle": { "message": "Scan the QR code with your wallet" }, "QRHardwareSignRequestTitle": { - "message": "Request Signature" + "message": "Request signature" }, "QRHardwareUnknownQRCodeTitle": { "message": "Error" @@ -33,16 +33,70 @@ "message": "Invalid QR code. Please scan the sync QR code of the hardware wallet." }, "QRHardwareWalletImporterTitle": { - "message": "Scan QR Code" + "message": "Scan QR code" }, "QRHardwareWalletSteps1Description": { "message": "Connect an airgapped hardware wallet that communicates through QR-codes. Officially supported airgapped hardware wallets include:" }, "QRHardwareWalletSteps1Title": { - "message": "QR-based HW Wallet" + "message": "QR-based HW wallet" }, "QRHardwareWalletSteps2Description": { - "message": "Ngrave (Coming Soon)" + "message": "Ngrave (coming soon)" + }, + "SIWEAddressInvalid": { + "message": "The address in the sign-in request does not match the address of the account you are using to sign in." + }, + "SIWEDomainInvalid": { + "message": "The website you are attempting to sign in to ($1) does not match the domain in the sign-in request. Proceed with caution.", + "description": "$1 represents the website domain" + }, + "SIWEDomainWarningBody": { + "message": "The website ($1) is asking you to sign in to the wrong domain. This may be a phishing attack.", + "description": "$1 represents the website domain" + }, + "SIWELabelChainID": { + "message": "Chain ID:" + }, + "SIWELabelExpirationTime": { + "message": "Expires At:" + }, + "SIWELabelIssuedAt": { + "message": "Issued At:" + }, + "SIWELabelMessage": { + "message": "Message:" + }, + "SIWELabelNonce": { + "message": "Nonce:" + }, + "SIWELabelNotBefore": { + "message": "Not Before:" + }, + "SIWELabelRequestID": { + "message": "Request ID:" + }, + "SIWELabelResources": { + "message": "Resources: $1", + "description": "$1 represents the number of resources" + }, + "SIWELabelURI": { + "message": "URI:" + }, + "SIWELabelVersion": { + "message": "Version:" + }, + "SIWESiteRequestSubtitle": { + "message": "This site is requesting to sign in with" + }, + "SIWESiteRequestTitle": { + "message": "Sign-in request" + }, + "SIWEWarningSubtitle": { + "message": "To confirm you understand, check:" + }, + "SIWEWarningTitle": { + "message": "Are you sure?" }, "about": { "message": "About" @@ -79,17 +133,17 @@ "message": "Account details" }, "accountIdenticon": { - "message": "Account Identicon" + "message": "Account identicon" }, "accountName": { - "message": "Account Name" + "message": "Account name" }, "accountNameDuplicate": { "message": "This account name already exists", "description": "This is an error message shown when the user enters a new account name that matches an existing account name" }, "accountOptions": { - "message": "Account Options" + "message": "Account options" }, "accountSelectionRequired": { "message": "You need to select an account!" @@ -128,7 +182,7 @@ "message": "Add contact" }, "addCustomToken": { - "message": "Add Custom Token" + "message": "Add custom token" }, "addCustomTokenByContractAddress": { "message": "Can’t find a token? You can manually add any token by pasting its address. Token contract addresses can be found on $1.", @@ -164,17 +218,17 @@ "message": "add more networks manually" }, "addNetwork": { - "message": "Add Network" + "message": "Add network" }, "addNetworkTooltipWarning": { "message": "This network connection relies on third parties. This connection may be less reliable or enable third-parties to track activity. $1", "description": "$1 is Learn more link" }, "addSuggestedTokens": { - "message": "Add Suggested Tokens" + "message": "Add suggested tokens" }, "addToken": { - "message": "Add Token" + "message": "Add token" }, "address": { "message": "Address" @@ -201,13 +255,13 @@ "message": "Gas price" }, "advancedOptions": { - "message": "Advanced Options" + "message": "Advanced options" }, "advancedPriorityFeeToolTip": { "message": "Priority fee (aka “miner tip”) goes directly to miners and incentivizes them to prioritize your transaction." }, "affirmAgree": { - "message": "I Agree" + "message": "I agree" }, "airgapVault": { "message": "AirGap Vault" @@ -278,7 +332,10 @@ "description": "$1 is the symbol of the token for which the user is granting approval" }, "approveAndInstall": { - "message": "Approve & Install" + "message": "Approve & install" + }, + "approveAndUpdate": { + "message": "Approve & update" }, "approveButtonText": { "message": "Approve" @@ -296,8 +353,9 @@ "approvedAsset": { "message": "Approved asset" }, - "areYouDeveloper": { - "message": "Are you a developer?" + "approvedOn": { + "message": "Approved on $1", + "description": "$1 is the approval date for a permission" }, "areYouSure": { "message": "Are you sure?" @@ -311,8 +369,11 @@ "assets": { "message": "Assets" }, + "attemptSendingAssets": { + "message": "If you attempt to send assets directly from one network to another, this may result in permanent asset loss. Make sure to use a bridge." + }, "attemptToCancel": { - "message": "Attempt to Cancel?" + "message": "Attempt to cancel?" }, "attemptToCancelDescription": { "message": "Submitting this attempt does not guarantee your original transaction will be cancelled. If the cancellation attempt is successful, you will be charged the transaction fee above." @@ -327,7 +388,7 @@ "message": "You have authorized the following permissions" }, "autoLockTimeLimit": { - "message": "Auto-Lock Timer (minutes)" + "message": "Auto-lock timer (minutes)" }, "autoLockTimeLimitDescription": { "message": "Set the idle time in minutes before MetaMask will become locked." @@ -339,7 +400,10 @@ "message": "Back" }, "backToAll": { - "message": "Back to All" + "message": "Back to all" + }, + "backup": { + "message": "Backup" }, "backupApprovalInfo": { "message": "This secret code is required to recover your wallet in case you lose your device, forget your password, have to re-install MetaMask, or want to access your wallet on another device." @@ -350,6 +414,12 @@ "backupNow": { "message": "Backup now" }, + "backupUserData": { + "message": "Backup your data" + }, + "backupUserDataDescription": { + "message": "You can backup user settings containing preferences and account addresses into a JSON file." + }, "balance": { "message": "Balance" }, @@ -362,6 +432,9 @@ "basic": { "message": "Basic" }, + "beCareful": { + "message": "Be careful" + }, "betaMetamaskDescription": { "message": "Trusted by millions, MetaMask is a secure wallet making the world of web3 accessible to all." }, @@ -394,7 +467,7 @@ "description": "This is used with viewOnEtherscan e.g View Swap on Etherscan" }, "blockExplorerUrl": { - "message": "Block Explorer URL" + "message": "Block explorer URL" }, "blockExplorerUrlDefinition": { "message": "The URL used as the block explorer for this network." @@ -407,7 +480,7 @@ "message": "Blockies" }, "browserNotSupported": { - "message": "Your Browser is not supported..." + "message": "Your browser is not supported..." }, "buildContactList": { "message": "Build your contact list" @@ -458,13 +531,13 @@ "message": "Bytes" }, "canToggleInSettings": { - "message": "You can re-enable this notification in Settings -> Alerts." + "message": "You can re-enable this notification in Settings > Alerts." }, "cancel": { "message": "Cancel" }, "cancelEdit": { - "message": "Cancel Edit" + "message": "Cancel edit" }, "cancelPopoverTitle": { "message": "Cancel transaction" @@ -488,7 +561,7 @@ "message": "Cancel swap for free" }, "cancellationGasFee": { - "message": "Cancellation Gas Fee" + "message": "Cancellation gas fee" }, "cancelled": { "message": "Cancelled" @@ -513,6 +586,9 @@ "message": "Click here to connect your Ledger via WebHID", "description": "Text that can be clicked to open a browser popup for connecting the ledger device via webhid" }, + "clickToManuallyAdd": { + "message": "Click here to manually add the tokens." + }, "clickToRevealSeed": { "message": "Click here to reveal secret words" }, @@ -529,6 +605,9 @@ "confirm": { "message": "Confirm" }, + "confirmPageDialogSetApprovalForAll": { + "message": "By clicking approve, you are granting access to all of the NFTs you currently own on this contract and any NFTs on this contract you may acquire in the future until you revoke this approval. The party to whom you're granting approval will be able to transfer your NFTs from your wallet without further notice. Proceed with caution." + }, "confirmPassword": { "message": "Confirm password" }, @@ -560,7 +639,7 @@ "message": "Connect account or create new" }, "connectHardwareWallet": { - "message": "Connect Hardware Wallet" + "message": "Connect hardware wallet" }, "connectManually": { "message": "Manually connect to current site" @@ -586,7 +665,7 @@ "description": "$1 is the number of accounts to which the web3 site/application is asking to connect; this will substitute $1 in connectToMultiple" }, "connectWithMetaMask": { - "message": "Connect With MetaMask" + "message": "Connect with MetaMask" }, "connectedAccountsDescriptionPlural": { "message": "You have $1 accounts connected to this site.", @@ -620,19 +699,19 @@ "message": "Connecting to $1" }, "connectingToGoerli": { - "message": "Connecting to Goerli Test Network" + "message": "Connecting to Goerli test network" }, "connectingToKovan": { - "message": "Connecting to Kovan Test Network" + "message": "Connecting to Kovan test network" }, "connectingToMainnet": { "message": "Connecting to Ethereum Mainnet" }, "connectingToRinkeby": { - "message": "Connecting to Rinkeby Test Network" + "message": "Connecting to Rinkeby test network" }, "connectingToRopsten": { - "message": "Connecting to Ropsten Test Network" + "message": "Connecting to Ropsten test network" }, "contactUs": { "message": "Contact us" @@ -665,10 +744,22 @@ "message": "You are sending tokens to the token's contract address. This may result in the loss of these tokens." }, "contractDeployment": { - "message": "Contract Deployment" + "message": "Contract deployment" + }, + "contractDescription": { + "message": "To protect yourself against scammers, take a moment to verify contract details." }, "contractInteraction": { - "message": "Contract Interaction" + "message": "Contract interaction" + }, + "contractRequestingSpendingCap": { + "message": "Contract requesting spending cap" + }, + "contractTitle": { + "message": "Contract details" + }, + "contractToken": { + "message": "Token contract" }, "convertTokenToNFTDescription": { "message": "We've detected that this asset is an NFT. MetaMask now has full native support for NFTs. Would you like to remove it from your token list and add it as an NFT?" @@ -692,28 +783,28 @@ "message": "Copy to clipboard" }, "copyTransactionId": { - "message": "Copy Transaction ID" + "message": "Copy transaction ID" }, "create": { "message": "Create" }, "createAWallet": { - "message": "Create a Wallet" + "message": "Create a wallet" }, "createAccount": { - "message": "Create Account" + "message": "Create account" }, "createNewWallet": { "message": "Create a new wallet" }, "createPassword": { - "message": "Create Password" + "message": "Create password" }, "currencyConversion": { - "message": "Currency Conversion" + "message": "Currency conversion" }, "currencySymbol": { - "message": "Currency Symbol" + "message": "Currency symbol" }, "currencySymbolDefinition": { "message": "The ticker symbol displayed for this network’s currency." @@ -725,7 +816,7 @@ "message": "Current extension page" }, "currentLanguage": { - "message": "Current Language" + "message": "Current language" }, "currentTitle": { "message": "Current:" @@ -749,26 +840,32 @@ "message": "Search for a previously added network" }, "customGas": { - "message": "Customize Gas" + "message": "Customize gas" }, "customGasSettingToolTipMessage": { "message": "Use $1 to customize the gas price. This can be confusing if you aren’t familiar. Interact at your own risk.", - "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold font-weight" }, "customGasSubTitle": { "message": "Increasing fee may decrease processing times, but it is not guaranteed." }, "customSpendLimit": { - "message": "Custom Spend Limit" + "message": "Custom spend limit" + }, + "customSpendingCap": { + "message": "Custom spending cap" }, "customToken": { - "message": "Custom Token" + "message": "Custom token" }, "customTokenWarningInNonTokenDetectionNetwork": { "message": "Token detection is not available on this network yet. Please import token manually and make sure you trust it. Learn about $1" }, "customTokenWarningInTokenDetectionNetwork": { - "message": "Before manually importing a token, make sure you trust it. Learn about $1." + "message": "Before manually importing a token, make sure you trust it. Learn about $1" + }, + "customTokenWarningInTokenDetectionNetworkWithTDOFF": { + "message": "Make sure you trust a token before you import it. Learn how to avoid $1. You can also enable token detection $2." }, "customerSupport": { "message": "customer support" @@ -800,7 +897,7 @@ "message": "Hex" }, "decimal": { - "message": "Token Decimal" + "message": "Token decimal" }, "decimalsMustZerotoTen": { "message": "Decimals must be at least 0, and not over 36." @@ -829,17 +926,17 @@ "message": "Delete" }, "deleteAccount": { - "message": "Delete Account" + "message": "Delete account" }, "deleteNetwork": { - "message": "Delete Network?" + "message": "Delete network?" }, "deleteNetworkDescription": { "message": "Are you sure you want to delete this network?" }, "depositCrypto": { "message": "Deposit $1", - "description": "$1 represents the cypto symbol to be purchased" + "description": "$1 represents the crypto symbol to be purchased" }, "description": { "message": "Description" @@ -848,7 +945,7 @@ "message": "Details" }, "directDepositCrypto": { - "message": "Directly Deposit $1" + "message": "Directly deposit $1" }, "directDepositCryptoExplainer": { "message": "If you already have some $1, the quickest way to get $1 in your new wallet by direct deposit." @@ -900,7 +997,7 @@ "message": "Download this Secret Recovery Phrase and keep it stored safely on an external encrypted hard drive or storage medium." }, "downloadStateLogs": { - "message": "Download State Logs" + "message": "Download state logs" }, "dropped": { "message": "Dropped" @@ -918,7 +1015,7 @@ "message": "Edit cancellation gas fee" }, "editContact": { - "message": "Edit Contact" + "message": "Edit contact" }, "editGasEducationButtonText": { "message": "How should I choose?" @@ -1028,28 +1125,28 @@ "message": "This lowers your maximum fee but if network traffic increases your transaction may be delayed or fail." }, "editNonceField": { - "message": "Edit Nonce" + "message": "Edit nonce" }, "editNonceMessage": { "message": "This is an advanced feature, use cautiously." }, "editPermission": { - "message": "Edit Permission" + "message": "Edit permission" }, "editSpeedUpEditGasFeeModalTitle": { "message": "Edit speed up gas fee" }, "enableAutoDetect": { - "message": " Enable Autodetect" + "message": " Enable autodetect" }, "enableEIP1559V2": { - "message": "Enable Enhanced Gas Fee UI" + "message": "Enable enhanced gas fee UI" }, "enableEIP1559V2AlertMessage": { "message": "We've updated how gas fee estimation and customization works." }, "enableEIP1559V2ButtonText": { - "message": "Turn on Enhanced Gas Fee UI in Settings" + "message": "Turn on enhanced gas fee UI in Settings" }, "enableEIP1559V2Description": { "message": "We've updated how gas estimation and customization works. Turn on if you'd like to use the new gas experience. $1", @@ -1068,7 +1165,7 @@ "message": "Use OpenSea's API to fetch NFT data. NFT auto-detection relies on OpenSea's API, and will not be available when this is turned off." }, "enableSmartTransactions": { - "message": "Enable Smart Transactions" + "message": "Enable smart transactions" }, "enableToken": { "message": "enable $1", @@ -1085,7 +1182,7 @@ "message": "You passed the test - keep your Secret Recovery Phrase safe, it's your responsibility!" }, "endOfFlowMessage10": { - "message": "All Done" + "message": "All done" }, "endOfFlowMessage2": { "message": "Tips on storing it safely" @@ -1100,7 +1197,7 @@ "message": "Be careful of phishing! MetaMask will never spontaneously ask for your Secret Recovery Phrase." }, "endOfFlowMessage6": { - "message": "If you need to back up your Secret Recovery Phrase again, you can find it in Settings -> Security." + "message": "If you need to back up your Secret Recovery Phrase again, you can find it in Settings > Security." }, "endOfFlowMessage7": { "message": "If you ever have questions or see something fishy, contact our support $1.", @@ -1117,7 +1214,7 @@ "description": "$1 is the return value of eth_chainId from an RPC endpoint" }, "ensIllegalCharacter": { - "message": "Illegal Character for ENS." + "message": "Illegal character for ENS." }, "ensNotFoundOnCurrentNetwork": { "message": "ENS name not found on the current network. Try switching to Ethereum Mainnet." @@ -1129,10 +1226,10 @@ "message": "Error in ENS name registration" }, "ensUnknownError": { - "message": "ENS Lookup failed." + "message": "ENS lookup failed." }, "enterMaxSpendLimit": { - "message": "Enter Max Spend Limit" + "message": "Enter max spend limit" }, "enterPassword": { "message": "Enter password" @@ -1145,7 +1242,7 @@ "description": "Displayed error code for debugging purposes. $1 is the error code" }, "errorDetails": { - "message": "Error Details", + "message": "Error details", "description": "Title for collapsible section that displays error details for debugging purposes" }, "errorMessage": { @@ -1173,13 +1270,13 @@ "description": "Title for error stack, which is displayed for debugging purposes" }, "estimatedProcessingTimes": { - "message": "Estimated Processing Times" + "message": "Estimated processing times" }, "ethGasPriceFetchWarning": { "message": "Backup gas price is provided as the main gas estimation service is unavailable right now." }, "ethereumPublicAddress": { - "message": "Ethereum Public Address" + "message": "Ethereum public address" }, "etherscan": { "message": "Etherscan" @@ -1200,10 +1297,10 @@ "message": "Experimental" }, "exportPrivateKey": { - "message": "Export Private Key" + "message": "Export private key" }, "externalExtension": { - "message": "External Extension" + "message": "External extension" }, "failed": { "message": "Failed" @@ -1217,9 +1314,6 @@ "failureMessage": { "message": "Something went wrong, and we were unable to complete the action" }, - "fakeTokenWarning": { - "message": "Anyone can create a token, including creating fake versions of existing tokens. Learn more about $1" - }, "fast": { "message": "Fast" }, @@ -1302,7 +1396,7 @@ "message": "Function: SetApprovalForAll" }, "functionType": { - "message": "Function Type" + "message": "Function type" }, "gas": { "message": "Gas" @@ -1318,10 +1412,10 @@ "message": "Our low, medium and high estimates are not available." }, "gasFee": { - "message": "Gas Fee" + "message": "Gas fee" }, "gasLimit": { - "message": "Gas Limit" + "message": "Gas limit" }, "gasLimitInfoTooltipContent": { "message": "Gas limit is the maximum amount of units of gas you are willing to spend." @@ -1343,16 +1437,16 @@ "message": "Gas option" }, "gasPrice": { - "message": "Gas Price (GWEI)" + "message": "Gas price (GWEI)" }, "gasPriceExcessive": { "message": "Your gas fee is set unnecessarily high. Consider lowering the amount." }, "gasPriceExcessiveInput": { - "message": "Gas Price Is Excessive" + "message": "Gas price is excessive" }, "gasPriceExtremelyLow": { - "message": "Gas Price Extremely Low" + "message": "Gas price extremely low" }, "gasPriceFetchFailed": { "message": "Gas price estimation failed due to network error." @@ -1393,14 +1487,14 @@ "description": "$1 represents an amount of time" }, "gasUsed": { - "message": "Gas Used" + "message": "Gas used" }, "gdprMessage": { "message": "This data is aggregated and is therefore anonymous for the purposes of General Data Protection Regulation (EU) 2016/679. For more information in relation to our privacy practices, please see our $1.", "description": "$1 refers to the gdprMessagePrivacyPolicy message, the translation of which is meant to be used exclusively in the context of gdprMessage" }, "gdprMessagePrivacyPolicy": { - "message": "Privacy Policy here", + "message": "Privacy policy here", "description": "this translation is intended to be exclusively used as the replacement for the $1 in the gdprMessage translation" }, "general": { @@ -1414,13 +1508,13 @@ "description": "Displays network name for Ether faucet" }, "getStarted": { - "message": "Get Started" + "message": "Get started" }, "goBack": { - "message": "Go Back" + "message": "Go back" }, "goerli": { - "message": "Goerli Test Network" + "message": "Goerli test network" }, "gotIt": { "message": "Got it!" @@ -1458,7 +1552,7 @@ "description": "as in -click here- for more information (goes with troubleTokenBalances)" }, "hexData": { - "message": "Hex Data" + "message": "Hex data" }, "hide": { "message": "Hide" @@ -1473,21 +1567,21 @@ "message": "Hide token" }, "hideTokenPrompt": { - "message": "Hide Token?" + "message": "Hide token?" }, "hideTokenSymbol": { "message": "Hide $1", "description": "$1 is the symbol for a token (e.g. 'DAI')" }, "hideZeroBalanceTokens": { - "message": "Hide Tokens Without Balance" + "message": "Hide tokens without balance" }, "high": { "message": "Aggressive" }, "highGasSettingToolTipMessage": { "message": "High probability, even in volatile markets. Use $1 to cover surges in network traffic due to things like popular NFT drops.", - "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold font-weight" }, "highLowercase": { "message": "high" @@ -1506,7 +1600,7 @@ "description": "Button to import an account from a selected file" }, "importAccount": { - "message": "Import Account" + "message": "Import account" }, "importAccountError": { "message": "Error importing account." @@ -1518,7 +1612,7 @@ "message": "Import a wallet with Secret Recovery Phrase" }, "importMyWallet": { - "message": "Import My Wallet" + "message": "Import my wallet" }, "importNFT": { "message": "Import NFT" @@ -1535,6 +1629,12 @@ "importNFTs": { "message": "Import NFTs" }, + "importSelectedTokens": { + "message": "Import selected tokens?" + }, + "importSelectedTokensDescription": { + "message": "Only the tokens you've selected will appear in your wallet. You can always import hidden tokens later by searching for them." + }, "importTokenQuestion": { "message": "Import token?" }, @@ -1545,7 +1645,7 @@ "message": "import tokens" }, "importTokensCamelCase": { - "message": "Import Tokens" + "message": "Import tokens" }, "importWallet": { "message": "Import wallet" @@ -1561,6 +1661,9 @@ "message": "Imported", "description": "status showing that an account has been fully loaded into the keyring" }, + "inYourSettings": { + "message": "in your Settings" + }, "infuraBlockedNotification": { "message": "MetaMask is unable to connect to the blockchain host. Review possible reasons $1.", "description": "$1 is a clickable link with with text defined by the 'here' key" @@ -1601,7 +1704,7 @@ "message": "This asset is an NFT and needs to be re-added on the Import NFTs page found under the NFTs tab" }, "invalidBlockExplorerURL": { - "message": "Invalid Block Explorer URL" + "message": "Invalid block explorer URL" }, "invalidChainIdTooBig": { "message": "Invalid chain ID. The chain ID is too big." @@ -1618,7 +1721,7 @@ "description": "$1 is a link to https://chainid.network" }, "invalidCustomNetworkAlertTitle": { - "message": "Invalid Custom Network" + "message": "Invalid custom network" }, "invalidHexNumber": { "message": "Invalid hexadecimal number." @@ -1641,6 +1744,9 @@ "invalidSeedPhrase": { "message": "Invalid Secret Recovery Phrase" }, + "invalidSeedPhraseCaseSensitive": { + "message": "Invalid input! Secret Recovery Phrase is case sensitive." + }, "ipfsGateway": { "message": "IPFS Gateway" }, @@ -1673,10 +1779,10 @@ "message": "This action will edit tokens that are already listed in your wallet, which can be used to phish you. Only approve if you are certain that you mean to change what these tokens represent. Learn more about $1" }, "kovan": { - "message": "Kovan Test Network" + "message": "Kovan test network" }, "lastConnected": { - "message": "Last Connected" + "message": "Last connected" }, "learmMoreAboutGas": { "message": "Want to $1 about gas?" @@ -1761,7 +1867,7 @@ "message": "Links" }, "loadMore": { - "message": "Load More" + "message": "Load more" }, "loading": { "message": "Loading..." @@ -1770,7 +1876,7 @@ "message": "Loading NFTs..." }, "loadingTokens": { - "message": "Loading Tokens..." + "message": "Loading tokens..." }, "localhost": { "message": "Localhost 8545" @@ -1790,7 +1896,7 @@ }, "lowGasSettingToolTipMessage": { "message": "Use $1 to wait for a cheaper price. Time estimates are much less accurate as prices are somewhat unpredictable.", - "description": "$1 is key 'low' separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'low' separated here so that it can be passed in with bold font-weight" }, "lowLowercase": { "message": "low" @@ -1834,7 +1940,7 @@ }, "mediumGasSettingToolTipMessage": { "message": "Use $1 for fast processing at current market price.", - "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold font-weight" }, "memo": { "message": "memo" @@ -1948,11 +2054,15 @@ "message": "Must select at least 1 token." }, "myAccounts": { - "message": "My Accounts" + "message": "My accounts" }, "name": { "message": "Name" }, + "nativeToken": { + "message": "The native token on this network is $1. It is the token used for gas fees.", + "description": "$1 represents the name of the native token on the current network" + }, "needCryptoInWallet": { "message": "To interact with decentralized applications using MetaMask, you’ll need $1 in your wallet.", "description": "$1 represents the cypto symbol to be purchased" @@ -1962,13 +2072,13 @@ "description": "$1 represents `needHelpLinkText`, the text which goes in the help link" }, "needHelpFeedback": { - "message": "Share your Feedback" + "message": "Share your feedback" }, "needHelpLinkText": { - "message": "MetaMask Support" + "message": "MetaMask support" }, "needHelpSubmitTicket": { - "message": "Submit a Ticket" + "message": "Submit a ticket" }, "needImportFile": { "message": "You must select a file to import.", @@ -1984,13 +2094,13 @@ "message": "Network added successfully!" }, "networkDetails": { - "message": "Network Details" + "message": "Network details" }, "networkIsBusy": { "message": "Network is busy. Gas prices are high and estimates are less accurate." }, "networkName": { - "message": "Network Name" + "message": "Network name" }, "networkNameAvalanche": { "message": "Avalanche" @@ -2043,7 +2153,7 @@ "message": "Nevermind" }, "newAccount": { - "message": "New Account" + "message": "New account" }, "newAccountDetectedDialogMessage": { "message": "New address detected! Click here to add to your address book." @@ -2056,10 +2166,10 @@ "message": "Collectible was successfully added!" }, "newContact": { - "message": "New Contact" + "message": "New contact" }, "newContract": { - "message": "New Contract" + "message": "New contract" }, "newNFTDetectedMessage": { "message": "Allow MetaMask to automatically detect NFTs from Opensea and display in your wallet." @@ -2084,10 +2194,10 @@ "message": "Token imported" }, "newTotal": { - "message": "New Total" + "message": "New total" }, "newTransactionFee": { - "message": "New Transaction Fee" + "message": "New transaction fee" }, "newValues": { "message": "new values" @@ -2103,7 +2213,7 @@ "message": "NFT" }, "nftTokenIdPlaceholder": { - "message": "Enter the Token ID" + "message": "Enter the token id" }, "nfts": { "message": "NFTs" @@ -2121,10 +2231,10 @@ "message": "No, I already have a Secret Recovery Phrase" }, "noConversionDateAvailable": { - "message": "No Currency Conversion Date Available" + "message": "No currency conversion date available" }, "noConversionRateAvailable": { - "message": "No Conversion Rate Available" + "message": "No conversion rate available" }, "noNFTs": { "message": "No NFTs yet" @@ -2133,7 +2243,7 @@ "message": "No Snaps installed" }, "noThanks": { - "message": "No Thanks" + "message": "No thanks" }, "noThanksVariant2": { "message": "No, thanks." @@ -2157,7 +2267,7 @@ "message": "Turn this on to change the nonce (transaction number) on confirmation screens. This is an advanced feature, use cautiously." }, "nonceFieldHeading": { - "message": "Custom Nonce" + "message": "Custom nonce" }, "notBusy": { "message": "Not busy" @@ -2166,14 +2276,14 @@ "message": "Is this the correct account? It's different from the currently selected account in your wallet" }, "notEnoughGas": { - "message": "Not Enough Gas" + "message": "Not enough gas" }, "notifications": { "message": "Notifications" }, "notifications10ActionText": { - "message": "Visit in settings", - "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." + "message": "Visit in Settings", + "description": "The 'call to action' on the button, or link, of the 'Visit in Settings' notification. Upon clicking, users will be taken to Settings page." }, "notifications10DescriptionOne": { "message": "Improved token detection is currently available on Ethereum Mainnet, Polygon, BSC, and Avalanche networks. More to come!" @@ -2197,11 +2307,21 @@ "message": "Enable dark mode" }, "notifications12Description": { - "message": "Dark mode on Extension is finally here! To turn it on, go to Settings -> Experimental and select one of the display options: Light, Dark, System." + "message": "Dark mode on Extension is finally here! To turn it on, go to Settings > Experimental and select one of the display options: Light, Dark, System." }, "notifications12Title": { "message": "Wen dark mode? Now dark mode! 🕶️🦊" }, + "notifications13ActionText": { + "message": "Show custom network list" + }, + "notifications13Description": { + "message": "You can now add the following popular custom networks easily: Arbitrum, Avalanche, Binance Smart Chain, Fantom, Harmony, Optimism, Palm and Polygon! To enable this feature, go to Settings > Experimental and turn \"Show custom network list\" on!", + "description": "Description of a notification in the 'See What's New' popup. Describes popular network feature." + }, + "notifications13Title": { + "message": "Add Popular Networks" + }, "notifications1Description": { "message": "MetaMask Mobile users can now swap tokens inside their mobile wallet. Scan the QR code to get the mobile app and start swapping.", "description": "Description of a notification in the 'See What's New' popup. Describes the swapping on mobile feature." @@ -2251,7 +2371,7 @@ "description": "Description of a notification in the 'See What's New' popup. Describes the Ledger support update." }, "notifications6Title": { - "message": "Ledger Support Update for Chrome Users", + "message": "Ledger support update for Chrome users", "description": "Title for a notification in the 'See What's New' popup. Lets users know about the Ledger support update" }, "notifications7DescriptionOne": { @@ -2267,15 +2387,15 @@ "description": "Title for a notification in the 'See What's New' popup. Notifies ledger users of the need to update firmware." }, "notifications8ActionText": { - "message": "Go to Advanced Settings", - "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced Settings page." + "message": "Go to Settings > Advanced", + "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced settings page." }, "notifications8DescriptionOne": { "message": "As of MetaMask v10.4.0, you no longer need Ledger Live to connect your Ledger device to MetaMask.", "description": "Description of a notification in the 'See What's New' popup. Describes changes for how Ledger Live is no longer needed to connect the device." }, "notifications8DescriptionTwo": { - "message": "For an easier and more stable ledger experience, go to the Advanced tab of settings and switch the 'Preferred Ledger Connection Type' to 'WebHID'.", + "message": "For an easier and more stable ledger experience, go to Settings > Advanced and switch the 'Preferred Ledger Connection Type' to 'WebHID'.", "description": "Description of a notification in the 'See What's New' popup. Describes how the user can turn off the Ledger Live setting." }, "notifications8Title": { @@ -2304,10 +2424,13 @@ "notificationsMarkAllAsRead": { "message": "Mark all as read" }, - "numberOfNewTokensDetected": { + "numberOfNewTokensDetectedPlural": { "message": "$1 new tokens found in this account", "description": "$1 is the number of new tokens detected" }, + "numberOfNewTokensDetectedSingular": { + "message": "1 new token found in this account" + }, "ofTextNofM": { "message": "of" }, @@ -2330,7 +2453,7 @@ "message": "Import an existing wallet" }, "onboardingPinExtensionBillboardAccess": { - "message": "Full Access" + "message": "Full access" }, "onboardingPinExtensionBillboardDescription": { "message": "These extensions can see and change information" @@ -2387,8 +2510,8 @@ "message": "Open MetaMask in full screen to connect your ledger via WebHID.", "description": "Shown to the user on the confirm screen when they are viewing MetaMask in a popup window but need to connect their ledger via webhid." }, - "openSourceCode": { - "message": "Check the source code" + "openInBlockExplorer": { + "message": "Open in block explorer" }, "optional": { "message": "Optional" @@ -2460,10 +2583,16 @@ "message": "Permission request" }, "permissionRequestCapitalized": { - "message": "Permission Request" + "message": "Permission request" + }, + "permissionRequested": { + "message": "Requested now" + }, + "permissionRevoked": { + "message": "Revoked in this update" }, "permission_accessNetwork": { - "message": "Access the Internet.", + "message": "Access the internet.", "description": "The description of the `endowment:network-access` permission." }, "permission_accessSnap": { @@ -2482,6 +2611,10 @@ "message": "Run indefinitely.", "description": "The description for the `endowment:long-running` permission" }, + "permission_manageBip32Keys": { + "message": "Control your accounts and assets under $1 ($2).", + "description": "The description for the `snap_getBip32Entropy_*` permission. $1 is a derivation path, e.g. 'm/44'/0'/0''. $2 is the elliptic curve name, e.g. 'secp256k1'." + }, "permission_manageBip44Keys": { "message": "Control your \"$1\" accounts and assets.", "description": "The description for the `snap_getBip44Entropy_*` permission. $1 is the name of a protocol, e.g. 'Filecoin'." @@ -2515,8 +2648,8 @@ "message": "Popular custom networks" }, "preferredLedgerConnectionType": { - "message": "Preferred Ledger Connection Type", - "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" + "message": "Preferred Ledger connection type", + "description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message" }, "preparingSwap": { "message": "Preparing swap..." @@ -2525,7 +2658,7 @@ "message": "Prev" }, "primaryCurrencySetting": { - "message": "Primary Currency" + "message": "Primary currency" }, "primaryCurrencySettingDescription": { "message": "Select native to prioritize displaying values in the native currency of the chain (e.g. ETH). Select Fiat to prioritize displaying values in your selected fiat currency." @@ -2537,7 +2670,7 @@ "message": "Priority Fee" }, "privacyMsg": { - "message": "Privacy Policy" + "message": "Privacy policy" }, "privateKey": { "message": "Private Key", @@ -2547,19 +2680,19 @@ "message": "Warning: Never disclose this key. Anyone with your private keys can steal any assets held in your account." }, "privateNetwork": { - "message": "Private Network" + "message": "Private network" }, "proceedWithTransaction": { "message": "I want to proceed anyway" }, "proposedApprovalLimit": { - "message": "Proposed Approval Limit" + "message": "Proposed approval limit" }, "provide": { "message": "Provide" }, "publicAddress": { - "message": "Public Address" + "message": "Public address" }, "queue": { "message": "Queue" @@ -2619,7 +2752,7 @@ "message": "Reject" }, "rejectAll": { - "message": "Reject All" + "message": "Reject all" }, "rejectTxsDescription": { "message": "You are about to batch reject $1 transactions." @@ -2671,13 +2804,13 @@ "message": "Reset" }, "resetAccount": { - "message": "Reset Account" + "message": "Reset account" }, "resetAccountDescription": { "message": "Resetting your account will clear your transaction history. This will not change the balances in your accounts or require you to re-enter your Secret Recovery Phrase." }, "resetWallet": { - "message": "Reset Wallet" + "message": "Reset wallet" }, "resetWalletSubHeader": { "message": "MetaMask does not keep a copy of your password. If you’re having trouble unlocking your account, you will need to reset your wallet. You can do this by providing the Secret Recovery Phrase you used when you set up your wallet." @@ -2694,12 +2827,24 @@ "restore": { "message": "Restore" }, + "restoreFailed": { + "message": "Can not restore your data from the file provided" + }, + "restoreSuccessful": { + "message": "Your data has been restored successfully" + }, + "restoreUserData": { + "message": "Restore user data" + }, + "restoreUserDataDescription": { + "message": "You can restore user settings containing preferences and account addresses from a previously backed up JSON file." + }, "restoreWalletPreferences": { "message": "A backup of your data from $1 has been found. Would you like to restore your wallet preferences?", "description": "$1 is the date at which the data was backed up" }, "retryTransaction": { - "message": "Retry Transaction" + "message": "Retry transaction" }, "reusedTokenNameWarning": { "message": "A token here reuses a symbol from another token you watch, this can be confusing or deceptive." @@ -2727,29 +2872,32 @@ "message": "By revoking permission, the following $1 will no longer be able to access your $2", "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" }, + "revokeSpendingCapTooltipText": { + "message": "This contract will be unable to spend any more of your current or future tokens." + }, "rinkeby": { - "message": "Rinkeby Test Network" + "message": "Rinkeby test network" }, "ropsten": { - "message": "Ropsten Test Network" + "message": "Ropsten test network" }, "rpcUrl": { "message": "New RPC URL" }, "safeTransferFrom": { - "message": "Safe Transfer From" + "message": "Safe transfer from" }, "save": { "message": "Save" }, "saveAsCsvFile": { - "message": "Save as CSV File" + "message": "Save as CSV file" }, "scanInstructions": { "message": "Place the QR code in front of your camera" }, "scanQrCode": { - "message": "Scan QR Code" + "message": "Scan QR code" }, "scrollDown": { "message": "Scroll down" @@ -2758,16 +2906,16 @@ "message": "Search" }, "searchAccounts": { - "message": "Search Accounts" + "message": "Search accounts" }, "searchResults": { - "message": "Search Results" + "message": "Search results" }, "searchSettings": { - "message": "Search in settings" + "message": "Search in Settings" }, "searchTokens": { - "message": "Search Tokens" + "message": "Search tokens" }, "secretBackupPhraseDescription": { "message": "Your Secret Recovery Phrase makes it easy to back up and restore your account." @@ -2782,10 +2930,10 @@ "message": "Secret Recovery Phrase" }, "secureWallet": { - "message": "Secure Wallet" + "message": "Secure wallet" }, "securityAndPrivacy": { - "message": "Security & Privacy" + "message": "Security & privacy" }, "seedPhraseConfirm": { "message": "Confirm Secret Recovery Phrase" @@ -2854,7 +3002,7 @@ "message": "Select all" }, "selectAnAccount": { - "message": "Select an Account" + "message": "Select an account" }, "selectAnAccountAlreadyConnected": { "message": "This account has already been connected to MetaMask" @@ -2863,7 +3011,7 @@ "message": "Please select each phrase in order to make sure it is correct." }, "selectHdPath": { - "message": "Select HD Path" + "message": "Select HD path" }, "selectNFTPrivacyPreference": { "message": "Turn on NFT detection in Settings" @@ -2881,7 +3029,7 @@ "message": "Send" }, "sendAmount": { - "message": "Send Amount" + "message": "Send amount" }, "sendBugReport": { "message": "Send us a bug report." @@ -2894,7 +3042,7 @@ "message": "Send to" }, "sendTokens": { - "message": "Send Tokens" + "message": "Send tokens" }, "sendingDisabled": { "message": "Sending of ERC-1155 NFT assets is not yet supported." @@ -2914,7 +3062,7 @@ "message": "MetaMask uses these trusted third-party services to enhance product usability and safety." }, "setApprovalForAll": { - "message": "Set Approval for All" + "message": "Set approval for all" }, "setApprovalForAllTitle": { "message": "Approve $1 with no spend limit", @@ -2940,19 +3088,19 @@ "message": "Select this to show gas price and limit controls directly on the send and confirm screens." }, "showCustomNetworkList": { - "message": "Show Custom Network List" + "message": "Show custom network list" }, "showCustomNetworkListDescription": { "message": "Select this to show a list of networks with prefilled details when adding a new network." }, "showFiatConversionInTestnets": { - "message": "Show Conversion on test networks" + "message": "Show conversion on test networks" }, "showFiatConversionInTestnetsDescription": { "message": "Select this to show fiat conversion on test networks" }, "showHexData": { - "message": "Show Hex Data" + "message": "Show hex data" }, "showHexDataDescription": { "message": "Select this to show the hex data field on the send screen" @@ -2961,7 +3109,7 @@ "message": "Show/hide" }, "showIncomingTransactions": { - "message": "Show Incoming Transactions" + "message": "Show incoming transactions" }, "showIncomingTransactionsDescription": { "message": "Select this to use Etherscan to show incoming transactions in the transactions list" @@ -2973,7 +3121,7 @@ "message": "Show Private Keys" }, "showRecommendations": { - "message": "Show Recommendations" + "message": "Show recommendations" }, "showTestnetNetworks": { "message": "Show test networks" @@ -2982,7 +3130,7 @@ "message": "Select this to show test networks in network list" }, "sigRequest": { - "message": "Signature Request" + "message": "Signature request" }, "sign": { "message": "Sign" @@ -2991,7 +3139,7 @@ "message": "Signing this message can be dangerous. This signature could potentially perform any operation on your account's behalf, including granting complete control of your account and all of its assets to the requesting site. Only sign this message if you know what you're doing or completely trust the requesting site." }, "signatureRequest": { - "message": "Signature Request" + "message": "Signature request" }, "signatureRequest1": { "message": "Message" @@ -2999,6 +3147,9 @@ "signed": { "message": "Signed" }, + "signin": { + "message": "Sign-In" + }, "simulationErrorMessageV2": { "message": "We were not able to estimate gas. There might be an error in the contract and this transaction may fail." }, @@ -3006,7 +3157,7 @@ "message": "Skip" }, "skipAccountSecurity": { - "message": "Skip Account Security?" + "message": "Skip account security?" }, "skipAccountSecurityDetails": { "message": "I understand that until I back up my Secret Recovery Phrase, I may lose my accounts and all of their assets." @@ -3015,7 +3166,7 @@ "message": "Slow" }, "smartTransaction": { - "message": "Smart Transaction" + "message": "Smart transaction" }, "snapAccess": { "message": "$1 snap has access to:", @@ -3033,15 +3184,25 @@ "message": "Install Snap" }, "snapInstallWarningCheck": { - "message": "To confirm you understand, check all." + "message": "To confirm that you understand, check the box." + }, + "snapInstallWarningCheckPlural": { + "message": "To confirm that you understand, check all the boxes." }, "snapInstallWarningKeyAccess": { - "message": "You are granting key access to the snap \"$1\". This is irrevocable and grants \"$1\" control of your accounts and assets. Make sure you trust \"$1\" before proceeding.", - "description": "The parameter is the name of the snap" + "message": "You are granting $2 key access to the snap \"$1\". This is irrevocable and grants \"$1\" control of your $2 accounts and assets. Make sure you trust \"$1\" before proceeding.", + "description": "The first parameter is the name of the snap and the second one is the protocol" }, "snapRequestsPermission": { "message": "This snap is requesting the following permissions:" }, + "snapUpdate": { + "message": "Update Snap" + }, + "snapUpdateExplanation": { + "message": "$1 needs a newer version of your snap.", + "description": "$1 is the dapp that is requesting an update to the snap." + }, "snaps": { "message": "Snaps" }, @@ -3064,7 +3225,7 @@ "message": "Source" }, "speedUp": { - "message": "Speed Up" + "message": "Speed up" }, "speedUpCancellation": { "message": "Speed up this cancellation" @@ -3134,10 +3295,10 @@ "message": "Error in retrieving state logs." }, "stateLogFileName": { - "message": "MetaMask State Logs" + "message": "MetaMask state logs" }, "stateLogs": { - "message": "State Logs" + "message": "State logs" }, "stateLogsDescription": { "message": "State logs contain your public account addresses and sent transactions." @@ -3207,7 +3368,7 @@ "message": "Swap would have failed" }, "stxCancelledDescription": { - "message": "Your transaction would have failed and was canceled to protect you from paying unnecessary gas fees." + "message": "Your transaction would have failed and was cancelled to protect you from paying unnecessary gas fees." }, "stxCancelledSubDescription": { "message": "Try your swap again. We’ll be here to protect you against similar risks next time." @@ -3273,10 +3434,10 @@ "message": "A transaction has been successful but we’re unsure what it is. This may be due to submitting another transaction while this swap was processing." }, "stxUserCancelled": { - "message": "Swap canceled" + "message": "Swap cancelled" }, "stxUserCancelledDescription": { - "message": "Your transaction has been canceled and you did not pay any unnecessary gas fees." + "message": "Your transaction has been cancelled and you did not pay any unnecessary gas fees." }, "stxYouCanOptOut": { "message": "You can opt-out in advanced settings any time." @@ -3291,7 +3452,7 @@ "message": "Support" }, "supportCenter": { - "message": "Visit our Support Center" + "message": "Visit our support center" }, "swap": { "message": "Swap" @@ -3493,7 +3654,7 @@ "message": "Request for quotation" }, "swapReviewSwap": { - "message": "Review Swap" + "message": "Review swap" }, "swapSearchForAToken": { "message": "Search for a token" @@ -3592,13 +3753,13 @@ "message": "0% Slippage" }, "swapsAdvancedOptions": { - "message": "Advanced Options" + "message": "Advanced options" }, "swapsExcessiveSlippageWarning": { "message": "Slippage amount is too high and will result in a bad rate. Please reduce your slippage tolerance to a value below 15%." }, "swapsMaxSlippage": { - "message": "Slippage Tolerance" + "message": "Slippage tolerance" }, "swapsNotEnoughForTx": { "message": "Not enough $1 to complete this transaction", @@ -3617,7 +3778,7 @@ "message": "Switch network" }, "switchNetworks": { - "message": "Switch Networks" + "message": "Switch networks" }, "switchToNetwork": { "message": "Switch to $1", @@ -3626,6 +3787,9 @@ "switchToThisAccount": { "message": "Switch to this account" }, + "switchedTo": { + "message": "You have switched to" + }, "switchingNetworksCancelsPendingConfirmations": { "message": "Switching networks will cancel all pending confirmations" }, @@ -3675,13 +3839,13 @@ "message": "10% increase" }, "terms": { - "message": "Terms of Use" + "message": "Terms of use" }, "termsOfService": { - "message": "Terms of Service" + "message": "Terms of service" }, "testFaucet": { - "message": "Test Faucet" + "message": "Test faucet" }, "testNetworks": { "message": "Test networks" @@ -3692,6 +3856,9 @@ "themeDescription": { "message": "Choose your preferred MetaMask theme." }, + "thingsToKeep": { + "message": "Things to keep in mind:" + }, "thisWillCreate": { "message": "This will create a new wallet and Secret Recovery Phrase" }, @@ -3710,7 +3877,7 @@ }, "toggleTestNetworks": { "message": "$1 test networks", - "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open to the advanced settings where users can enable the display of test networks in the network dropdown." + "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open Settings > Advanced where users can enable the display of test networks in the network dropdown." }, "token": { "message": "Token" @@ -3722,13 +3889,13 @@ "message": "Token has already been added." }, "tokenContractAddress": { - "message": "Token Contract Address" + "message": "Token contract address" }, "tokenDecimalFetchFailed": { "message": "Token decimal required." }, "tokenDecimalTitle": { - "message": "Token Decimal:" + "message": "Token decimal:" }, "tokenDetails": { "message": "Token details" @@ -3739,11 +3906,11 @@ "tokenDetectionAlertMessage": { "message": "Token detection is currently available on $1. $2" }, - "tokenDetectionAnnouncement": { - "message": "New! Improved token detection is available on Ethereum Mainnet as an experimental feature. $1" + "tokenDetectionDescription": { + "message": "ConsenSys' token API aggregates a list of tokens from various third party token lists. When turned on, tokens will be automatically detected, and searchable, on Ethereum mainnet, Binance, Polygon and Avalanche. When turned off, you will still be able to search for tokens on Ethereum mainnet using MetaMask's legacy token list." }, - "tokenDetectionToggleDescription": { - "message": "ConsenSys’ token API aggregates a list of tokens from various third party token lists. Turning it off will stop detecting new tokens added to your wallet, but will keep the option to search for tokens to import." + "tokenFoundTitle": { + "message": "1 new token found" }, "tokenId": { "message": "Token ID" @@ -3751,8 +3918,14 @@ "tokenList": { "message": "Token lists:" }, + "tokenScamSecurityRisk": { + "message": "token scams and security risks" + }, + "tokenShowUp": { + "message": "Your tokens may not automatically show up in your wallet." + }, "tokenSymbol": { - "message": "Token Symbol" + "message": "Token symbol" }, "tokensFoundTitle": { "message": "$1 new tokens found", @@ -3825,7 +3998,7 @@ "message": "Transaction dropped at $2." }, "transactionError": { - "message": "Transaction Error. Exception thrown in contract code." + "message": "Transaction error. Exception thrown in contract code." }, "transactionErrorNoContract": { "message": "Trying to call a function on a non-contract address." @@ -3837,25 +4010,25 @@ "message": "Transaction fee" }, "transactionHistoryBaseFee": { - "message": "Base Fee (GWEI)" + "message": "Base fee (GWEI)" }, "transactionHistoryL1GasLabel": { - "message": "Total L1 Gas Fee" + "message": "Total L1 gas fee" }, "transactionHistoryL2GasLimitLabel": { - "message": "L2 Gas Limit" + "message": "L2 gas limit" }, "transactionHistoryL2GasPriceLabel": { - "message": "L2 Gas Price" + "message": "L2 gas price" }, "transactionHistoryMaxFeePerGas": { - "message": "Max Fee Per Gas" + "message": "Max fee per gas" }, "transactionHistoryPriorityFee": { - "message": "Priority Fee (GWEI)" + "message": "Priority fee (GWEI)" }, "transactionHistoryTotalGasFee": { - "message": "Total Gas Fee" + "message": "Total gas fee" }, "transactionResubmitted": { "message": "Transaction resubmitted with estimated gas fee increased to $1 at $2" @@ -3873,7 +4046,7 @@ "message": "Transfer between my accounts" }, "transferFrom": { - "message": "Transfer From" + "message": "Transfer from" }, "troubleConnectingToWallet": { "message": "We had trouble connecting to your $1, try reviewing $2 and try again.", @@ -3930,7 +4103,7 @@ "message": "Unnamed collection" }, "unknownNetwork": { - "message": "Unknown Private Network" + "message": "Unknown private network" }, "unknownQrCode": { "message": "Error: We couldn't identify that QR code" @@ -3948,6 +4121,10 @@ "message": "This custom network is not recognized", "description": "$1 is a clickable link with text defined by the 'unrecognizedChanLinkText' key. The link will open to instructions for users to validate custom network details." }, + "unrecognizedProtocol": { + "message": "$1 (Unrecognized protocol)", + "description": "Shown when the protocol is unknown by the extension. $1 is the protocol code." + }, "unsendableAsset": { "message": "Sending collectible (ERC-721) tokens is not currently supported", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" @@ -3974,17 +4151,11 @@ "message": "Displaying NFTs media & data may expose your IP address to centralized servers. Third-party APIs (like OpenSea) are used to detect NFTs in your wallet. This exposes your account address with those services. Leave this disabled if you don’t want the app to pull data from those those services." }, "usePhishingDetection": { - "message": "Use Phishing Detection" + "message": "Use phishing detection" }, "usePhishingDetectionDescription": { "message": "Display a warning for phishing domains targeting Ethereum users" }, - "useTokenDetection": { - "message": "Use Token Detection" - }, - "useTokenDetectionDescription": { - "message": "We use third-party APIs to detect and display new tokens sent to your wallet. Turn off if you don’t want MetaMask to pull data from those services." - }, "useTokenDetectionPrivacyDesc": { "message": "Automatically displaying tokens sent to your account involves communication with third party servers to fetch token’s images. Those serves will have access to your IP address." }, @@ -4007,19 +4178,19 @@ "description": "Points the user to etherscan as a place they can verify information about a token. $1 is replaced with the translation for \"etherscan\"" }, "viewAccount": { - "message": "View Account" + "message": "View account" }, "viewAllDetails": { "message": "View all details" }, "viewContact": { - "message": "View Contact" + "message": "View contact" }, "viewFullTransactionDetails": { "message": "View full transaction details" }, "viewMore": { - "message": "View More" + "message": "View more" }, "viewOnBlockExplorer": { "message": "View on block explorer" @@ -4036,7 +4207,7 @@ "message": "View on Opensea" }, "viewinExplorer": { - "message": "View $1 in Explorer", + "message": "View $1 in explorer", "description": "$1 is the action type. e.g (Account, Transaction, Swap)" }, "visitWebSite": { @@ -4071,6 +4242,10 @@ "warning": { "message": "Warning" }, + "warningTooltipText": { + "message": "$1 The contract could spend your entire token balance without further notice or consent. Protect yourself by customizing a lower spending cap.", + "description": "$1 is a fa-exclamation-circle icon with text 'Be careful' in 'warning' colour" + }, "weak": { "message": "Weak" }, @@ -4086,7 +4261,7 @@ "message": "Welcome to MetaMask" }, "welcomeBack": { - "message": "Welcome Back!" + "message": "Welcome back!" }, "welcomeExploreDescription": { "message": "Store, send and spend crypto currencies and assets." diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index ffe4d6aeb..ef92cc93a 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -157,6 +157,9 @@ "addMemo": { "message": "Añadir memo" }, + "addMoreNetworks": { + "message": "agregar más redes manualmente" + }, "addNetwork": { "message": "Agregar red" }, @@ -227,6 +230,10 @@ "alerts": { "message": "Alertas" }, + "allOfYour": { + "message": "Todo su $1", + "description": "$1 is the symbol or name of the token that the user is approving spending" + }, "allowExternalExtensionTo": { "message": "Permitir que esta extensión externa haga lo siguiente:" }, @@ -263,6 +270,10 @@ "approve": { "message": "Aprobar límite de gastos" }, + "approveAllTokensTitle": { + "message": "¿Dar permiso para acceder a todo su $1?", + "description": "$1 is the symbol of the token for which the user is granting approval" + }, "approveAndInstall": { "message": "Aprobar e instalar" }, @@ -282,9 +293,6 @@ "approvedAsset": { "message": "Activo aprobado" }, - "areYouDeveloper": { - "message": "¿Usted es desarrollador?" - }, "areYouSure": { "message": "¿Está seguro?" }, @@ -438,7 +446,7 @@ "message": "Comprar $1 con Wyre" }, "buyWithWyreDescription": { - "message": "Acceso fácil a transacciones de $ 1,000 o menos con verificación rápida y efectiva. Aceptamos tarjetas débito, crédito, Apple Pay y transferencias bancarias en más de 100 países. Tokens serán depósitados en su MetaMask." + "message": "Acceso fácil a compras de hasta $1,000. Verificación interactiva rápida de compra de límite alto. Acepta tarjeta de débito/crédito, Apple Pay y transferencias bancarias. Disponible para más de 100 países. Los tokens se depositarán en su cuenta MetaMask" }, "bytes": { "message": "Bytes" @@ -466,6 +474,13 @@ "message": "Para $1 una transacción, la tarifa de gas debe aumentar al menos un 10% para que sea reconocida por la red.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwapForFee": { + "message": "Cancelar el swap por ~$1", + "description": "$1 could be e.g. $2.98, it is a cost for cancelling a Smart Transaction" + }, + "cancelSwapForFree": { + "message": "Cancelar el swap gratuitamente" + }, "cancellationGasFee": { "message": "Cuota de gas por cancelación" }, @@ -650,7 +665,7 @@ "message": "Interacción con el contrato" }, "convertTokenToNFTDescription": { - "message": "Hemos detectado que este activo es un NFT. MetaMask ahora tiene soporte nativo completo para NFTs. ¿Quieres eliminarlo de tu lista de tokens y añadirlo como un NFT?" + "message": "Hemos detectado que este activo es un NFT. MetaMask ahora tiene soporte nativo completo para NFT. ¿Quiere eliminarlo de su lista de tokens y añadirlo como un NFT?" }, "convertTokenToNFTExistDescription": { "message": "Hemos detectado que este recurso se ha agregado como NFT. ¿Quiere eliminarlo de su lista de tokens?" @@ -732,7 +747,7 @@ }, "customGasSettingToolTipMessage": { "message": "Use $1 para personalizar el precio de gas. Esto puede ser confuso si no está familiarizado. Interactúe bajo su propio riesgo.", - "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold font-weight" }, "customGasSubTitle": { "message": "Aumentar la cuota puede disminuir los tiempos de procesamiento, pero no está garantizado." @@ -818,7 +833,7 @@ }, "depositCrypto": { "message": "Deposite $1", - "description": "$1 represents the cypto symbol to be purchased" + "description": "$1 represents the crypto symbol to be purchased" }, "description": { "message": "Descripción" @@ -1196,9 +1211,6 @@ "failureMessage": { "message": "Se produjo un error y no pudimos completar la acción" }, - "fakeTokenWarning": { - "message": "Cualquiera puede crear un token, incluso crear versiones falsas de tokens existentes. Aprenda más sobre $1" - }, "fast": { "message": "Rápido" }, @@ -1277,6 +1289,9 @@ "functionApprove": { "message": "Función: Aprobar" }, + "functionSetApprovalForAll": { + "message": "Función: SetApprovalForAll" + }, "functionType": { "message": "Tipo de función" }, @@ -1463,7 +1478,7 @@ }, "highGasSettingToolTipMessage": { "message": "Alta probabilidad, incluso en mercados volátiles. Use $1 para cubrir aumentos repentinos en el tráfico de la red debido a cosas como caídas de NFT populares.", - "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold font-weight" }, "highLowercase": { "message": "alto" @@ -1521,7 +1536,7 @@ "message": "agregar activo" }, "importTokensCamelCase": { - "message": "AGREGAR TOKENS" + "message": "Agregar Tokens" }, "importWallet": { "message": "Importar cartera" @@ -1617,6 +1632,9 @@ "invalidSeedPhrase": { "message": "Frase secreta de recuperación no válida" }, + "invalidSeedPhraseCaseSensitive": { + "message": "¡Entrada inválida! La frase secreta de recuperación distingue entre mayúsculas y minúsculas." + }, "ipfsGateway": { "message": "Puerta de enlace de IPFS" }, @@ -1766,7 +1784,7 @@ }, "lowGasSettingToolTipMessage": { "message": "Utilice $1 para esperar un precio más bajo. Las estimaciones de tiempo son mucho menos precisas ya que los precios son algo imprevisibles.", - "description": "$1 is key 'low' separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'low' separated here so that it can be passed in with bold font-weight" }, "lowLowercase": { "message": "bajo" @@ -1810,7 +1828,7 @@ }, "mediumGasSettingToolTipMessage": { "message": "Utilice $1 para un procesamiento rápido al precio actual del mercado.", - "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold font-weight" }, "memo": { "message": "memorándum" @@ -1892,6 +1910,19 @@ "message": "verifique los detalles de la red", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." }, + "mismatchedChainRecommendation": { + "message": "Recomendamos que usted $1 antes de proceder.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key. The link will open to instructions for users to validate custom network details." + }, + "mismatchedNetworkName": { + "message": "Según nuestros registros, es posible que el nombre de la red no coincida correctamente con este ID de cadena." + }, + "mismatchedNetworkSymbol": { + "message": "El símbolo de moneda enviado no coincide con lo que esperamos para este ID de cadena." + }, + "mismatchedRpcUrl": { + "message": "Según nuestros registros, el valor de la URL de RPC enviado no coincide con un proveedor conocido para este ID de cadena." + }, "missingNFT": { "message": "¿No ve su NFT?" }, @@ -1943,6 +1974,9 @@ "network": { "message": "Red:" }, + "networkAddedSuccessfully": { + "message": "¡Red añadida exitosamente!" + }, "networkDetails": { "message": "Detalles de la red" }, @@ -2059,6 +2093,9 @@ "message": "El nonce es superior al nonce sugerido de $1", "description": "The next nonce according to MetaMask's internal logic" }, + "nft": { + "message": "NFT" + }, "nftTokenIdPlaceholder": { "message": "Ingresa el ID del token" }, @@ -2130,7 +2167,7 @@ }, "notifications10ActionText": { "message": "Vaya a configuración", - "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." + "description": "The 'call to action' on the button, or link, of the 'Visit in Settings' notification. Upon clicking, users will be taken to Settings page." }, "notifications10DescriptionOne": { "message": "En este momento, la detección mejorada de token está disponible en las redes Ethereum Mainnet, Polygon, BSC y Avalanche. ¡Y habrá más!" @@ -2154,11 +2191,21 @@ "message": "Habilitar modo oscuro" }, "notifications12Description": { - "message": "¡El modo oscuro en Extension finalmente está aquí! Para encenderlo, vaya a Configuración -> Experimental y seleccione una de las opciones de visualización: Claro, Oscuro, Sistema." + "message": "¡El modo oscuro en Extensión finalmente está aquí! Para activarlo, vaya a Configuración -> Experimental y seleccione una de las opciones de visualización: Claro, Oscuro, Sistema." }, "notifications12Title": { "message": "¿Cuándo estará disponible el modo oscuro? ¡Ahora! 🕶️🦊" }, + "notifications13ActionText": { + "message": "Mostrar lista de redes personalizadas" + }, + "notifications13Description": { + "message": "Ahora puede agregar fácilmente las siguientes redes personalizadas populares: Arbitrum, Avalanche, Binance Smart Chain, Fantom, Harmony, Optimism, Palm y Polygon. Para habilitar esta función, vaya a Configuración -> Experimental y ¡active \"Mostrar lista de redes personalizadas\"!", + "description": "Description of a notification in the 'See What's New' popup. Describes popular network feature." + }, + "notifications13Title": { + "message": "Añadir redes populares" + }, "notifications1Description": { "message": "Los usuarios de la aplicación móvil de MetaMask ahora pueden canjear tokens en su cartera móvil. Escanee el código QR para obtener la aplicación móvil y comience a canjear.", "description": "Description of a notification in the 'See What's New' popup. Describes the swapping on mobile feature." @@ -2225,7 +2272,7 @@ }, "notifications8ActionText": { "message": "Ir a Configuración Avanzada", - "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced Settings page." + "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced settings page." }, "notifications8DescriptionOne": { "message": "A partir de MetaMask v10.4.0, ya no necesita Ledger Live para conectar su dispositivo Ledger a MetaMask.", @@ -2261,10 +2308,6 @@ "notificationsMarkAllAsRead": { "message": "Marcar todo como leído" }, - "numberOfNewTokensDetected": { - "message": "Se encontraron tokens nuevos de $1 en esta cuenta", - "description": "$1 is the number of new tokens detected" - }, "ofTextNofM": { "message": "de" }, @@ -2344,9 +2387,6 @@ "message": "Abra MetaMask en pantalla completa para conectar su Ledger a través de WebHID.", "description": "Shown to the user on the confirm screen when they are viewing MetaMask in a popup window but need to connect their ledger via webhid." }, - "openSourceCode": { - "message": "Compruebe el código fuente" - }, "optional": { "message": "Opcional" }, @@ -2473,7 +2513,7 @@ }, "preferredLedgerConnectionType": { "message": "Tipo de conexión de Ledger preferida", - "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" + "description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message" }, "preparingSwap": { "message": "Preparando swap..." @@ -2676,6 +2716,14 @@ "revealTheSeedPhrase": { "message": "Revelar frase semilla" }, + "revokeAllTokensTitle": { + "message": "¿Revocar permiso para acceder a todo su $1?", + "description": "$1 is the symbol of the token for which the user is revoking approval" + }, + "revokeApproveForAllDescription": { + "message": "Al revocar permisos, el/la siguiente $1 no tendrá más acceso a su $2", + "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" + }, "rinkeby": { "message": "Red de prueba Rinkeby" }, @@ -2852,12 +2900,23 @@ "message": "Enviando $1", "description": "$1 represents the native currency symbol for the current network (e.g. ETH or BNB)" }, + "sendingToTokenContractWarning": { + "message": "Advertencia: está a punto de enviar un contrato de token que podría dar lugar a una pérdida de fondos. $1", + "description": "$1 is a clickable link with text defined by the 'learnMoreUpperCase' key. The link will open to a support article regarding the known contract address warning" + }, "setAdvancedPrivacySettings": { "message": "Configuración avanzada de privacidad" }, "setAdvancedPrivacySettingsDetails": { "message": "MetaMask utiliza estos servicios de terceros de confianza para mejorar la usabilidad y la seguridad de los productos." }, + "setApprovalForAll": { + "message": "Establecer aprobación para todos" + }, + "setApprovalForAllTitle": { + "message": "Aprobar $1 sin límite preestablecido", + "description": "The token symbol that is being approved" + }, "settings": { "message": "Configuración" }, @@ -2877,6 +2936,12 @@ "showAdvancedGasInlineDescription": { "message": "Seleccione esta opción para mostrar el precio del gas y limitar los controles directamente en las pantallas de envío y confirmación." }, + "showCustomNetworkList": { + "message": "Mostrar lista de redes personalizadas" + }, + "showCustomNetworkListDescription": { + "message": "Seleccione esto para mostrar una lista de redes con detalles precargados al agregar una red nueva." + }, "showFiatConversionInTestnets": { "message": "Mostrar conversión en redes de prueba" }, @@ -2967,10 +3032,6 @@ "snapInstallWarningCheck": { "message": "Para confirmar que comprende, marque todo." }, - "snapInstallWarningKeyAccess": { - "message": "Está otorgando acceso clave al complemento \"$1\". Esto es irrevocable y le otorga a \"$1\" el control de sus cuentas y activos. Asegúrese de confiar en \"$1\" antes de continuar.", - "description": "The parameter is the name of the snap" - }, "snapRequestsPermission": { "message": "Este complemento solicita los siguientes permisos:" }, @@ -2986,6 +3047,9 @@ "snapsToggle": { "message": "Un complemento solo se ejecutará si está habilitado" }, + "someNetworksMayPoseSecurity": { + "message": "Algunas redes pueden presentar riesgos de seguridad y/o privacidad. Comprenda los riesgos antes de agregar y utilizar una red." + }, "somethingWentWrong": { "message": "Lo lamentamos, se produjo un error." }, @@ -3548,6 +3612,10 @@ "switchNetworks": { "message": "Cambiar redes" }, + "switchToNetwork": { + "message": "Cambiar a $1", + "description": "$1 represents the custom network that has previously been added" + }, "switchToThisAccount": { "message": "Cambiar a esta cuenta" }, @@ -3635,7 +3703,7 @@ }, "toggleTestNetworks": { "message": "$1 redes de prueba", - "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open to the advanced settings where users can enable the display of test networks in the network dropdown." + "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open Settings > Advanced where users can enable the display of test networks in the network dropdown." }, "token": { "message": "Token" @@ -3664,12 +3732,6 @@ "tokenDetectionAlertMessage": { "message": "La detección de tókens está actualmente disponible en $1. $2" }, - "tokenDetectionAnnouncement": { - "message": "¡Nuevo! La detección de tokens mejorada está disponible en la Mainnet de Ethereum como funcionalidad experimental. $1" - }, - "tokenDetectionToggleDescription": { - "message": "La API de tokens de ConsenSys agrega una lista de tokens de varias listas de tokens de terceros. Al desactivarla se dejará de detectar nuevos tokens agregados a su billetera, pero se mantendrá la opción de buscar tokens para importar." - }, "tokenId": { "message": "Identificador de Token" }, @@ -3851,6 +3913,9 @@ "unknownCameraErrorTitle": { "message": "Lo lamentamos, se produjo un error…" }, + "unknownCollection": { + "message": "Colección sin nombre" + }, "unknownNetwork": { "message": "Red privada desconocida" }, @@ -3901,12 +3966,6 @@ "usePhishingDetectionDescription": { "message": "Mostrar una advertencia respecto de los dominios de phishing dirigidos a los usuarios de Ethereum" }, - "useTokenDetection": { - "message": "Usar detección de token" - }, - "useTokenDetectionDescription": { - "message": "Utilizamos API de terceros para detectar y mostrar nuevos tokens enviados a su cartera. Desactive si no desea que MetaMask extraiga datos de esos servicios." - }, "useTokenDetectionPrivacyDesc": { "message": "La visualización automática de tokens enviados a su cuenta implica la comunicación con servidores de terceros para obtener imágenes de tokens. Esos servicios tendrán acceso a su dirección IP." }, @@ -3987,6 +4046,9 @@ "walletCreationSuccessTitle": { "message": "Creación exitosa de la cartera" }, + "wantToAddThisNetwork": { + "message": "¿Desea añadir esta red?" + }, "warning": { "message": "Advertencia" }, @@ -4049,6 +4111,10 @@ "yesLetsTry": { "message": "Sí, intentémoslo" }, + "youHaveAddedAll": { + "message": "Ha agregado todas las redes populares. Puede descubrir más redes $1 o puede $2", + "description": "$1 is a link with the text 'here' and $2 is a button with the text 'add more networks manually'" + }, "youNeedToAllowCameraAccess": { "message": "Necesita permitir el acceso a la cámara para usar esta función." }, diff --git a/app/_locales/es_419/messages.json b/app/_locales/es_419/messages.json index f92e60f3d..e3a617fbe 100644 --- a/app/_locales/es_419/messages.json +++ b/app/_locales/es_419/messages.json @@ -1047,9 +1047,6 @@ "failureMessage": { "message": "Se produjo un error y no pudimos finalizar la acción" }, - "fakeTokenWarning": { - "message": "Cualquiera puede crear un token, incluso crear versiones falsas de tokens existentes. Aprenda más sobre $1" - }, "fast": { "message": "Rápido" }, @@ -1533,7 +1530,7 @@ }, "lowGasSettingToolTipMessage": { "message": "Utilice $1 para esperar un precio más bajo. Las estimaciones de tiempo son mucho menos precisas ya que los precios son algo imprevisibles.", - "description": "$1 is key 'low' separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'low' separated here so that it can be passed in with bold font-weight" }, "lowLowercase": { "message": "baja" @@ -1565,7 +1562,7 @@ }, "mediumGasSettingToolTipMessage": { "message": "Utilice $1 para un procesamiento rápido al precio actual del mercado.", - "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold font-weight" }, "memo": { "message": "nota" @@ -1911,7 +1908,7 @@ }, "notifications8ActionText": { "message": "Ir a Configuración Avanzada", - "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced Settings page." + "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced settings page." }, "notifications8DescriptionOne": { "message": "A partir de MetaMask v10.4.0, ya no necesita Ledger Live para conectar su dispositivo Ledger a MetaMask.", @@ -2085,7 +2082,7 @@ }, "preferredLedgerConnectionType": { "message": "Tipo de conexión de Ledger preferida", - "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" + "description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message" }, "prev": { "message": "Ant." @@ -3007,7 +3004,7 @@ }, "toggleTestNetworks": { "message": "$1 redes de prueba", - "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open to the advanced settings where users can enable the display of test networks in the network dropdown." + "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open Settings > Advanced where users can enable the display of test networks in the network dropdown." }, "token": { "message": "Token" @@ -3021,9 +3018,6 @@ "tokenDecimalFetchFailed": { "message": "Se requieren los decimales del token." }, - "tokenDetectionAnnouncement": { - "message": "¡Nuevo! La detección de tokens mejorada está disponible en la Mainnet de Ethereum como funcionalidad experimental. $1" - }, "tokenId": { "message": "ID del token" }, @@ -3236,12 +3230,6 @@ "usePhishingDetectionDescription": { "message": "Mostrar una advertencia respecto de los dominios de phishing dirigidos a los usuarios de Ethereum" }, - "useTokenDetection": { - "message": "Usar detección de token" - }, - "useTokenDetectionDescription": { - "message": "Utilizamos API de terceros para detectar y mostrar nuevos tokens enviados a su cartera. Desactive si no desea que MetaMask extraiga datos de esos servicios." - }, "usedByClients": { "message": "Usado por una variedad de clientes distintos" }, diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index 9d2367dae..5befbfd05 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -9,19 +9,19 @@ "message": "Il n’y a plus de comptes. Si vous souhaitez accéder à un autre compte non répertorié ci-dessous, veuillez reconnecter votre portefeuille matériel et le sélectionner." }, "QRHardwareScanInstructions": { - "message": "Placez le code QR devant votre caméra. L’écran est flou, mais cela n’affectera pas la lecture." + "message": "Placez le code QR devant votre caméra. L’écran est flou, mais cela n’affectera pas la lecture." }, "QRHardwareSignRequestCancel": { "message": "Rejeter" }, "QRHardwareSignRequestDescription": { - "message": "Après avoir signé avec votre portefeuille, cliquez sur « Obtenir la signature » pour recevoir la signature" + "message": "Après avoir signé avec votre portefeuille, cliquez sur « Obtenir la signature » pour recevoir la signature" }, "QRHardwareSignRequestGetSignature": { "message": "Obtenir la signature" }, "QRHardwareSignRequestSubtitle": { - "message": "Veuillez scanner le code QR avec votre portefeuille" + "message": "Veuillez scanner le code QR avec votre portefeuille" }, "QRHardwareSignRequestTitle": { "message": "Demander la signature" @@ -30,16 +30,16 @@ "message": "Erreur" }, "QRHardwareUnknownWalletQRCode": { - "message": "Code QR invalide. Scannez le code QR de synchronisation du portefeuille matériel." + "message": "Code QR invalide. Scannez le code QR de synchronisation du portefeuille matériel." }, "QRHardwareWalletImporterTitle": { "message": "Scannez le code QR" }, "QRHardwareWalletSteps1Description": { - "message": "Connectez un portefeuille matériel sécurisé par air gap qui communique via des codes QR. Les portefeuilles de ce type officiellement pris en charge sont les suivants :" + "message": "Connectez un portefeuille matériel sécurisé par air gap qui communique via des codes QR. Les portefeuilles de ce type officiellement pris en charge sont les suivants :" }, "QRHardwareWalletSteps1Title": { - "message": "Portefeuille matériel basé avec code QR" + "message": "Portefeuille matériel basé avec code QR" }, "QRHardwareWalletSteps2Description": { "message": "AirGap Vault et Ngrave (bientôt disponible)" @@ -128,7 +128,7 @@ "message": "Ajouter un jeton personnalisé" }, "addCustomTokenByContractAddress": { - "message": "Vous ne trouvez pas de jeton ? Vous pouvez ajouter manuellement n’importe quel jeton avec son adresse par copier-coller. Les adresses des contrats de jetons sont disponibles sur $1.", + "message": "Vous ne trouvez pas de jeton ? Vous pouvez ajouter manuellement n’importe quel jeton avec son adresse par copier-coller. Les adresses des contrats de jetons sont disponibles sur $1.", "description": "$1 is a blockchain explorer for a specific network, e.g. Etherscan for Ethereum" }, "addEthereumChainConfirmationDescription": { @@ -146,7 +146,7 @@ "description": "Link text for the 'addEthereumChainConfirmationRisksLearnMore' translation key" }, "addEthereumChainConfirmationTitle": { - "message": "Autoriser ce site à ajouter un réseau ?" + "message": "Autoriser ce site à ajouter un réseau ?" }, "addFriendsAndAddresses": { "message": "Ajoutez uniquement des amis et des adresses de confiance" @@ -157,6 +157,9 @@ "addMemo": { "message": "Ajouter un mémo" }, + "addMoreNetworks": { + "message": "ajouter manuellement d’autres réseaux" + }, "addNetwork": { "message": "Ajouter un réseau" }, @@ -180,10 +183,10 @@ "message": "Paramètres avancés" }, "advancedBaseGasFeeToolTip": { - "message": "Lorsque votre transaction est intégrée au bloc, toute différence entre vos frais de base maximaux et les frais de base réels vous sera remboursée. Le montant total est calculé comme suit : frais de base maximaux (en GWEI) × limite de carburant." + "message": "Lorsque votre transaction est intégrée au bloc, toute différence entre vos frais de base maximaux et les frais de base réels vous sera remboursée. Le montant total est calculé comme suit : frais de base maximaux (en GWEI) × limite de carburant." }, "advancedGasFeeDefaultOptIn": { - "message": "Enregistrer ces $1 comme valeur par défaut pour « Avancé »" + "message": "Enregistrer ces $1 comme valeur par défaut pour « Avancé »" }, "advancedGasFeeDefaultOptOut": { "message": "Toujours utiliser par défaut ces valeurs et les paramètres avancés." @@ -198,7 +201,7 @@ "message": "Options avancées" }, "advancedPriorityFeeToolTip": { - "message": "Les frais de priorité (aussi appelés « pourboire du mineur ») vont directement aux mineurs et les incitent à accorder la priorité à votre transaction." + "message": "Les frais de priorité (aussi appelés « pourboire du mineur ») vont directement aux mineurs et les incitent à accorder la priorité à votre transaction." }, "affirmAgree": { "message": "Je suis d’accord" @@ -210,35 +213,39 @@ "message": " (Tutoriels)" }, "alertDisableTooltip": { - "message": "Vous pouvez modifier ceci dans « Paramètres > Alertes »" + "message": "Vous pouvez modifier ceci dans « Paramètres > Alertes »" }, "alertSettingsUnconnectedAccount": { "message": "Navigation sur un site Web avec un compte non connecté sélectionné" }, "alertSettingsUnconnectedAccountDescription": { - "message": "Cette alerte s’affiche dans le pop-up lorsque vous naviguez sur un site web3 connecté, mais que le compte actuellement sélectionné n’est pas connecté." + "message": "Cette alerte s’affiche dans le pop-up lorsque vous naviguez sur un site web3 connecté, mais que le compte actuellement sélectionné n’est pas connecté." }, "alertSettingsWeb3ShimUsage": { - "message": "Lorsqu’un site Web tente d’utiliser l’API window.web3 supprimée" + "message": "Lorsqu’un site Web tente d’utiliser l’API window.web3 supprimée" }, "alertSettingsWeb3ShimUsageDescription": { - "message": "Cette alerte s’affiche dans le pop-up lorsque vous naviguez sur un site qui tente d’utiliser l’API window.web3 supprimée, et qui peut par conséquent être défaillant." + "message": "Cette alerte s’affiche dans le pop-up lorsque vous naviguez sur un site qui tente d’utiliser l’API window.web3 supprimée, et qui peut par conséquent être défaillant." }, "alerts": { "message": "Alertes" }, + "allOfYour": { + "message": "Tous vos $1", + "description": "$1 is the symbol or name of the token that the user is approving spending" + }, "allowExternalExtensionTo": { - "message": "Autoriser cette extension externe à :" + "message": "Autoriser cette extension externe à :" }, "allowSpendToken": { - "message": "Donner l’autorisation d’accéder à votre $1 ?", + "message": "Donner l’autorisation d’accéder à votre $1 ?", "description": "$1 is the symbol of the token that are requesting to spend" }, "allowThisSiteTo": { - "message": "Autoriser ce site à :" + "message": "Autoriser ce site à :" }, "allowWithdrawAndSpend": { - "message": "Permettre à $1 de retirer et de dépenser jusqu’au montant suivant :", + "message": "Permettre à $1 de retirer et de dépenser jusqu’au montant suivant :", "description": "The url of the site that requested permission to 'withdraw and spend'" }, "amount": { @@ -263,6 +270,10 @@ "approve": { "message": "Approuver" }, + "approveAllTokensTitle": { + "message": "Donner l’autorisation d’accéder à tous vos $1 ?", + "description": "$1 is the symbol of the token for which the user is granting approval" + }, "approveAndInstall": { "message": "Approuver et installer" }, @@ -277,16 +288,13 @@ "message": "Approuvé" }, "approvedAmountWithColon": { - "message": "Montant approuvé :" + "message": "Montant approuvé :" }, "approvedAsset": { "message": "Actif approuvé" }, - "areYouDeveloper": { - "message": "Êtes-vous un(e) développeur(-se) ?" - }, "areYouSure": { - "message": "En êtes-vous sûr(e) ?" + "message": "En êtes-vous sûr(e) ?" }, "asset": { "message": "Actif" @@ -424,21 +432,21 @@ "description": "$1 represents the cypto symbol to be purchased" }, "buyCryptoWithMoonPayDescription": { - "message": "MoonPay prend en charge les moyens de paiement populaires, incluant Visa, Mastercard, Apple / Google / Samsung Pay et les virements bancaires dans plus de 145 pays. Les tokens sont déposés sur votre compte MetaMask." + "message": "MoonPay prend en charge les moyens de paiement populaires, incluant Visa, Mastercard, Apple / Google / Samsung Pay et les virements bancaires dans plus de 145 pays. Les tokens sont déposés sur votre compte MetaMask." }, "buyCryptoWithTransak": { "message": "Acheter $1 avec Transak", "description": "$1 represents the cypto symbol to be purchased" }, "buyCryptoWithTransakDescription": { - "message": "Transak prend en charge les cartes de crédit et de débit, Apple Pay, MobiKwik et les virements bancaires (selon l’emplacement) dans plus de 100 pays. Les tokens $1 sont directement déposés sur votre compte MetaMask.", + "message": "Transak prend en charge les cartes de crédit et de débit, Apple Pay, MobiKwik et les virements bancaires (selon l’emplacement) dans plus de 100 pays. Les tokens $1 sont directement déposés sur votre compte MetaMask.", "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { "message": "Acheter des $1 avec Wyre" }, "buyWithWyreDescription": { - "message": "Wyre vous permet d’utiliser une carte de crédit pour déposer des $1 directement sur votre compte MetaMask." + "message": "Intégration facile pour les achats à hauteur de 1000 $. Vérification interactive et rapide des achats pour les comptes qui bénéficient d’un plafond de paiement élevé. Prise en charge des cartes de débit/crédit, d’Apple Pay et des virements bancaires. Disponible dans plus de 100 pays. Dépôt de jetons sur votre compte MetaMask." }, "bytes": { "message": "Octets" @@ -463,9 +471,16 @@ "description": "$1 is text 'replace' in bold" }, "cancelSpeedUpTransactionTooltip": { - "message": "Pour $1 la transaction, les gas fees doivent être augmentés d’au moins 10 % pour être reconnus par le réseau.", + "message": "Pour $1 la transaction, les gas fees doivent être augmentés d’au moins 10 % pour être reconnus par le réseau.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwapForFee": { + "message": "Annuler le swap pour ~$1", + "description": "$1 could be e.g. $2.98, it is a cost for cancelling a Smart Transaction" + }, + "cancelSwapForFree": { + "message": "Annuler le swap gratuitement" + }, "cancellationGasFee": { "message": "Frais d’annulation de carburant" }, @@ -521,7 +536,7 @@ "message": "Confirmé" }, "confusableUnicode": { - "message": "« $1 » est similaire à « $2 »." + "message": "« $1 » est similaire à « $2 »." }, "confusableZeroWidthUnicode": { "message": "Caractère de largeur nulle trouvé." @@ -561,21 +576,21 @@ "description": "$1 will be replaced by the translation of connectToMultipleNumberOfAccounts" }, "connectToMultipleNumberOfAccounts": { - "message": "$1 comptes", + "message": "$1 comptes", "description": "$1 is the number of accounts to which the web3 site/application is asking to connect; this will substitute $1 in connectToMultiple" }, "connectWithMetaMask": { "message": "Connectez-vous avec MetaMask" }, "connectedAccountsDescriptionPlural": { - "message": "Vous avez $1 comptes connectés à ce site.", + "message": "Vous avez $1 comptes connectés à ce site.", "description": "$1 is the number of accounts" }, "connectedAccountsDescriptionSingular": { - "message": "Vous avez 1 compte connecté à ce site." + "message": "Vous avez 1 compte connecté à ce site." }, "connectedAccountsEmptyDescription": { - "message": "MetaMask n’est pas connecté à ce site. Pour vous connecter à un site web3, cliquez sur le bouton de connexion." + "message": "MetaMask n’est pas connecté à ce site. Pour vous connecter à un site web3, cliquez sur le bouton de connexion." }, "connectedSites": { "message": "Sites connectés" @@ -589,7 +604,7 @@ "description": "$1 is the account name" }, "connectedSnapSites": { - "message": "Le snap $1 est connecté à ces sites. Ils ont accès aux autorisations énumérées ci-dessus.", + "message": "Le snap $1 est connecté à ces sites. Ils ont accès aux autorisations énumérées ci-dessus.", "description": "$1 represents the name of the snap" }, "connecting": { @@ -650,10 +665,10 @@ "message": "Interaction avec un contrat" }, "convertTokenToNFTDescription": { - "message": "Nous avons détecté que cet actif est un NFT. MetaMask prend désormais nativement en charge les NFT. Voulez-vous le retirer de votre liste de tokens et l’ajouter comme un NFT ?" + "message": "Nous avons détecté que cet actif est un NFT. MetaMask prend désormais nativement en charge les NFT. Voulez-vous le retirer de votre liste de jetons et l’ajouter en tant que NFT ?" }, "convertTokenToNFTExistDescription": { - "message": "Nous avons détecté que cet actif a été ajouté en tant que NFT. Souhaitez-vous le retirer de votre liste de tokens ?" + "message": "Nous avons détecté que cet actif a été ajouté en tant que NFT. Souhaitez-vous le retirer de votre liste de tokens ?" }, "copiedExclamation": { "message": "Copié!" @@ -707,7 +722,7 @@ "message": "Langue actuelle" }, "currentTitle": { - "message": "Actuel :" + "message": "Actuel :" }, "currentlyUnavailable": { "message": "Indisponible sur ce réseau" @@ -732,7 +747,7 @@ }, "customGasSettingToolTipMessage": { "message": "Utilisez $1 pour personnaliser le prix du carburant. Cela peut porter à confusion si vous n’en avez pas l’habitude. Agissez avec prudence !", - "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold font-weight" }, "customGasSubTitle": { "message": "Augmenter le tarif peut faire baisser le temps de traitement, mais cela n’est pas garanti." @@ -773,7 +788,7 @@ "message": "Données" }, "dataBackupFoundInfo": { - "message": "Certaines données de votre compte ont été sauvegardées lors d’une précédente installation de MetaMask. Il peut s’agir de vos paramètres, contacts et jetons. Souhaitez-vous restaurer ces données maintenant ?" + "message": "Certaines données de votre compte ont été sauvegardées lors d’une précédente installation de MetaMask. Il peut s’agir de vos paramètres, contacts et jetons. Souhaitez-vous restaurer ces données maintenant ?" }, "dataHex": { "message": "Hex" @@ -791,7 +806,7 @@ "message": "Copier le message crypté" }, "decryptInlineError": { - "message": "Ce message ne peut pas être décrypté à la suite d’une erreur : $1", + "message": "Ce message ne peut pas être décrypté à la suite d’une erreur : $1", "description": "$1 is error message" }, "decryptMessageNotice": { @@ -811,14 +826,14 @@ "message": "Supprimer le compte" }, "deleteNetwork": { - "message": "Supprimer le réseau ?" + "message": "Supprimer le réseau ?" }, "deleteNetworkDescription": { "message": "Souhaitez-vous vraiment supprimer ce réseau ?" }, "depositCrypto": { "message": "Effectuer un dépôt de $1", - "description": "$1 represents the cypto symbol to be purchased" + "description": "$1 represents the crypto symbol to be purchased" }, "description": { "message": "Description" @@ -833,7 +848,7 @@ "message": "Si vous avez déjà un peu de $1, la façon la plus rapide d’obtenir $1 dans votre nouveau portefeuille est par dépôt direct." }, "disabledGasOptionToolTipMessage": { - "message": "« $1 » est désactivé parce qu’il ne correspond pas au minimum d’augmentation de 10 % par rapport aux gas fees initiaux.", + "message": "« $1 » est désactivé parce qu’il ne correspond pas au minimum d’augmentation de 10 % par rapport aux gas fees initiaux.", "description": "$1 is gas estimate type which can be market or aggressive" }, "disconnect": { @@ -843,7 +858,7 @@ "message": "Déconnecter tous les comptes" }, "disconnectAllAccountsConfirmationDescription": { - "message": "Souhaitez-vous vraiment vous déconnecter ? Vous risquez de perdre certaines fonctionnalités du site." + "message": "Souhaitez-vous vraiment vous déconnecter ? Vous risquez de perdre certaines fonctionnalités du site." }, "disconnectPrompt": { "message": "Déconnecter $1" @@ -900,7 +915,7 @@ "message": "Modifier le contact" }, "editGasEducationButtonText": { - "message": "Comment puis-je choisir ?" + "message": "Comment puis-je choisir ?" }, "editGasEducationHighExplanation": { "message": "Ce choix est préférable pour les transactions urgentes (comme les swaps), car cela multiplie les chances de réussite de la transaction. Si le traitement d’un swap prend trop de temps, il peut échouer et vous faire perdre une partie de vos frais de carburant." @@ -915,7 +930,7 @@ "message": "Le choix du bon prix de carburant dépend du type de transaction et de son importance à vos yeux." }, "editGasEducationModalTitle": { - "message": "Comment choisir ?" + "message": "Comment choisir ?" }, "editGasFeeModalTitle": { "message": "Modifier le prix du carburant" @@ -931,7 +946,7 @@ "description": "$1 is the minimum limit for gas and $2 is the maximum limit" }, "editGasLimitTooltip": { - "message": "La limite de carburant correspond au maximum d’unités de carburant que vous consentez à utiliser. Celles-ci servent de multiplicateur aux « Frais de priorité maximaux » et aux « Frais maximaux »." + "message": "La limite de carburant correspond au maximum d’unités de carburant que vous consentez à utiliser. Celles-ci servent de multiplicateur aux « Frais de priorité maximaux » et aux « Frais maximaux »." }, "editGasLow": { "message": "Bas" @@ -958,7 +973,7 @@ "message": "Les frais maximaux correspondent au montant le plus élevé que vous aurez à payer (frais de base + frais de priorité)." }, "editGasMaxPriorityFeeBelowMinimum": { - "message": "Les frais de priorité maximaux doivent être supérieurs à 0 GWEI" + "message": "Les frais de priorité maximaux doivent être supérieurs à 0 GWEI" }, "editGasMaxPriorityFeeBelowMinimumV2": { "message": "Les frais de priorité doivent être supérieurs à 0." @@ -976,7 +991,7 @@ "message": "Les frais de priorité sont faibles par rapport aux conditions actuelles du réseau" }, "editGasMaxPriorityFeeTooltip": { - "message": "Les frais de priorité maximaux (aussi appelés « pourboire du mineur ») vont directement aux mineurs et les incitent à accorder la priorité à votre transaction. Vous paierez le plus souvent votre réglage maximal" + "message": "Les frais de priorité maximaux (aussi appelés « pourboire du mineur ») vont directement aux mineurs et les incitent à accorder la priorité à votre transaction. Vous paierez le plus souvent votre réglage maximal" }, "editGasMedium": { "message": "Moyen" @@ -985,14 +1000,14 @@ "message": "Les frais de carburant doivent être supérieurs à 0" }, "editGasPriceTooltip": { - "message": "Ce réseau exige un champ « Prix du carburant » lors de la soumission d’une transaction. Le prix du carburant correspond au montant que vous paierez par unité de carburant." + "message": "Ce réseau exige un champ « Prix du carburant » lors de la soumission d’une transaction. Le prix du carburant correspond au montant que vous paierez par unité de carburant." }, "editGasSubTextAmountLabel": { - "message": "Montant maximal :", + "message": "Montant maximal :", "description": "This is meant to be used as the $1 substitution editGasSubTextAmount" }, "editGasSubTextFeeLabel": { - "message": "Frais maximaux :" + "message": "Frais maximaux :" }, "editGasTitle": { "message": "Modifier la priorité" @@ -1092,7 +1107,7 @@ "message": "En savoir plus." }, "endpointReturnedDifferentChainId": { - "message": "Le point terminal a renvoyé un ID de chaîne différent : $1", + "message": "Le point terminal a renvoyé un ID de chaîne différent : $1", "description": "$1 is the return value of eth_chainId from an RPC endpoint" }, "ensIllegalCharacter": { @@ -1120,7 +1135,7 @@ "message": "Entrez votre mot de passe pour continuer" }, "errorCode": { - "message": "Code : $1", + "message": "Code : $1", "description": "Displayed error code for debugging purposes. $1 is the error code" }, "errorDetails": { @@ -1128,11 +1143,11 @@ "description": "Title for collapsible section that displays error details for debugging purposes" }, "errorMessage": { - "message": "Message : $1", + "message": "Message : $1", "description": "Displayed error message for debugging purposes. $1 is the error message" }, "errorName": { - "message": "Code : $1", + "message": "Code : $1", "description": "Displayed error name for debugging purposes. $1 is the error name" }, "errorPageMessage": { @@ -1148,7 +1163,7 @@ "description": "Title of generic error page" }, "errorStack": { - "message": "Stack :", + "message": "Stack :", "description": "Title for error stack, which is displayed for debugging purposes" }, "estimatedProcessingTimes": { @@ -1188,7 +1203,7 @@ "message": "Échec" }, "failedToFetchChainId": { - "message": "Impossible de récupérer l’ID de la chaîne. Votre URL de RPC est-elle correcte ?" + "message": "Impossible de récupérer l’ID de la chaîne. Votre URL de RPC est-elle correcte ?" }, "failedToFetchTickerSymbolData": { "message": "Les données de vérification de code mnémonique sont actuellement indisponibles. Assurez-vous que le code que vous avez saisi est correct. Il aura une incidence sur les taux de conversion que vous voyez pour ce réseau" @@ -1196,9 +1211,6 @@ "failureMessage": { "message": "Un problème est survenu et nous n’avons pas pu mener à bien l’action" }, - "fakeTokenWarning": { - "message": "Tout un chacun peut créer un jeton, y compris créer de fausses copies de jetons existants. En savoir plus sur $1" - }, "fast": { "message": "Rapide" }, @@ -1213,7 +1225,7 @@ "description": "Exchange type" }, "fileImportFail": { - "message": "L’importation de fichier ne fonctionne pas ? Cliquez ici !", + "message": "L’importation de fichier ne fonctionne pas ? Cliquez ici !", "description": "Helps user import their account from a JSON file" }, "flaskSnapSettingsCardButtonCta": { @@ -1256,26 +1268,29 @@ "message": "Suivez-nous sur Twitter" }, "forbiddenIpfsGateway": { - "message": "Passerelle IPFS interdite : veuillez spécifier une passerelle CID" + "message": "Passerelle IPFS interdite : veuillez spécifier une passerelle CID" }, "forgetDevice": { "message": "Oublier cet appareil" }, "forgotPassword": { - "message": "Mot de passe oublié ?" + "message": "Mot de passe oublié ?" }, "from": { "message": "de" }, "fromAddress": { - "message": "De : $1", + "message": "De : $1", "description": "$1 is the address to include in the From label. It is typically shortened first using shortenAddress" }, "fromTokenLists": { - "message": "À partir des listes de tokens : $1" + "message": "À partir des listes de tokens : $1" }, "functionApprove": { - "message": "Fonction : approuver" + "message": "Fonction : approuver" + }, + "functionSetApprovalForAll": { + "message": "Fonction : SetApprovalForAll" }, "functionType": { "message": "Type de fonction" @@ -1337,15 +1352,15 @@ "message": "Le prix du carburant indique la quantité d’Ether que vous acceptez de payer pour chaque unité de carburant." }, "gasTimingHoursShort": { - "message": "$1 h", + "message": "$1 h", "description": "$1 represents a number of hours" }, "gasTimingMinutes": { - "message": "$1 minutes", + "message": "$1 minutes", "description": "$1 represents a number of minutes" }, "gasTimingMinutesShort": { - "message": "$1 min", + "message": "$1 min", "description": "$1 represents a number of minutes" }, "gasTimingNegative": { @@ -1357,11 +1372,11 @@ "description": "$1 represents an amount of time" }, "gasTimingSeconds": { - "message": "$1 secondes", + "message": "$1 secondes", "description": "$1 represents a number of seconds" }, "gasTimingSecondsShort": { - "message": "$1 s", + "message": "$1 s", "description": "$1 represents a number of seconds" }, "gasTimingVeryPositive": { @@ -1372,7 +1387,7 @@ "message": "Carburant utilisé" }, "gdprMessage": { - "message": "Ces données sont agrégées et sont donc anonymes aux fins du règlement général sur la protection des données (UE) 2016/679. Pour plus d’informations concernant nos pratiques en matière de confidentialité, veuillez consulter notre $1.", + "message": "Ces données sont agrégées et sont donc anonymes aux fins du règlement général sur la protection des données (UE) 2016/679. Pour plus d’informations concernant nos pratiques en matière de confidentialité, veuillez consulter notre $1.", "description": "$1 refers to the gdprMessagePrivacyPolicy message, the translation of which is meant to be used exclusively in the context of gdprMessage" }, "gdprMessagePrivacyPolicy": { @@ -1399,10 +1414,10 @@ "message": "Réseau de test Goerli" }, "gotIt": { - "message": "J’ai compris !" + "message": "J'ai compris !" }, "grantedToWithColon": { - "message": "Accordé à :" + "message": "Accordé à :" }, "gwei": { "message": "GWEI" @@ -1449,7 +1464,7 @@ "message": "Masquer le token" }, "hideTokenPrompt": { - "message": "Masquer le jeton ?" + "message": "Masquer le jeton ?" }, "hideTokenSymbol": { "message": "Masquer $1", @@ -1463,7 +1478,7 @@ }, "highGasSettingToolTipMessage": { "message": "Utilisez $1 pour couvrir les envolées du trafic réseau dues à des événements tels que les chutes de NFT populaires.", - "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold font-weight" }, "highLowercase": { "message": "élevé" @@ -1500,22 +1515,22 @@ "message": "Importer le NFT" }, "importNFTAddressToolTip": { - "message": "Sur OpenSea, par exemple, sur la page des NFT, dans la section Détails, se trouve une valeur avec un hyperlien bleu intitulée « Adresse de contrat ». Si vous cliquez dessus, vous serez redirigé vers l’adresse du contrat sur Etherscan. En haut à gauche de cette page, il devrait y avoir une icône intitulée « Contrat » et à droite, une longue chaîne de lettres et de chiffres. C’est l’adresse du contrat qui a créé votre NFT. Cliquez sur l’icône « Copier » à droite de l’adresse pour la copier dans votre presse-papiers." + "message": "Sur OpenSea, par exemple, sur la page des NFT, dans la section Détails, se trouve une valeur avec un hyperlien bleu intitulée « Adresse de contrat ». Si vous cliquez dessus, vous serez redirigé vers l’adresse du contrat sur Etherscan. En haut à gauche de cette page, il devrait y avoir une icône intitulée « Contrat » et à droite, une longue chaîne de lettres et de chiffres. C’est l’adresse du contrat qui a créé votre NFT. Cliquez sur l’icône « Copier » à droite de l’adresse pour la copier dans votre presse-papiers." }, "importNFTPage": { "message": "page Importer des NFT" }, "importNFTTokenIdToolTip": { - "message": "L’ID d’un collectible est un identifiant unique puisqu’il n’y a pas deux NFT identiques. Encore une fois, sur OpenSea, ce numéro se trouve dans la section « Détails ». Prenez-en note ou copiez-le dans votre presse-papiers." + "message": "L’ID d’un collectible est un identifiant unique puisqu’il n’y a pas deux NFT identiques. Encore une fois, sur OpenSea, ce numéro se trouve dans la section « Détails ». Prenez-en note ou copiez-le dans votre presse-papiers." }, "importNFTs": { "message": "Importer des NFT" }, "importTokenQuestion": { - "message": "Importer un jeton ?" + "message": "Importer un jeton ?" }, "importTokenWarning": { - "message": "Tout un chacun peut créer un jeton avec n’importe quel nom, y compris de fausses versions de jetons existants. Ajoutez et échangez avec prudence !" + "message": "Tout un chacun peut créer un jeton avec n’importe quel nom, y compris de fausses versions de jetons existants. Ajoutez et échangez avec prudence !" }, "importTokens": { "message": "importer des jetons" @@ -1583,7 +1598,7 @@ "message": "ID de chaîne invalide. L’ID de la chaîne est trop grand." }, "invalidCustomNetworkAlertContent1": { - "message": "L’ID de la chaîne pour le réseau personnalisé « $1 » doit être saisi à nouveau.", + "message": "L’ID de la chaîne pour le réseau personnalisé « $1 » doit être saisi à nouveau.", "description": "$1 is the name/identifier of the network." }, "invalidCustomNetworkAlertContent2": { @@ -1603,10 +1618,10 @@ "message": "Numéro hexadécimal invalide. Supprimez tous les zéros non significatifs." }, "invalidIpfsGateway": { - "message": "Passerelle IPFS invalide : la valeur doit être une URL valide" + "message": "Passerelle IPFS invalide : la valeur doit être une URL valide" }, "invalidNumber": { - "message": "Numéro invalide. Saisissez un nombre décimal ou hexadécimal avec le préfixe « 0x »." + "message": "Numéro invalide. Saisissez un nombre décimal ou hexadécimal avec le préfixe « 0x »." }, "invalidNumberLeadingZeros": { "message": "Numéro invalide. Supprimez tous les zéros en tête." @@ -1617,6 +1632,9 @@ "invalidSeedPhrase": { "message": "Phrase secrète de récupération invalide" }, + "invalidSeedPhraseCaseSensitive": { + "message": "Entrée invalide ! La phrase secrète de récupération est sensible à la casse." + }, "ipfsGateway": { "message": "Passerelle IPFS" }, @@ -1655,7 +1673,7 @@ "message": "Dernière connexion" }, "learmMoreAboutGas": { - "message": "Souhaitez-vous $1 sur le carburant ?" + "message": "Souhaitez-vous $1 sur le carburant ?" }, "learnCancelSpeeedup": { "message": "Découvrir comment $1", @@ -1677,13 +1695,13 @@ "message": "Fermez tout autre logiciel connecté à votre appareil, puis cliquez ici pour actualiser." }, "ledgerConnectionInstructionHeader": { - "message": "Avant de cliquer sur confirmer :" + "message": "Avant de cliquer sur confirmer :" }, "ledgerConnectionInstructionStepFour": { - "message": "Activez les « données de contrat intelligent » ou la « signature aveugle » sur votre dispositif Ledger" + "message": "Activez les « données de contrat intelligent » ou la « signature aveugle » sur votre dispositif Ledger" }, "ledgerConnectionInstructionStepOne": { - "message": "Activez l’option « Utiliser Ledger Live » sous Paramètres > Avancés" + "message": "Activez l’option « Utiliser Ledger Live » sous Paramètres > Avancés" }, "ledgerConnectionInstructionStepThree": { "message": "Branchez votre dispositif Ledger et sélectionnez l’application Ethereum" @@ -1692,7 +1710,7 @@ "message": "Ouvrez et déverrouillez l’application Ledger Live" }, "ledgerConnectionPreferenceDescription": { - "message": "Personnalisez la façon dont vous souhaitez connecter votre Ledger à MetaMask. $1 est recommandé, mais d’autres options sont disponibles. En savoir plus ici : $2", + "message": "Personnalisez la façon dont vous souhaitez connecter votre Ledger à MetaMask. $1 est recommandé, mais d’autres options sont disponibles. En savoir plus ici : $2", "description": "A description that appears above a dropdown where users can select between up to three options - Ledger Live, U2F or WebHID - depending on what is supported in their browser. $1 is the recommended browser option, it will be either WebHID or U2f. $2 is a link to an article where users can learn more, but will be the translation of the learnMore message." }, "ledgerDeviceOpenFailureMessage": { @@ -1715,11 +1733,11 @@ "message": "Si l’application Ledger Live est ouverte, désactivez toute connexion en cours à celle-ci et fermez-la." }, "ledgerWebHIDNotConnectedErrorMessage": { - "message": "Le dispositif Ledger n’est pas connecté. Si vous souhaitez le connecter, veuillez cliquer à nouveau sur « Continuer » et approuver la connexion au HID", + "message": "Le dispositif Ledger n’est pas connecté. Si vous souhaitez le connecter, veuillez cliquer à nouveau sur « Continuer » et approuver la connexion au HID", "description": "An error message shown to the user during the hardware connect flow." }, "letsGoSetUp": { - "message": "Oui, passons à la configuration !" + "message": "Oui, passons à la configuration !" }, "levelArrow": { "message": "flèche de niveau" @@ -1749,7 +1767,7 @@ "message": "Chargement des jetons..." }, "localhost": { - "message": "Localhost 8545" + "message": "Localhost 8545" }, "lock": { "message": "Déconnexion" @@ -1766,7 +1784,7 @@ }, "lowGasSettingToolTipMessage": { "message": "Utilisez $1 pour attendre un prix inférieur. Les estimations de temps sont nettement moins précises, car les prix sont relativement imprévisibles.", - "description": "$1 is key 'low' separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'low' separated here so that it can be passed in with bold font-weight" }, "lowLowercase": { "message": "bas" @@ -1810,7 +1828,7 @@ }, "mediumGasSettingToolTipMessage": { "message": "Utilisez $1 pour un traitement rapide au prix actuel du marché.", - "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold font-weight" }, "memo": { "message": "note" @@ -1850,7 +1868,7 @@ "description": "This string is localized separately from some of the commitments so that we can bold it" }, "metametricsCommitmentsIntro": { - "message": "MetaMask :" + "message": "MetaMask :" }, "metametricsCommitmentsNeverCollect": { "message": "Ne collectera jamais vos clés, adresses, transactions, soldes, hachages ou toute autre information personnelle" @@ -1867,10 +1885,10 @@ "message": "Ne collectera jamais votre adresse IP complète" }, "metametricsCommitmentsNeverSell": { - "message": "Ne vendra jamais de données à des fins lucratives. Jamais !" + "message": "Ne vendra jamais de données à des fins lucratives. Jamais !" }, "metametricsCommitmentsNeverSellDataForProfit": { - "message": "Ne vendra $1 de données à des fins lucratives. Jamais !", + "message": "Ne vendra $1 de données à des fins lucratives. Jamais !", "description": "The $1 is the bolded word 'Never', from 'metametricsCommitmentsBoldNever'" }, "metametricsCommitmentsSendAnonymizedEvents": { @@ -1886,14 +1904,27 @@ "message": "Nous aimerions recueillir des données d’utilisation de base pour améliorer la convivialité de notre produit. Ces indicateurs seront…" }, "metametricsTitle": { - "message": "Rejoignez plus de 6 M d’utilisateurs pour améliorer MetaMask" + "message": "Rejoignez plus de 6 M d’utilisateurs pour améliorer MetaMask" }, "mismatchedChainLinkText": { "message": "vérifier les détails du réseau", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." }, + "mismatchedChainRecommendation": { + "message": "Nous vous recommandons de $1 avant de continuer.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key. The link will open to instructions for users to validate custom network details." + }, + "mismatchedNetworkName": { + "message": "Selon nos informations, le nom du réseau peut ne pas correspondre exactement à l'ID de la chaîne." + }, + "mismatchedNetworkSymbol": { + "message": "Le symbole monétaire soumis ne correspond à cet ID de chaîne." + }, + "mismatchedRpcUrl": { + "message": "Selon nos informations, la valeur de l'URL RPC soumise ne correspond pas à un fournisseur connu pour cet ID de chaîne." + }, "missingNFT": { - "message": "Vous ne voyez pas votre NFT ?" + "message": "Vous ne voyez pas votre NFT ?" }, "missingSetting": { "message": "Vous ne trouvez pas un paramètre ?" @@ -1902,10 +1933,10 @@ "message": "Demandez ici" }, "missingToken": { - "message": "Vous ne voyez pas votre jeton ?" + "message": "Vous ne voyez pas votre jeton ?" }, "mobileSyncWarning": { - "message": "La fonction « Synchronisation avec l’extension » est temporairement désactivée. Si vous souhaitez utiliser votre portefeuille d’extension sur MetaMask mobile : sur votre application mobile, revenez aux options de configuration du portefeuille et sélectionnez l’option « Importation avec la phrase secrète de récupération ». Utilisez la phrase secrète de votre portefeuille d’extension pour importer celui-ci sur votre mobile." + "message": "La fonction « Synchronisation avec l’extension » est temporairement désactivée. Si vous souhaitez utiliser votre portefeuille d’extension sur MetaMask mobile : sur votre application mobile, revenez aux options de configuration du portefeuille et sélectionnez l’option « Importation avec la phrase secrète de récupération ». Utilisez la phrase secrète de votre portefeuille d’extension pour importer celui-ci sur votre mobile." }, "mustSelectOne": { "message": "Vous devez sélectionner au moins 1 jeton." @@ -1921,7 +1952,7 @@ "description": "$1 represents the cypto symbol to be purchased" }, "needHelp": { - "message": "Vous avez besoin d’aide ? Contactez $1", + "message": "Vous avez besoin d’aide ? Contactez $1", "description": "$1 represents `needHelpLinkText`, the text which goes in the help link" }, "needHelpFeedback": { @@ -1941,7 +1972,10 @@ "message": "Vous ne pouvez envoyer des montants négatifs d’ETH." }, "network": { - "message": "Réseau :" + "message": "Réseau :" + }, + "networkAddedSuccessfully": { + "message": "Réseau ajouté avec succès !" }, "networkDetails": { "message": "Détails du réseau" @@ -1974,20 +2008,20 @@ "message": "Testnet" }, "networkSettingsChainIdDescription": { - "message": "L’ID de la chaîne est utilisé pour la signature des transactions. Il doit correspondre à l’ID de la chaîne renvoyé par le réseau. Vous pouvez saisir un numéro décimal ou hexadécimal avec le préfixe « 0x », mais nous afficherons le numéro en décimal." + "message": "L’ID de la chaîne est utilisé pour la signature des transactions. Il doit correspondre à l’ID de la chaîne renvoyé par le réseau. Vous pouvez saisir un numéro décimal ou hexadécimal avec le préfixe « 0x », mais nous afficherons le numéro en décimal." }, "networkStatus": { "message": "Statut du réseau" }, "networkStatusBaseFeeTooltip": { - "message": "Les frais de base sont fixés par le réseau et varient toutes les 13-14 secondes. Nos options $1 et $2 tiennent compte des augmentations soudaines.", + "message": "Les frais de base sont fixés par le réseau et varient toutes les 13-14 secondes. Nos options $1 et $2 tiennent compte des augmentations soudaines.", "description": "$1 and $2 are bold text for Medium and Aggressive respectively." }, "networkStatusPriorityFeeTooltip": { - "message": "Éventail de frais de priorité (aussi appelés « pourboire du mineur »). Ils sont versés aux mineurs et les incitent à accorder la priorité à votre transaction." + "message": "Éventail de frais de priorité (aussi appelés « pourboire du mineur »). Ils sont versés aux mineurs et les incitent à accorder la priorité à votre transaction." }, "networkStatusStabilityFeeTooltip": { - "message": "Le prix du carburant est de $1 au regard des 72 dernières heures.", + "message": "Le prix du carburant est de $1 au regard des 72 dernières heures.", "description": "$1 is networks stability value - stable, low, high" }, "networkURL": { @@ -2013,7 +2047,7 @@ "description": "Default name of next account to be created on create account screen" }, "newCollectibleAddedMessage": { - "message": "Le collectible a été ajouté avec succès !" + "message": "Le collectible a été ajouté avec succès !" }, "newContact": { "message": "Nouveau contact" @@ -2025,10 +2059,10 @@ "message": "Cela permet à MetaMask de détecter automatiquement les NFT d’OpenSea et de les afficher dans votre portefeuille." }, "newNFTsDetected": { - "message": "Nouveau ! Détection de NFT" + "message": "Nouveau ! Détection de NFT" }, "newNetworkAdded": { - "message": "« $1 » a été ajouté avec succès !" + "message": "« $1 » a été ajouté avec succès !" }, "newPassword": { "message": "Nouveau mot de passe (min 8 caractères)" @@ -2059,6 +2093,9 @@ "message": "Le nonce est supérieur au nonce suggéré de $1", "description": "The next nonce according to MetaMask's internal logic" }, + "nft": { + "message": "NFT" + }, "nftTokenIdPlaceholder": { "message": "Saisissez l’ID du collectible" }, @@ -2120,7 +2157,7 @@ "message": "Pas occupé" }, "notCurrentAccount": { - "message": "S’agit-il du bon compte ? Il est différent de celui actuellement sélectionné dans votre portefeuille" + "message": "S’agit-il du bon compte ? Il est différent de celui actuellement sélectionné dans votre portefeuille" }, "notEnoughGas": { "message": "Pas assez de carburant" @@ -2130,10 +2167,10 @@ }, "notifications10ActionText": { "message": "Ouvrir les paramètres", - "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." + "description": "The 'call to action' on the button, or link, of the 'Visit in Settings' notification. Upon clicking, users will be taken to Settings page." }, "notifications10DescriptionOne": { - "message": "Une détection améliorée des tokens est actuellement disponible sur les réseaux Ethereum Mainnet, Polygon, BSC et Avalanche. Il y aura bientôt d’autres nouveautés !" + "message": "Une détection améliorée des tokens est actuellement disponible sur les réseaux Ethereum Mainnet, Polygon, BSC et Avalanche. Il y aura bientôt d’autres nouveautés !" }, "notifications10DescriptionThree": { "message": "La fonction de détection des tokens est ACTIVÉE par défaut. Mais vous pouvez la désactiver dans les Paramètres." @@ -2154,17 +2191,27 @@ "message": "Activer le mode sombre" }, "notifications12Description": { - "message": "Le mode sombre sera activé pour les nouveaux utilisateurs en fonction de leurs préférences système. Les utilisateurs existants peuvent activer manuellement le mode sombre dans Paramètres -> Expérimental." + "message": "Le mode sombre est enfin disponible pour l’extension ! Pour changer le mode d'affichage, allez dans « Paramètres » -> « Expérimental » et sélectionnez l’une des options suivantes : Clair, Sombre, Système." }, "notifications12Title": { - "message": "Mode sombre, quand ? Mode sombre maintenant ! 🕶️🦊" + "message": "Mode sombre, quand ? Mode sombre maintenant ! 🕶️🦊" + }, + "notifications13ActionText": { + "message": "Afficher la liste des réseaux personnalisés" + }, + "notifications13Description": { + "message": "Vous pouvez maintenant ajouter facilement les réseaux personnalisés populaires suivants : Arbitrum, Avalanche, Binance Smart Chain, Fantom, Harmony, Optimism, Palm et Polygon ! Pour activer cette fonctionnalité, allez dans Paramètres -> Expérimental et activez « Afficher la liste des réseaux personnalisés » !", + "description": "Description of a notification in the 'See What's New' popup. Describes popular network feature." + }, + "notifications13Title": { + "message": "Ajouter des réseaux populaires" }, "notifications1Description": { "message": "Les utilisateurs de MetaMask Mobile peuvent désormais échanger des jetons dans leur portefeuille mobile. Scannez le code QR pour obtenir l’application mobile et commencez à échanger.", "description": "Description of a notification in the 'See What's New' popup. Describes the swapping on mobile feature." }, "notifications1Title": { - "message": "Les swaps sur mobile sont enfin possibles !", + "message": "Les swaps sur mobile sont enfin possibles !", "description": "Title for a notification in the 'See What's New' popup. Tells users that they can now use MetaMask Swaps on Mobile." }, "notifications3ActionText": { @@ -2192,15 +2239,15 @@ "description": "Title for a notification in the 'See What's New' popup. Encourages users to do swaps on Binance Smart Chain." }, "notifications5Description": { - "message": "Votre « phrase mnémonique » devient votre « phrase secrète de récupération ».", + "message": "Votre « phrase mnémonique » devient votre « phrase secrète de récupération ».", "description": "Description of a notification in the 'See What's New' popup. Describes the seed phrase wording update." }, "notifications6DescriptionOne": { - "message": "Depuis la version 91 de Chrome, l’API qui permettait la prise en charge de notre Ledger (U2F) ne gère plus les portefeuilles matériels. MetaMask a donc mis en place un nouveau système de prise en charge de Ledger Live qui vous permet de continuer à vous connecter à votre appareil Ledger via l’application Ledger Live.", + "message": "Depuis la version 91 de Chrome, l’API qui permettait la prise en charge de notre Ledger (U2F) ne gère plus les portefeuilles matériels. MetaMask a donc mis en place un nouveau système de prise en charge de Ledger Live qui vous permet de continuer à vous connecter à votre appareil Ledger via l’application Ledger Live.", "description": "Description of a notification in the 'See What's New' popup. Describes the Ledger support update." }, "notifications6DescriptionThree": { - "message": "Lorsque vous interagissez avec votre compte Ledger dans MetaMask, un nouvel onglet s’ouvre et vous invite à ouvrir l’application Ledger Live. Une fois celle-ci lancée, vous devrez autoriser une connexion WebSocket à votre compte MetaMask. Et le tour est joué !", + "message": "Lorsque vous interagissez avec votre compte Ledger dans MetaMask, un nouvel onglet s’ouvre et vous invite à ouvrir l’application Ledger Live. Une fois celle-ci lancée, vous devrez autoriser une connexion WebSocket à votre compte MetaMask. Et le tour est joué !", "description": "Description of a notification in the 'See What's New' popup. Describes the Ledger support update." }, "notifications6DescriptionTwo": { @@ -2212,7 +2259,7 @@ "description": "Title for a notification in the 'See What's New' popup. Lets users know about the Ledger support update" }, "notifications7DescriptionOne": { - "message": "MetaMask v10.1.0 inclut une nouvelle prise en charge des transactions EIP-1559 en cas d’utilisation d’appareils Ledger.", + "message": "MetaMask v10.1.0 inclut une nouvelle prise en charge des transactions EIP-1559 en cas d’utilisation d’appareils Ledger.", "description": "Description of a notification in the 'See What's New' popup. Describes changes for ledger and EIP1559 in v10.1.0" }, "notifications7DescriptionTwo": { @@ -2225,14 +2272,14 @@ }, "notifications8ActionText": { "message": "Accédez aux Paramètres avancés", - "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced Settings page." + "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced settings page." }, "notifications8DescriptionOne": { - "message": "Depuis MetaMask v10.4.0, vous n’avez plus besoin de Ledger Live pour connecter votre appareil Ledger à MetaMask.", + "message": "Depuis MetaMask v10.4.0, vous n’avez plus besoin de Ledger Live pour connecter votre appareil Ledger à MetaMask.", "description": "Description of a notification in the 'See What's New' popup. Describes changes for how Ledger Live is no longer needed to connect the device." }, "notifications8DescriptionTwo": { - "message": "Pour une expérience plus conviviale et plus stable, allez dans l’onglet des paramètres Avancés et changez « Type de connexion Ledger préféré » en « WebHID ».", + "message": "Pour une expérience plus conviviale et plus stable, allez dans l’onglet des paramètres Avancés et changez « Type de connexion Ledger préféré » en « WebHID ».", "description": "Description of a notification in the 'See What's New' popup. Describes how the user can turn off the Ledger Live setting." }, "notifications8Title": { @@ -2240,7 +2287,7 @@ "description": "Title for a notification in the 'See What's New' popup. Notifies ledger users that there is an improvement in how they can connect their device." }, "notifications9DescriptionOne": { - "message": "Nous vous proposons désormais plus d’informations dans l’onglet « Données » lors de la confirmation des transactions de contrats intelligents." + "message": "Nous vous proposons désormais plus d’informations dans l’onglet « Données » lors de la confirmation des transactions de contrats intelligents." }, "notifications9DescriptionTwo": { "message": "Vous pouvez à présent mieux cerner les détails de votre transaction avant de la confirmer, et ajouter plus aisément les adresses des transactions à votre carnet d’adresses, ce qui vous aidera à prendre des décisions sûres et éclairées." @@ -2261,10 +2308,6 @@ "notificationsMarkAllAsRead": { "message": "Marquer tout comme lu" }, - "numberOfNewTokensDetected": { - "message": "$1 nouveaux jetons trouvés dans ce compte", - "description": "$1 is the number of new tokens detected" - }, "ofTextNofM": { "message": "de" }, @@ -2320,18 +2363,18 @@ "message": "2" }, "onboardingPinExtensionTitle": { - "message": "Votre installation de MetaMask est terminée !" + "message": "Votre installation de MetaMask est terminée !" }, "onboardingReturnNotice": { - "message": "« $1 » va fermer cet onglet et vous rediriger vers $2", + "message": "« $1 » va fermer cet onglet et vous rediriger vers $2", "description": "Return the user to the site that initiated onboarding" }, "onboardingShowIncomingTransactionsDescription": { - "message": "L’affichage des transactions entrantes dans votre portefeuille repose sur la communication avec $1. Etherscan aura accès à votre adresse Ethereum et à votre adresse IP. Voir $2.", + "message": "L’affichage des transactions entrantes dans votre portefeuille repose sur la communication avec $1. Etherscan aura accès à votre adresse Ethereum et à votre adresse IP. Voir $2.", "description": "$1 is a clickable link with text defined by the 'etherscan' key. $2 is a clickable link with text defined by the 'privacyMsg' key." }, "onboardingUsePhishingDetectionDescription": { - "message": "Les alertes de détection d’hameçonnage reposent sur la communication avec $1. jsDeliver aura accès à votre adresse IP. Voir $2.", + "message": "Les alertes de détection d’hameçonnage reposent sur la communication avec $1. jsDeliver aura accès à votre adresse IP. Voir $2.", "description": "The $1 is the word 'jsDeliver', from key 'jsDeliver' and $2 is the words Privacy Policy from key 'privacyMsg', both separated here so that it can be wrapped as a link" }, "onlyAddTrustedNetworks": { @@ -2344,9 +2387,6 @@ "message": "Ouvrez MetaMask en mode plein écran pour connecter votre Ledger via WebHID.", "description": "Shown to the user on the confirm screen when they are viewing MetaMask in a popup window but need to connect their ledger via webhid." }, - "openSourceCode": { - "message": "Vérifier le code source" - }, "optional": { "message": "Facultatif" }, @@ -2384,7 +2424,7 @@ "message": "Ce mot de passe permet de déverrouiller votre portefeuille MetaMask uniquement sur cet appareil. MetaMask ne peut pas récupérer ce mot de passe." }, "passwordStrength": { - "message": "Robustesse du mot de passe : $1", + "message": "Robustesse du mot de passe : $1", "description": "Return password strength to the user when user wants to create password." }, "passwordStrengthDescription": { @@ -2407,10 +2447,10 @@ "message": "Cette transaction ne sera pas traitée tant que la précédente ne sera pas terminée." }, "pendingTransactionMultiple": { - "message": "Vous avez ($1) transactions en attente." + "message": "Vous avez ($1) transactions en attente." }, "pendingTransactionSingle": { - "message": "Vous avez (1) transaction en attente.", + "message": "Vous avez (1) transaction en attente.", "description": "$1 is count of pending transactions" }, "permissionRequest": { @@ -2440,7 +2480,7 @@ "description": "The description for the `endowment:long-running` permission" }, "permission_manageBip44Keys": { - "message": "Contrôlez vos comptes et actifs « $1 ».", + "message": "Contrôlez vos comptes et actifs « $1 ».", "description": "The description for the `snap_getBip44Entropy_*` permission. $1 is the name of a protocol, e.g. 'Filecoin'." }, "permission_manageState": { @@ -2452,7 +2492,7 @@ "description": "The description for the `snap_notify` permission" }, "permission_unknown": { - "message": "Autorisation inconnue : $1", + "message": "Autorisation inconnue : $1", "description": "$1 is the name of a requested permission that is not recognized." }, "permissions": { @@ -2473,7 +2513,7 @@ }, "preferredLedgerConnectionType": { "message": "Type de connexion Ledger préféré", - "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" + "description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message" }, "preparingSwap": { "message": "Préparation du swap..." @@ -2531,7 +2571,7 @@ "message": "ajouté à nouveau" }, "readdToken": { - "message": "Vous pourrez ajouter à nouveau ce jeton en allant sur « Ajouter un jeton » dans le menu des options de votre compte." + "message": "Vous pourrez ajouter à nouveau ce jeton en allant sur « Ajouter un jeton » dans le menu des options de votre compte." }, "receive": { "message": "Recevoir" @@ -2549,13 +2589,13 @@ "message": "Commencez ici" }, "recoveryPhraseReminderConfirm": { - "message": "C’est compris !" + "message": "C’est compris !" }, "recoveryPhraseReminderHasBackedUp": { "message": "Conservez toujours votre phrase secrète de récupération dans un endroit sûr et secret" }, "recoveryPhraseReminderHasNotBackedUp": { - "message": "Vous avez besoin de sauvegarder à nouveau votre phrase secrète de récupération ?" + "message": "Vous avez besoin de sauvegarder à nouveau votre phrase secrète de récupération ?" }, "recoveryPhraseReminderItemOne": { "message": "Ne partagez jamais votre phrase secrète de récupération avec qui que ce soit" @@ -2588,7 +2628,7 @@ "message": "Rejeté" }, "remember": { - "message": "Rappel :" + "message": "Rappel :" }, "remindMeLater": { "message": "Rappelez-moi plus tard" @@ -2609,7 +2649,7 @@ "message": "Supprimer le Snap" }, "removeSnapConfirmation": { - "message": "Voulez-vous vraiment supprimer $1 ?", + "message": "Voulez-vous vraiment supprimer $1 ?", "description": "$1 represents the name of the snap" }, "removeSnapDescription": { @@ -2652,7 +2692,7 @@ "message": "Restaurer" }, "restoreWalletPreferences": { - "message": "Une sauvegarde de vos données de $1 a été trouvée. Voulez-vous restaurer vos préférences de portefeuille ?", + "message": "Une sauvegarde de vos données de $1 a été trouvée. Voulez-vous restaurer vos préférences de portefeuille ?", "description": "$1 is the date at which the data was backed up" }, "retryTransaction": { @@ -2676,6 +2716,14 @@ "revealTheSeedPhrase": { "message": "Révéler la phrase mnémonique" }, + "revokeAllTokensTitle": { + "message": "Révoquer l'autorisation d'accéder à tous vos $1 ?", + "description": "$1 is the symbol of the token for which the user is revoking approval" + }, + "revokeApproveForAllDescription": { + "message": "En révoquant cette autorisation, les $1 suivants ne pourront plus accéder à vos $2. ", + "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" + }, "rinkeby": { "message": "Réseau de test Rinkeby" }, @@ -2761,22 +2809,22 @@ "message": "Stocker dans un coffre-fort de banque." }, "seedPhraseIntroSidebarCopyOne": { - "message": "Votre phrase secrète de récupération est une formule de 12 mots qui constitue la « clé maîtresse » de votre portefeuille et de vos fonds" + "message": "Votre phrase secrète de récupération est une formule de 12 mots qui constitue la « clé maîtresse » de votre portefeuille et de vos fonds" }, "seedPhraseIntroSidebarCopyThree": { "message": "Si quelqu’un vous demande votre phrase de récupération, il est probable qu’il essaie de vous arnaquer pour dérober les fonds de votre portefeuille" }, "seedPhraseIntroSidebarCopyTwo": { - "message": "Ne partagez jamais, au grand jamais, votre phrase secrète de récupération, pas même avec MetaMask !" + "message": "Ne partagez jamais, au grand jamais, votre phrase secrète de récupération, pas même avec MetaMask !" }, "seedPhraseIntroSidebarTitleOne": { - "message": "Qu’est-ce qu’une phrase secrète de récupération ?" + "message": "Qu’est-ce qu’une phrase secrète de récupération ?" }, "seedPhraseIntroSidebarTitleThree": { - "message": "Dois-je partager ma phrase secrète de récupération ?" + "message": "Dois-je partager ma phrase secrète de récupération ?" }, "seedPhraseIntroSidebarTitleTwo": { - "message": "Comment puis-je sauvegarder ma phrase secrète de récupération ?" + "message": "Comment puis-je sauvegarder ma phrase secrète de récupération ?" }, "seedPhraseIntroTitle": { "message": "Sécuriser votre portefeuille" @@ -2788,7 +2836,7 @@ "message": "Les phrases secrètes de récupération sont composées de 12, 15, 18, 21 ou 24 mots" }, "seedPhraseWriteDownDetails": { - "message": "Notez cette phrase secrète de récupération de 12 mots et stockez-la dans un endroit de confiance où vous seul avez accès." + "message": "Notez cette phrase secrète de récupération de 12 mots et stockez-la dans un endroit de confiance où vous seul avez accès." }, "seedPhraseWriteDownHeader": { "message": "Notez votre phrase secrète de récupération" @@ -2852,12 +2900,23 @@ "message": "Envoi de $1", "description": "$1 represents the native currency symbol for the current network (e.g. ETH or BNB)" }, + "sendingToTokenContractWarning": { + "message": "Attention : vous êtes sur le point d'envoyer des jetons à l'adresse d'un contrat de jetons qui pourrait entraîner une perte de fonds. $1", + "description": "$1 is a clickable link with text defined by the 'learnMoreUpperCase' key. The link will open to a support article regarding the known contract address warning" + }, "setAdvancedPrivacySettings": { "message": "Définir des paramètres de confidentialité avancés" }, "setAdvancedPrivacySettingsDetails": { "message": "MetaMask utilise ces services tiers de confiance pour améliorer la convivialité et la sécurité des produits." }, + "setApprovalForAll": { + "message": "Définir l'approbation pour tous" + }, + "setApprovalForAllTitle": { + "message": "Approuver $1 sans limite de dépenses", + "description": "The token symbol that is being approved" + }, "settings": { "message": "Paramètres" }, @@ -2877,6 +2936,12 @@ "showAdvancedGasInlineDescription": { "message": "Sélectionnez cette option pour afficher le prix du carburant et les contrôles des limites directement sur les écrans d’envoi et de confirmation." }, + "showCustomNetworkList": { + "message": "Afficher la liste des réseaux personnalisés" + }, + "showCustomNetworkListDescription": { + "message": "Sélectionnez cette option pour afficher une liste de réseaux dont l’adresse est préremplie lorsque vous ajoutez un nouveau réseau." + }, "showFiatConversionInTestnets": { "message": "Afficher la conversion sur Testnets" }, @@ -2938,7 +3003,7 @@ "message": "Ignorer" }, "skipAccountSecurity": { - "message": "Renoncer à la sécurité des comptes ?" + "message": "Renoncer à la sécurité des comptes ?" }, "skipAccountSecurityDetails": { "message": "Je suis conscient(e) que tant que je n’aurai pas sauvegardé ma phrase secrète de récupération, je risque de perdre mes comptes et tous leurs actifs." @@ -2950,7 +3015,7 @@ "message": "Transaction intelligente" }, "snapAccess": { - "message": "Le snap $1 peut accéder à :", + "message": "Le snap $1 peut accéder à :", "description": "$1 represents the name of the snap" }, "snapAdded": { @@ -2958,7 +3023,7 @@ "description": "$1 represents the date the snap was installed, $2 represents which origin installed the snap." }, "snapError": { - "message": "Erreur de snap : « $1 ». Code d’erreur : « $2 »", + "message": "Erreur de snap : « $1 ». Code d’erreur : « $2 »", "description": "This is shown when a snap encounters an error. $1 is the error message from the snap, and $2 is the error code." }, "snapInstall": { @@ -2967,12 +3032,8 @@ "snapInstallWarningCheck": { "message": "Pour confirmer que vous comprenez, cochez tout." }, - "snapInstallWarningKeyAccess": { - "message": "Vous accordez un accès de clé au snap « $1 ». Cette action est irrévocable et accorde à « $1 » le contrôle de vos comptes et actifs. Vérifiez que vous pouvez faire confiance à « $1 » avant de continuer.", - "description": "The parameter is the name of the snap" - }, "snapRequestsPermission": { - "message": "Ce snap demande les autorisations suivantes :" + "message": "Ce snap demande les autorisations suivantes :" }, "snaps": { "message": "Snaps" @@ -2986,6 +3047,9 @@ "snapsToggle": { "message": "Un snap ne s’exécute que s’il est activé" }, + "someNetworksMayPoseSecurity": { + "message": "Certains réseaux peuvent présenter des risques pour la sécurité et/ou la vie privée. Informez-vous sur les risques avant d’ajouter et d’utiliser un réseau." + }, "somethingWentWrong": { "message": "Oups ! Quelque chose a mal tourné. " }, @@ -2999,7 +3063,7 @@ "message": "Accélérer cette annulation" }, "speedUpExplanation": { - "message": "Nous avons mis à jour le prix du carburant selon les conditions actuelles du réseau et l’avons augmenté d’au moins 10 % (requis par le réseau)." + "message": "Nous avons mis à jour le prix du carburant selon les conditions actuelles du réseau et l’avons augmenté d’au moins 10 % (requis par le réseau)." }, "speedUpPopoverTitle": { "message": "Accélérer la transaction" @@ -3017,7 +3081,7 @@ "message": "Limite de dépenses insuffisante" }, "spendLimitInvalid": { - "message": "Limite de dépenses invalide ; cela doit être une valeur positive" + "message": "Limite de dépenses invalide ; cela doit être une valeur positive" }, "spendLimitPermission": { "message": "Autorisation de limite de dépenses" @@ -3030,11 +3094,11 @@ "message": "Limite de dépenses trop élevée" }, "srpInputNumberOfWords": { - "message": "J’ai une phrase de $1 mots", + "message": "J’ai une phrase de $1 mots", "description": "This is the text for each option in the dropdown where a user selects how many words their secret recovery phrase has during import. The $1 is the number of words (either 12, 15, 18, 21, or 24)." }, "srpPasteFailedTooManyWords": { - "message": "Le collage a échoué parce que la phrase contenait plus de 24 mots. Une phrase secrète de récupération peut contenir un maximum de 24 mots.", + "message": "Le collage a échoué parce que la phrase contenait plus de 24 mots. Une phrase secrète de récupération peut contenir un maximum de 24 mots.", "description": "Description of SRP paste erorr when the pasted content has too many words" }, "srpPasteTip": { @@ -3084,7 +3148,7 @@ "message": "Assurez-vous que votre Lattice1 est prêt à se connecter" }, "step1LatticeWalletMsg": { - "message": "Vous pouvez connecter MetaMask à votre dispositif Lattice1 une fois qu’il est configuré et en ligne. Déverrouillez votre appareil et munissez-vous de son ID. Pour en savoir plus sur l’utilisation des portefeuilles matériels, $1", + "message": "Vous pouvez connecter MetaMask à votre dispositif Lattice1 une fois qu’il est configuré et en ligne. Déverrouillez votre appareil et munissez-vous de son ID. Pour en savoir plus sur l’utilisation des portefeuilles matériels, $1", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, "step1LedgerWallet": { @@ -3118,7 +3182,7 @@ "message": "Robuste" }, "stxAreHere": { - "message": "Les transactions intelligentes sont là !" + "message": "Les transactions intelligentes sont là !" }, "stxBenefit1": { "message": "Minimise les frais de transaction" @@ -3142,7 +3206,7 @@ "message": "Réessayez le swap. Nous serons là pour vous protéger contre des risques similaires la prochaine fois." }, "stxDescription": { - "message": "MetaMask Swaps vient de devenir beaucoup plus intelligent ! Si vous activez les transactions intelligentes, MetaMask pourra optimiser programmatiquement votre swap pour vous aider à :" + "message": "MetaMask Swaps vient de devenir beaucoup plus intelligent ! Si vous activez les transactions intelligentes, MetaMask pourra optimiser programmatiquement votre swap pour vous aider à :" }, "stxErrorNotEnoughFunds": { "message": "Fonds insuffisants pour une transaction intelligente." @@ -3173,7 +3237,7 @@ "message": "* Avec les transactions intelligentes, votre transaction sera soumise plusieurs fois en privé. Si toutes les tentatives échouent, la transaction sera diffusée publiquement pour s’assurer de la réussite de votre swap." }, "stxSuccess": { - "message": "Swap terminé !" + "message": "Swap terminé !" }, "stxSuccessDescription": { "message": "Votre $1 est maintenant disponible.", @@ -3226,7 +3290,7 @@ "message": "Swap" }, "swapAdvancedSlippageInfo": { - "message": "Si le prix fluctue entre le passage de votre ordre et sa confirmation, on parle alors d’un « effet de glissement » (slippage). Votre swap sera automatiquement annulé si ce phénomène dépasse votre paramètre de « glissement maximal »." + "message": "Si le prix fluctue entre le passage de votre ordre et sa confirmation, on parle alors d’un « effet de glissement » (slippage). Votre swap sera automatiquement annulé si ce phénomène dépasse votre paramètre de « glissement maximal »." }, "swapAggregator": { "message": "Agrégateur" @@ -3246,7 +3310,7 @@ "description": "Used in the transaction display list to describe a transaction that is an approve call on a token that is to be swapped.. $1 is the symbol of a token that has been approved." }, "swapApproveNeedMoreTokens": { - "message": "Vous avez besoin de $1 $2 de plus pour effectuer ce swap", + "message": "Vous avez besoin de $1 $2 de plus pour effectuer ce swap", "description": "Tells the user how many more of a given token they need for a specific swap. $1 is an amount of tokens and $2 is the token symbol." }, "swapApproveNeedMoreTokensSmartTransactions": { @@ -3265,7 +3329,7 @@ "message": "Confirmez avec votre portefeuille matériel" }, "swapContractDataDisabledErrorDescription": { - "message": "Dans l’application Ethereum de votre Ledger, allez dans « Paramètres » et autorisez les données de contrat. Ensuite, retentez votre swap." + "message": "Dans l’application Ethereum de votre Ledger, allez dans « Paramètres » et autorisez les données de contrat. Ensuite, retentez votre swap." }, "swapContractDataDisabledErrorTitle": { "message": "Les données de contrat ne sont pas activées sur votre Ledger" @@ -3340,7 +3404,7 @@ "message": "Le montant du glissement est très élevé." }, "swapIncludesMMFee": { - "message": "Comprend des frais MetaMask à hauteur de $1 %.", + "message": "Comprend des frais MetaMask à hauteur de $1 %.", "description": "Provides information about the fee that metamask takes for swaps. $1 is a decimal number." }, "swapLowSlippageError": { @@ -3353,11 +3417,11 @@ "message": "Frais MetaMask" }, "swapMetaMaskFeeDescription": { - "message": "Nous recherchons systématiquement le meilleur prix auprès des meilleures sources de liquidité. Une commission de $1 % est automatiquement incluse dans cette cotation.", + "message": "Nous recherchons systématiquement le meilleur prix auprès des meilleures sources de liquidité. Une commission de $1 % est automatiquement incluse dans cette cotation.", "description": "Provides information about the fee that metamask takes for swaps. $1 is a decimal number." }, "swapNQuotesWithDot": { - "message": "$1 cotations.", + "message": "$1 cotations.", "description": "$1 is the number of quotes that the user can select from when opening the list of quotes on the 'view quote' screen" }, "swapNewQuoteIn": { @@ -3369,7 +3433,7 @@ "description": "This message communicates the token that is being transferred. It is shown on the awaiting swap screen. The $1 will be a token symbol." }, "swapPriceDifference": { - "message": "Vous êtes sur le point d’effectuer un swap de $1 $2 (~$3) contre $4 $5 (~$6).", + "message": "Vous êtes sur le point d’effectuer un swap de $1 $2 (~$3) contre $4 $5 (~$6).", "description": "This message represents the price slippage for the swap. $1 and $4 are a number (ex: 2.89), $2 and $5 are symbols (ex: ETH), and $3 and $6 are fiat currency amounts." }, "swapPriceDifferenceTitle": { @@ -3392,7 +3456,7 @@ "message": "Détails de la cotation" }, "swapQuoteDetailsSlippageInfo": { - "message": "Si le prix fluctue entre le passage de votre ordre et sa confirmation, on parle alors d’un « effet de glissement » (slippage). Votre swap sera automatiquement annulé si ce phénomène dépasse votre paramètre de « tolérance de glissement »." + "message": "Si le prix fluctue entre le passage de votre ordre et sa confirmation, on parle alors d’un « effet de glissement » (slippage). Votre swap sera automatiquement annulé si ce phénomène dépasse votre paramètre de « tolérance de glissement »." }, "swapQuoteSource": { "message": "Origine de la cotation" @@ -3490,21 +3554,21 @@ "description": "Points the user to Etherscan as a place they can verify information about a token. $1 is replaced with the translation for \"Etherscan\" followed by an info icon that shows more info on hover." }, "swapTokenVerificationOnlyOneSource": { - "message": "Vérification effectuée uniquement sur 1 source." + "message": "Vérification effectuée uniquement sur 1 source." }, "swapTokenVerificationSources": { - "message": "Vérification effectuée sur $1 sources.", + "message": "Vérification effectuée sur $1 sources.", "description": "Indicates the number of token information sources that recognize the symbol + address. $1 is a decimal number." }, "swapTooManyDecimalsError": { - "message": "$1 accepte jusqu’à $2 décimales", + "message": "$1 accepte jusqu’à $2 décimales", "description": "$1 is a token symbol and $2 is the max. number of decimals allowed for the token" }, "swapTransactionComplete": { "message": "Transaction terminée" }, "swapTwoTransactions": { - "message": "2 transactions" + "message": "2 transactions" }, "swapUnknown": { "message": "Inconnu" @@ -3514,17 +3578,17 @@ "description": "This appears in a tooltip next to the verifyThisTokenOn message. It gives the user more information about why they should check the token on a block explorer. $1 will be the name or url of the block explorer, which will be the translation of 'etherscan' or a block explorer url specified for a custom network." }, "swapYourTokenBalance": { - "message": "$1 $2 disponibles pour un swap", + "message": "$1 $2 disponibles pour un swap", "description": "Tells the user how much of a token they have in their balance. $1 is a decimal number amount of tokens, and $2 is a token symbol" }, "swapZeroSlippage": { - "message": "0 % de glissement" + "message": "0 % de glissement" }, "swapsAdvancedOptions": { "message": "Options avancées" }, "swapsExcessiveSlippageWarning": { - "message": "Le montant du glissement est trop élevé et donnera lieu à un mauvais taux. Veuillez réduire votre tolérance de glissement à une valeur inférieure à 15 %." + "message": "Le montant du glissement est trop élevé et donnera lieu à un mauvais taux. Veuillez réduire votre tolérance de glissement à une valeur inférieure à 15 %." }, "swapsMaxSlippage": { "message": "Tolérance de glissement" @@ -3537,10 +3601,10 @@ "message": "Afficher dans l’activité" }, "switchEthereumChainConfirmationDescription": { - "message": "Ceci permet de remplacer le réseau sélectionné dans MetaMask par un réseau précédemment ajouté :" + "message": "Ceci permet de remplacer le réseau sélectionné dans MetaMask par un réseau précédemment ajouté :" }, "switchEthereumChainConfirmationTitle": { - "message": "Autoriser ce site à changer de réseau ?" + "message": "Autoriser ce site à changer de réseau ?" }, "switchNetwork": { "message": "Changer de réseau" @@ -3548,6 +3612,10 @@ "switchNetworks": { "message": "Changer de réseau" }, + "switchToNetwork": { + "message": "Passer à $1", + "description": "$1 represents the custom network that has previously been added" + }, "switchToThisAccount": { "message": "Basculer vers ce compte" }, @@ -3576,7 +3644,7 @@ "message": "Vos données ont été synchronisées avec succès. Profitez de l’application mobile MetaMask !" }, "syncWithMobileDesc": { - "message": "Vous pouvez synchroniser vos comptes et vos informations avec votre appareil mobile. Ouvrez l’application mobile MetaMask, allez dans « Paramètres » et appuyez sur « Synchroniser depuis l’extension de navigateur »" + "message": "Vous pouvez synchroniser vos comptes et vos informations avec votre appareil mobile. Ouvrez l’application mobile MetaMask, allez dans « Paramètres » et appuyez sur « Synchroniser depuis l’extension de navigateur »" }, "syncWithMobileDescNewUsers": { "message": "Si vous ouvrez l’application MetaMask Mobile pour la première fois, suivez simplement les étapes dans votre téléphone." @@ -3591,13 +3659,13 @@ "message": "Synchronisation des données avec 3Box (expérimental)" }, "syncWithThreeBoxDescription": { - "message": "Activez cette fonction pour que vos paramètres soient sauvegardés avec 3Box. Cette fonction est actuellement expérimentale ; utilisez-la avec prudence." + "message": "Activez cette fonction pour que vos paramètres soient sauvegardés avec 3Box. Cette fonction est actuellement expérimentale ; utilisez-la avec prudence." }, "syncWithThreeBoxDisabled": { "message": "3Box a été désactivé en raison d’une erreur lors de la synchronisation initiale" }, "tenPercentIncreased": { - "message": "Augmentation de 10 %" + "message": "Augmentation de 10 %" }, "terms": { "message": "Conditions d’utilisation" @@ -3630,12 +3698,12 @@ "message": "Destinataire" }, "toAddress": { - "message": "Vers : $1", + "message": "Vers : $1", "description": "$1 is the address to include in the To label. It is typically shortened first using shortenAddress" }, "toggleTestNetworks": { "message": "$1 réseaux de test", - "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open to the advanced settings where users can enable the display of test networks in the network dropdown." + "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open Settings > Advanced where users can enable the display of test networks in the network dropdown." }, "token": { "message": "Jeton" @@ -3653,7 +3721,7 @@ "message": "Décimale de jeton requise." }, "tokenDecimalTitle": { - "message": "Décimales du token :" + "message": "Décimales du token :" }, "tokenDetails": { "message": "Détails du token" @@ -3664,17 +3732,11 @@ "tokenDetectionAlertMessage": { "message": "La détection du token est actuellement disponible sur $1. $2" }, - "tokenDetectionAnnouncement": { - "message": "Nouveau ! Une détection améliorée des jetons est disponible sur le Mainnet d’Ethereum en tant que fonctionnalité expérimentale. $1" - }, - "tokenDetectionToggleDescription": { - "message": "L’API des tokens de ConsenSys regroupe une liste de tokens provenant de diverses listes de tokens externes. Sa désactivation arrêtera la détection de nouveaux tokens ajoutés à votre portefeuille, mais conservera l’option de recherche de tokens à importer." - }, "tokenId": { "message": "ID de token" }, "tokenList": { - "message": "Listes de tokens :" + "message": "Listes de tokens :" }, "tokenSymbol": { "message": "Symbole du jeton" @@ -3741,7 +3803,7 @@ "message": "Montant + frais de carburant" }, "transactionDetailLayer2GasHeading": { - "message": "Frais de carburant de couche 2 (L2)" + "message": "Frais de carburant de couche 2 (L2)" }, "transactionDetailMultiLayerTotalSubtitle": { "message": "Montant + frais" @@ -3765,13 +3827,13 @@ "message": "Frais de base (GWEI)" }, "transactionHistoryL1GasLabel": { - "message": "Total des frais de carburant L 1" + "message": "Total des frais de carburant L 1" }, "transactionHistoryL2GasLimitLabel": { - "message": "Limite de carburant L2" + "message": "Limite de carburant L2" }, "transactionHistoryL2GasPriceLabel": { - "message": "Prix de carburant L2" + "message": "Prix de carburant L2" }, "transactionHistoryMaxFeePerGas": { "message": "Frais maximaux par carburant" @@ -3821,7 +3883,7 @@ "message": "Activer la détection améliorée des jetons" }, "twelveHrTitle": { - "message": "12 h :" + "message": "12 h :" }, "txInsightsNotSupported": { "message": "Les aperçus de transaction ne sont pas pris en charge pour ce contrat à l’heure actuelle." @@ -3851,11 +3913,14 @@ "unknownCameraErrorTitle": { "message": "Oups ! Il y a eu un problème...." }, + "unknownCollection": { + "message": "Collection sans nom" + }, "unknownNetwork": { "message": "Réseau privé inconnu" }, "unknownQrCode": { - "message": "Erreur : nous n’avons pas pu identifier le code QR" + "message": "Erreur : nous n’avons pas pu identifier le code QR" }, "unlimited": { "message": "Illimité" @@ -3893,7 +3958,7 @@ "message": "Détection automatique des NFT" }, "useCollectibleDetectionDescription": { - "message": "L’affichage des médias et des données des NFT peut exposer votre adresse IP à des serveurs centralisés. Des API tierces (comme OpenSea) sont utilisées pour détecter les NFT dans votre portefeuille. Cela expose donc l’adresse de votre compte à ces services. Désactivez cette option si vous ne souhaitez pas que l’application récupère des données auprès de ces services." + "message": "L’affichage des médias et des données des NFT peut exposer votre adresse IP à des serveurs centralisés. Des API tierces (comme OpenSea) sont utilisées pour détecter les NFT dans votre portefeuille. Cela expose donc l’adresse de votre compte à ces services. Désactivez cette option si vous ne souhaitez pas que l’application récupère des données auprès de ces services." }, "usePhishingDetection": { "message": "Utiliser la fonction antihameçonnage" @@ -3901,12 +3966,6 @@ "usePhishingDetectionDescription": { "message": "Cela permet d’afficher un avertissement pour les domaines d’hameçonnage ciblant les utilisateurs d’Ethereum" }, - "useTokenDetection": { - "message": "Utiliser la détection des jetons" - }, - "useTokenDetectionDescription": { - "message": "Nous utilisons des API tierces pour détecter et afficher les nouveaux jetons envoyés à votre portefeuille. Désactivez cette option si vous ne souhaitez pas que MetaMask récupère les données de ces services." - }, "useTokenDetectionPrivacyDesc": { "message": "L’affichage automatique des tokens envoyés sur votre compte implique une communication avec des serveurs externes afin de récupérer les images des tokens. Ces serveurs auront accès à votre adresse IP." }, @@ -3968,7 +4027,7 @@ "message": "notre guide de connexion des portefeuilles matériels" }, "walletCreationSuccessDetail": { - "message": "Votre portefeuille est bien protégé. Conservez votre phrase secrète de récupération en sécurité et en toute discrétion. C’est votre responsabilité !" + "message": "Votre portefeuille est bien protégé. Conservez votre phrase secrète de récupération en sécurité et en toute discrétion. C’est votre responsabilité !" }, "walletCreationSuccessReminder1": { "message": "MetaMask ne peut pas restaurer votre phrase secrète de récupération." @@ -3987,6 +4046,9 @@ "walletCreationSuccessTitle": { "message": "Portefeuille créé avec succès" }, + "wantToAddThisNetwork": { + "message": "Voulez-vous ajouter ce réseau ?" + }, "warning": { "message": "Avertissement" }, @@ -3994,7 +4056,7 @@ "message": "Faible" }, "web3ShimUsageNotification": { - "message": "Nous avons remarqué que ce site Web a essayé d’utiliser l’API window.web3 supprimée. Si le site semble être défectueux, veuillez cliquer sur $1 pour plus d’informations.", + "message": "Nous avons remarqué que ce site Web a essayé d’utiliser l’API window.web3 supprimée. Si le site semble être défectueux, veuillez cliquer sur $1 pour plus d’informations.", "description": "$1 is a clickable link." }, "webhid": { @@ -4014,13 +4076,13 @@ "message": "Explorer des applications décentralisées" }, "welcomeLoginDescription": { - "message": "Utilisez votre MetaMask pour vous connecter à des applications décentralisées. Nul besoin de vous inscrire !" + "message": "Utilisez votre MetaMask pour vous connecter à des applications décentralisées. Nul besoin de vous inscrire !" }, "welcomeLoginTitle": { "message": "Dites bonjour à votre portefeuille" }, "welcomeToMetaMask": { - "message": "C’est parti !" + "message": "C’est parti !" }, "welcomeToMetaMaskIntro": { "message": "MetaMask est un portefeuille sécurisé utilisé par des millions de personnes qui rend l’univers du web3 accessible à toutes et à tous." @@ -4030,7 +4092,7 @@ "description": "This is the title of a popup that gives users notifications about new features and updates to MetaMask." }, "whatsThis": { - "message": "Qu’est-ce que c’est ?" + "message": "Qu’est-ce que c’est ?" }, "writePhrase": { "message": "Écrivez cette phrase sur une feuille de papier et rangez-la dans un endroit sûr. Si vous recherchez plus de sécurité, notez-la sur plusieurs feuilles de papier et rangez-les dans deux ou trois endroits différents." @@ -4049,6 +4111,10 @@ "yesLetsTry": { "message": "Oui, essayons" }, + "youHaveAddedAll": { + "message": "Vous avez ajouté tous les réseaux populaires. Vous pouvez découvrir d’autres réseaux $1 ou $2", + "description": "$1 is a link with the text 'here' and $2 is a button with the text 'add more networks manually'" + }, "youNeedToAllowCameraAccess": { "message": "Vous devez autoriser l’accès à votre appareil pour utiliser cette fonctionnalité." }, diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index 2d643f1aa..e4855ee24 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -157,6 +157,9 @@ "addMemo": { "message": "मेमो जोड़ें" }, + "addMoreNetworks": { + "message": "मैन्युअल रूप से अधिक नेटवर्क जोड़ें" + }, "addNetwork": { "message": "नेटवर्क जोड़ें" }, @@ -227,6 +230,10 @@ "alerts": { "message": "चेतावनियां" }, + "allOfYour": { + "message": "आपके सभी $1", + "description": "$1 is the symbol or name of the token that the user is approving spending" + }, "allowExternalExtensionTo": { "message": "इस बाहरी एक्सटेंशन को इसकी अनुमति दें:" }, @@ -263,6 +270,10 @@ "approve": { "message": "खर्च सीमा अनुमोदित करें" }, + "approveAllTokensTitle": { + "message": "आपके सभी $1 को एक्सेस करने के लिए अनुमति दें", + "description": "$1 is the symbol of the token for which the user is granting approval" + }, "approveAndInstall": { "message": "स्वीकृति दें और इंस्टॉल करें" }, @@ -282,9 +293,6 @@ "approvedAsset": { "message": "स्वीकृत एसेट" }, - "areYouDeveloper": { - "message": "क्या आप एक डेवलपर हैं?" - }, "areYouSure": { "message": "क्या आप सुनिश्चित हैं?" }, @@ -435,10 +443,10 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "Wyre के जरिए $1 खरीदें" + "message": "Wyre के साथ $1 खरीदें" }, "buyWithWyreDescription": { - "message": "Wyre आपको अपने MetaMask खाते में $1 जमा करने के लिए डेबिट कार्ड का उपयोग करने की सुविधा देता है।" + "message": "$1000 तक की खरीदारी के लिए आसान ऑनबोर्डिंग। तेज़ इंटरैक्टिव उच्च सीमा खरीद सत्यापन। डेबिट / क्रेडिट कार्ड, ऐप्पल पे, बैंक ट्रांसफर का समर्थन करता है। 100+ देशों में उपलब्ध है। टोकन आपके मेटामास्क खाते में जमा होते हैं" }, "bytes": { "message": "बाइट" @@ -466,6 +474,13 @@ "message": "किसी लेनदेन को $1 करने के लिए गैस शुल्क में कम से कम 10% की वृद्धि की जानी चाहिए ताकि उसे नेटवर्क द्वारा मान्यता मिल सके।", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwapForFee": { + "message": "~$1 में स्वैप रद्द करें", + "description": "$1 could be e.g. $2.98, it is a cost for cancelling a Smart Transaction" + }, + "cancelSwapForFree": { + "message": "मुफ्त में स्वैप रद्द करें" + }, "cancellationGasFee": { "message": "रद्दीकरण गैस शुल्क" }, @@ -650,7 +665,7 @@ "message": "अनुबंध इंटरैक्शन" }, "convertTokenToNFTDescription": { - "message": "हमने पाया है कि ये एसेट एक एनएफटी है। MetaMask के पास अब एनएफटी के लिए पूर्ण स्थानीय सपोर्ट है। क्या आप इसे अपनी टोकन सूची से हटाना चाहते हैं और इसे एनएफटी के रूप में जोड़ना चाहते हैं?" + "message": "हमने पाया है कि यह संपत्ति एक एनएफटी है। मेटामास्क के पास अब एनएफटी के लिए पूर्ण देशी समर्थन है। क्या आप इसे अपनी टोकन सूची से हटाना चाहते हैं और इसे एनएफटी के रूप में जोड़ना चाहते हैं?" }, "convertTokenToNFTExistDescription": { "message": "हमने पाया है कि इस एसेट को एक एनएफटी के रूप में जोड़ा गया है। क्या आप इसे अपनी टोकन सूची से हटाना चाहते हैं?" @@ -732,7 +747,7 @@ }, "customGasSettingToolTipMessage": { "message": "गैस की कीमत को अनुकूलित करने के लिए $1 का उपयोग करें। यदि आप परिचित नहीं हैं तो ये भ्रामक हो सकता है। अपनी ज़िम्मेदारी पर बातचीत करें।", - "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold font-weight" }, "customGasSubTitle": { "message": "शुल्क बढ़ाने से प्रसंस्करण समय में कमी हो सकती है, लेकिन इसकी गारंटी नहीं होती है।" @@ -818,7 +833,7 @@ }, "depositCrypto": { "message": "$1 जमा करें", - "description": "$1 represents the cypto symbol to be purchased" + "description": "$1 represents the crypto symbol to be purchased" }, "description": { "message": "विवरण" @@ -1196,9 +1211,6 @@ "failureMessage": { "message": "कुछ गलत हुआ और हम कार्रवाई को पूरा करने में असमर्थ रहे" }, - "fakeTokenWarning": { - "message": "कोई भी टोकन बना सकता है, जिसमें मौजूदा टोकन के नकली संस्करण को बनाना शामिल है। $1 के बारे में और अधिक जानें" - }, "fast": { "message": "तेज" }, @@ -1277,6 +1289,9 @@ "functionApprove": { "message": "फंक्शन: अनुमोदित करें" }, + "functionSetApprovalForAll": { + "message": "कार्य: सभी के लिए स्वीकृति सेट करें" + }, "functionType": { "message": "फंक्शन का प्रकार" }, @@ -1463,7 +1478,7 @@ }, "highGasSettingToolTipMessage": { "message": "लोकप्रिय NFT ड्रॉप जैसी चीज़ों की वजह से नेटवर्क ट्रैफिक में वृद्धि को कवर करने के लिए $1 का उपयोग करें।", - "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold font-weight" }, "highLowercase": { "message": "उच्च" @@ -1617,6 +1632,9 @@ "invalidSeedPhrase": { "message": "अमान्य गुप्त रिकवरी फ्रेज" }, + "invalidSeedPhraseCaseSensitive": { + "message": "अमान्य निवेश! गुप्त पुनर्प्राप्ति वाक्यांश केस संवेदी है।" + }, "ipfsGateway": { "message": "IPFS गेटवे" }, @@ -1766,7 +1784,7 @@ }, "lowGasSettingToolTipMessage": { "message": "एक सस्ती कीमत की प्रतीक्षा के लिए $1 का उपयोग करें। समय का अनुमान बहुत कम सही होता है क्योंकि कीमतें कुछ हद तक अप्रत्याशित होती हैं।", - "description": "$1 is key 'low' separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'low' separated here so that it can be passed in with bold font-weight" }, "lowLowercase": { "message": "निम्न" @@ -1810,7 +1828,7 @@ }, "mediumGasSettingToolTipMessage": { "message": "मौजूदा बाजार मूल्य पर तेजी से प्रोसेस करने के लिए $1का उपयोग करें।", - "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold font-weight" }, "memo": { "message": "मेमो" @@ -1892,6 +1910,19 @@ "message": "नेटवर्क विवरण सत्यापित करें", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." }, + "mismatchedChainRecommendation": { + "message": "हम सिफ़ारिश करते हैं कि आगे बढ़ने से पहले आप $1 करें।", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key. The link will open to instructions for users to validate custom network details." + }, + "mismatchedNetworkName": { + "message": "हमारे रिकॉर्ड के अनुसार, नेटवर्क का नाम इस चेन आईडी से ठीक से मेल नहीं खा सकता है।" + }, + "mismatchedNetworkSymbol": { + "message": "सबमिट किया गया मुद्रा संकेत इस चेन आईडी के लिए हमारी अपेक्षा से मेल नहीं खाता।" + }, + "mismatchedRpcUrl": { + "message": "हमारे रिकॉर्ड के अनुसार, सबमिट किया गया RPC URL मान इस चेन आईडी के किसी ज्ञात प्रोवाइडर से मेल नहीं खाता।" + }, "missingNFT": { "message": "अपना NFT नहीं देख रहे हैं?" }, @@ -1943,6 +1974,9 @@ "network": { "message": "नेटवर्क:" }, + "networkAddedSuccessfully": { + "message": "नेटवर्क सफलतापूर्वक जोड़ा गया!" + }, "networkDetails": { "message": "नेटवर्क विवरण" }, @@ -2059,6 +2093,9 @@ "message": "नॉन्स $1 के सुझाए गए नॉन्स से अधिक है", "description": "The next nonce according to MetaMask's internal logic" }, + "nft": { + "message": "एनएफटी" + }, "nftTokenIdPlaceholder": { "message": "संग्रहणीय ID दर्ज करें" }, @@ -2130,7 +2167,7 @@ }, "notifications10ActionText": { "message": "सेटिंग्स में जाएं", - "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." + "description": "The 'call to action' on the button, or link, of the 'Visit in Settings' notification. Upon clicking, users will be taken to Settings page." }, "notifications10DescriptionOne": { "message": "बेहतर टोकन डिटेक्शन वर्तमान में Ethereum Mainnet, Polygon, BSC और Avalanche के नेटवर्कों पर उपलब्ध है। और भी आने वाला है!" @@ -2154,11 +2191,21 @@ "message": "डार्क मोड सक्षम करें" }, "notifications12Description": { - "message": "नए उपयोगकर्ताओं के लिए उनकी सिस्टम प्राथमिकताओं के आधार पर डार्क मोड सक्षम किया जाएगा। मौजूदा उपयोगकर्ताओं के लिए, सेटिंग->एक्सपेरिमेंटल के नीचे मैन्युअल रूप से डार्क मोड सक्षम करें।" + "message": "एक्सटेंशन पर डार्क मोड आखिरकार आ गया है! इसे चालू करने के लिए, सेटिंग -> प्रायोगिक पर जाएं और प्रदर्शन विकल्पों में से एक का चयन करें: लाइट, डार्क, सिस्टम।" }, "notifications12Title": { "message": "वेन डार्क मोड? अब डार्क मोड! 🕶️🦊" }, + "notifications13ActionText": { + "message": "कस्टम नेटवर्क सूची दिखाएं" + }, + "notifications13Description": { + "message": "अब आप निम्नलिखित लोकप्रिय कस्टम नेटवर्क्स आसानी से जोड़ सकते हैं: आर्बिट्रम, एवलांश, बिनेंस स्मार्ट चेन, फैंटम, हार्मनी, ऑप्टिमिज़्म, पाम एंड पॉलीगॉन! इस फ़ीचर को एनेबल करने के लिए, सेटिंग्स ->एक्सपेरिमेंटल पर जाएं और \"शो कस्टम नेटवर्क लिस्ट\" ऑन करें!", + "description": "Description of a notification in the 'See What's New' popup. Describes popular network feature." + }, + "notifications13Title": { + "message": "लोकप्रिय नेटवर्क्स जोड़ें" + }, "notifications1Description": { "message": "MetaMask Mobile उपयोगकर्ता अब अपने मोबाइल वॉलेट के अंदर टोकन स्वैप कर सकते हैं। मोबाइल ऐप प्राप्त करने के लिए QR कोड को स्कैन करें और स्वैप करना शुरू करें।", "description": "Description of a notification in the 'See What's New' popup. Describes the swapping on mobile feature." @@ -2225,7 +2272,7 @@ }, "notifications8ActionText": { "message": "एडवांस सेटिंग्स पर जाएं", - "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced Settings page." + "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced settings page." }, "notifications8DescriptionOne": { "message": "MetaMask v10.4.0 के अनुसार, अब आपको अपने लेजर डिवाइस को मेटामास्क से कनेक्ट करने के लिए लेजर लाइव की आवश्यकता नहीं है।", @@ -2255,15 +2302,11 @@ "message": "सूचनाएं" }, "notificationsInfos": { - "message": "$1 से $2", + "message": "$1 को $2 से", "description": "$1 is the date at which the notification has been dispatched and $2 is the link to the snap that dispatched the notification." }, "notificationsMarkAllAsRead": { - "message": "सभी को पढ़ा हुआ मार्क करें" - }, - "numberOfNewTokensDetected": { - "message": "इस खाते में $1 के नए टोकन पाए गए", - "description": "$1 is the number of new tokens detected" + "message": "सभी को पढ़ा हुआ चिन्हित करें" }, "ofTextNofM": { "message": "का" @@ -2344,9 +2387,6 @@ "message": "अपने लेजर को WebHID के माध्यम से कनेक्ट करने के लिए MetaMask को पूर्ण स्क्रीन में खोलें।", "description": "Shown to the user on the confirm screen when they are viewing MetaMask in a popup window but need to connect their ledger via webhid." }, - "openSourceCode": { - "message": "सोर्स कोड जांचें" - }, "optional": { "message": "वैकल्पिक" }, @@ -2473,7 +2513,7 @@ }, "preferredLedgerConnectionType": { "message": "वरीयता वाले लेजर कनेक्शन के प्रकार", - "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" + "description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message" }, "preparingSwap": { "message": "स्वैप की तैयारी कर रहा है..." @@ -2646,7 +2686,7 @@ "message": "आगे बढ़ने से पहले ये सुनिश्चित करें कि आप सही सीक्रेट रिकवरी फ़्रेज़ का इस्तेमाल कर रहे हैं। इसे आप अनडू नहीं कर पाएंगे।" }, "restartMetamask": { - "message": "मेटामास्क को पुनरारंभ करें" + "message": "MetaMask को फिर से शुरू करें" }, "restore": { "message": "पुनर्स्थापित करें" @@ -2676,6 +2716,14 @@ "revealTheSeedPhrase": { "message": "सीड फ़्रेज़ दिखाएं" }, + "revokeAllTokensTitle": { + "message": "अपने सभी $1 को एक्सेस करने की अनुमति निरस्त करें?", + "description": "$1 is the symbol of the token for which the user is revoking approval" + }, + "revokeApproveForAllDescription": { + "message": "अनुमति निरस्त करने से, निम्नलिखित $1 अब आपके $2 को एक्सेस नहीं कर सकेगा", + "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" + }, "rinkeby": { "message": "Rinkeby टेस्ट नेटवर्क" }, @@ -2852,12 +2900,23 @@ "message": "$1 भेजा जा रहा है", "description": "$1 represents the native currency symbol for the current network (e.g. ETH or BNB)" }, + "sendingToTokenContractWarning": { + "message": "चेतावनी: आप एक टोकन अनुबंध को भेजने वाले हैं जिसके परिणामस्वरूप धन की हानि हो सकती है। $1", + "description": "$1 is a clickable link with text defined by the 'learnMoreUpperCase' key. The link will open to a support article regarding the known contract address warning" + }, "setAdvancedPrivacySettings": { "message": "एडवांस गोपनीयता सेटिंग्स निर्धारित करें" }, "setAdvancedPrivacySettingsDetails": { "message": "MetaMask उत्पाद की उपयोगिता और सुरक्षा को बढ़ाने के लिए इन विश्वसनीय तीसरे-पक्ष की सेवाओं का उपयोग करता है।" }, + "setApprovalForAll": { + "message": "सभी के लिए स्वीकृति सेट करें" + }, + "setApprovalForAllTitle": { + "message": "बिना किसी खर्च सीमा के $1 स्वीकृत करें", + "description": "The token symbol that is being approved" + }, "settings": { "message": "सेटिंग" }, @@ -2877,6 +2936,12 @@ "showAdvancedGasInlineDescription": { "message": "गैस मूल्य और सीमा नियंत्रण को सीधे भेजने और पुष्टि करने की स्क्रीन पर दिखाने के लिए इसका चयन करें।" }, + "showCustomNetworkList": { + "message": "कस्टम नेटवर्क की सूची दिखाएं" + }, + "showCustomNetworkListDescription": { + "message": "नया नेटवर्क जोड़ते समय पहले से भरे हुए विवरण वाले नेटवर्कों की सूची दिखाने के लिए इसे चुनें।" + }, "showFiatConversionInTestnets": { "message": "टेस्ट नेटवर्क पर रूपांतरण दिखाएं" }, @@ -2967,10 +3032,6 @@ "snapInstallWarningCheck": { "message": "ये पुष्टि करने के लिए कि आप समझते हैं, सभी पर सही का निशान लगाएं।" }, - "snapInstallWarningKeyAccess": { - "message": "आप स्नैप \"$1\" को महत्वपूर्ण एक्सेस प्रदान कर रहे हैं। यह अपरिवर्तनीय है और आपके अकाउंट्स और एसेट्स पर \"$1\" को नियंत्रण प्रदान करता है। आगे बढ़ने से पहले सुनिश्चित करें कि आप \"$1\" पर भरोसा करते हैं।", - "description": "The parameter is the name of the snap" - }, "snapRequestsPermission": { "message": "ये स्नैप निम्नलिखित अनुमतियों हेतु अनुरोध कर रहा है:" }, @@ -2986,6 +3047,9 @@ "snapsToggle": { "message": "कोई स्नैप तभी चलेगा जब उसे सक्षम किया गया हो" }, + "someNetworksMayPoseSecurity": { + "message": "कुछ नेटवर्क सुरक्षा और/या गोपनीयता संबंधी जोखिम पैदा कर सकते हैं। नेटवर्क जोड़ने और उपयोग करने से पहले जोखिमों को समझें।" + }, "somethingWentWrong": { "message": "ओह! कुछ गलत हो गया।" }, @@ -3164,10 +3228,10 @@ "message": "स्मार्ट लेनदेन अनुपलब्ध होने पर भी आप अपने टोकनों को स्वैप कर सकते हैं।" }, "stxPendingPrivatelySubmittingSwap": { - "message": "आपका स्वैप निजी रूप से भेजा जा रहा है..." + "message": "आपका स्वैप निजी रूप से सबमिट किया जा रहा है..." }, "stxPendingPubliclySubmittingSwap": { - "message": "आपका स्वैप सार्वजनिक रूप से भेजा जा रहा है..." + "message": "आपका स्वैप सार्वजनिक रूप से सबमिट किया जा रहा है..." }, "stxSubDescription": { "message": "* स्मार्ट लेनदेन आपके लेनदेन को निजी तौर पर, अनेक बार जमा करने का प्रयास करेंगे। यदि सभी प्रयास विफल हो जाते हैं, तो लेनदेन को सार्वजनिक रूप से प्रसारित किया जाएगा ताकि यह सुनिश्चित हो सके कि आपका स्वैप सफलतापूर्वक पूरा हो।" @@ -3180,7 +3244,7 @@ "description": "$1 is a token symbol, e.g. ETH" }, "stxSwapCompleteIn": { - "message": "स्वैप < में पूरा होगा", + "message": "स्वैप पूरा होने में शेष समय <", "description": "'<' means 'less than', e.g. Swap will complete in < 2:59" }, "stxTooltip": { @@ -3548,6 +3612,10 @@ "switchNetworks": { "message": "नेटवर्क स्विच करें" }, + "switchToNetwork": { + "message": "$1 पर स्विच करें", + "description": "$1 represents the custom network that has previously been added" + }, "switchToThisAccount": { "message": "इस खाते पर स्विच करें" }, @@ -3635,7 +3703,7 @@ }, "toggleTestNetworks": { "message": "$1 परीक्षण नेटवर्क", - "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open to the advanced settings where users can enable the display of test networks in the network dropdown." + "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open Settings > Advanced where users can enable the display of test networks in the network dropdown." }, "token": { "message": "टोकन" @@ -3664,12 +3732,6 @@ "tokenDetectionAlertMessage": { "message": "फिलहाल टोकन डिटेक्शन $1 पर उपलब्ध है। $2" }, - "tokenDetectionAnnouncement": { - "message": "नया! प्रायोगिक फीचर के रूप में Ethereum Mainnet पर बेहतर टोकन डिटेक्शन उपलब्ध है। $1" - }, - "tokenDetectionToggleDescription": { - "message": "ConsenSys के टोकन का एपीआई विभिन्न थर्ड पार्टी टोकन सूचियों में से टोकन की एक सूची एकत्र करता है। इसे बंद करने से आपके वॉलेट में जोड़े गए नए टोकन का पता चलना बंद हो जाएगा, लेकिन इंपोर्ट करने के लिए टोकन खोजने का विकल्प बना रहेगा।" - }, "tokenId": { "message": "टोकन आइडी" }, @@ -3805,7 +3867,7 @@ "description": "$1 is the wallet device name; $2 is a link to wallet connection guide" }, "troubleStarting": { - "message": "मेटामास्क को शुरू करने में दिक्कत हुई। यह त्रुटि रुक-रुक कर हो सकती है, इसलिए एक्सटेंशन को पुनरारंभ करने का प्रयास करें।" + "message": "MetaMask को शुरू करने में परेशानी आई। यह त्रुटि रुक-रुक कर हो सकती है, इसलिए एक्सटेंशन को फिर से शुरू करके देखें।" }, "troubleTokenBalances": { "message": "हमें आपके टोकन की शेषराशि लोड करने में परेशानी हुई। आप उन्हें देख सकते हैं ", @@ -3851,6 +3913,9 @@ "unknownCameraErrorTitle": { "message": "ओह! कुछ गलत हो गया...." }, + "unknownCollection": { + "message": "अनाम संग्रह" + }, "unknownNetwork": { "message": "अज्ञात निजी नेटवर्क" }, @@ -3901,12 +3966,6 @@ "usePhishingDetectionDescription": { "message": "Ethereum उपयोगकर्ताओं को लक्षित करने वाले फिशिंग डोमेन के लिए एक चेतावनी प्रदर्शित करें" }, - "useTokenDetection": { - "message": "टोकन डिटेक्शन का उपयोग करें" - }, - "useTokenDetectionDescription": { - "message": "हम आपके वॉलेट में भेजे गए नए टोकन का पता लगाने और प्रदर्शित करने के लिए तीसरे-पक्ष API का उपयोग करते हैं। बंद करें यदि आप नहीं चाहते कि MetaMask उन सेवाओं से डेटा पुल करे।" - }, "useTokenDetectionPrivacyDesc": { "message": "आपके खाते में भेजे गए टोकन को स्वचालित रूप से प्रदर्शित करने में थर्ड पार्टी के सर्वर्स के साथ संचार शामिल रहेगा, जो टोकन के चित्रों को लाने का काम करते हैं। वे सर्वर्स आपके IP एड्रेस को एक्सेस कर पाएंगे।" }, @@ -3987,6 +4046,9 @@ "walletCreationSuccessTitle": { "message": "वॉलेट का निर्माण सफल हुआ" }, + "wantToAddThisNetwork": { + "message": "इस नेटवर्क को जोड़ना चाहते हैं?" + }, "warning": { "message": "चेतावनी" }, @@ -4049,6 +4111,10 @@ "yesLetsTry": { "message": "हां, आइए आजमाते हैं" }, + "youHaveAddedAll": { + "message": "आपने सभी लोकप्रिय नेटवर्क जोड़ लिए हैं। आप अधिक नेटवर्क खोज सकते हैं $1 या आप $2 कर सकते हैं", + "description": "$1 is a link with the text 'here' and $2 is a button with the text 'add more networks manually'" + }, "youNeedToAllowCameraAccess": { "message": "आपको इस सुविधा का उपयोग करने के लिए कैमरे तक पहुंच की अनुमति देने की आवश्यकता है।" }, diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index 83c6ea82d..5c7b61784 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -157,6 +157,9 @@ "addMemo": { "message": "Tambahkan memo" }, + "addMoreNetworks": { + "message": "tambahkan jaringan secara manual" + }, "addNetwork": { "message": "Tambahkan Jaringan" }, @@ -227,6 +230,10 @@ "alerts": { "message": "Peringatan" }, + "allOfYour": { + "message": "Seluruh $1 Anda", + "description": "$1 is the symbol or name of the token that the user is approving spending" + }, "allowExternalExtensionTo": { "message": "Izinkan ekstensi eksternal ini untuk:" }, @@ -263,6 +270,10 @@ "approve": { "message": "Setujui batas penggunaan" }, + "approveAllTokensTitle": { + "message": "Berikan izin untuk mengakses seluruh $1 Anda?", + "description": "$1 is the symbol of the token for which the user is granting approval" + }, "approveAndInstall": { "message": "Setujui & Instal" }, @@ -282,9 +293,6 @@ "approvedAsset": { "message": "Aset yang disetujui" }, - "areYouDeveloper": { - "message": "Anda seorang pengembang?" - }, "areYouSure": { "message": "Anda yakin?" }, @@ -438,7 +446,7 @@ "message": "Beli $1 dengan Wyre" }, "buyWithWyreDescription": { - "message": "Wyre memungkinkan Anda menggunakan kartu debit untuk menyetorkan ETH langsung di akun MetaMask Anda." + "message": "Orientasi mudah untuk pembelian hingga $ 1000. Verifikasi pembelian limit tinggi interaktif yang cepat. Mendukung Kartu Debit/Kredit, Apple Pay, Transfer Bank. Tersedia di 100+ negara. Token disetor ke Akun MetaMask Anda" }, "bytes": { "message": "Byte" @@ -466,6 +474,13 @@ "message": "Untuk $1 suatu transaksi, biaya gas harus dinaikkan minimal 10% agar dapat dikenali oleh jaringan.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwapForFee": { + "message": "Batalkan swap untuk ~$1", + "description": "$1 could be e.g. $2.98, it is a cost for cancelling a Smart Transaction" + }, + "cancelSwapForFree": { + "message": "Batalkan swap gratis" + }, "cancellationGasFee": { "message": "Biaya Pembatalan Gas" }, @@ -650,7 +665,7 @@ "message": "Interaksi Kontrak" }, "convertTokenToNFTDescription": { - "message": "Kami mendeteksi bahwa aset ini merupakan NFT. Kini MetaMask memiliki dukungan asli penuh untuk NFT. Anda ingin menghapusnya dari daftar token dan menambahkannya sebagai NFT?" + "message": "Kami mendeteksi bahwa aset ini merupakan NFT. Kini MetaMask memiliki dukungan asli penuh untuk NFT. Ingin menghapusnya dari daftar token dan menambahkannya sebagai NFT?" }, "convertTokenToNFTExistDescription": { "message": "Kami mendeteksi bahwa aset ini telah ditambahkan sebagai NFT. Anda ingin menghapusnya dari daftar token?" @@ -732,7 +747,7 @@ }, "customGasSettingToolTipMessage": { "message": "Gunakan $1 untuk menyesuaikan harga gas. Anda akan bingung jika tidak terbiasa. Berinteraksi dengan risiko Anda sendiri.", - "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold font-weight" }, "customGasSubTitle": { "message": "Menaikkan biaya dapat mengurangi waktu pemrosesan, namun tidak ada jaminan." @@ -818,7 +833,7 @@ }, "depositCrypto": { "message": "Deposit $1", - "description": "$1 represents the cypto symbol to be purchased" + "description": "$1 represents the crypto symbol to be purchased" }, "description": { "message": "Deskripsi" @@ -1196,9 +1211,6 @@ "failureMessage": { "message": "Ada yang salah, dan kami tidak dapat menyelesaikan tindakan" }, - "fakeTokenWarning": { - "message": "Siapa pun dapat membuat token, termasuk membuat versi palsu dari token yang ada. Pelajari selengkapnya seputar $1" - }, "fast": { "message": "Cepat" }, @@ -1277,6 +1289,9 @@ "functionApprove": { "message": "Fungsi: Setujui" }, + "functionSetApprovalForAll": { + "message": "Fungsi: SetApprovalForAll" + }, "functionType": { "message": "Jenis Fungsi" }, @@ -1463,7 +1478,7 @@ }, "highGasSettingToolTipMessage": { "message": "Gunakan $1 untuk menutupi lonjakan lalu lintas jaringan karena hal-hal seperti penurunan NFT populer.", - "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold font-weight" }, "highLowercase": { "message": "tinggi" @@ -1617,6 +1632,9 @@ "invalidSeedPhrase": { "message": "Frasa Pemulihan Rahasia Tidak Valid" }, + "invalidSeedPhraseCaseSensitive": { + "message": "Masukan tidak valid! Frasa Pemulihan Rahasia peka terhadap huruf besar/kecil." + }, "ipfsGateway": { "message": "Gateway IPFS" }, @@ -1766,7 +1784,7 @@ }, "lowGasSettingToolTipMessage": { "message": "Gunakan $1 untuk menunggu harga yang lebih murah. Estimasi waktu kurang akurat karena harga sedang tidak dapat diprediksi.", - "description": "$1 is key 'low' separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'low' separated here so that it can be passed in with bold font-weight" }, "lowLowercase": { "message": "rendah" @@ -1810,7 +1828,7 @@ }, "mediumGasSettingToolTipMessage": { "message": "Gunakan $1 untuk pemrosesan cepat dengan harga pasar saat ini.", - "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold font-weight" }, "memo": { "message": "memo" @@ -1892,6 +1910,19 @@ "message": "memverifikasi detail jaringan", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." }, + "mismatchedChainRecommendation": { + "message": "Kami menyarankan agar Anda $1 sebelum melanjutkan.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key. The link will open to instructions for users to validate custom network details." + }, + "mismatchedNetworkName": { + "message": "Menurut catatan kami, nama jaringan mungkin tidak sepenuhnya sesuai dengan ID rantai ini." + }, + "mismatchedNetworkSymbol": { + "message": "Simbol mata uang yang dikirimkan tidak sesuai dengan yang kami harapkan untuk ID rantai ini." + }, + "mismatchedRpcUrl": { + "message": "Menurut catatan kami, nilai URL RPC yang dikirimkan tidak sesuai dengan penyedia yang dikenal untuk ID rantai ini." + }, "missingNFT": { "message": "Tidak melihat NFT Anda?" }, @@ -1943,6 +1974,9 @@ "network": { "message": "Jaringan:" }, + "networkAddedSuccessfully": { + "message": "Jaringan berhasil ditambahkan!" + }, "networkDetails": { "message": "Detail Jaringan" }, @@ -2059,6 +2093,9 @@ "message": "Nonce lebih tinggi dari nonce $1 yang disarankan", "description": "The next nonce according to MetaMask's internal logic" }, + "nft": { + "message": "NFT" + }, "nftTokenIdPlaceholder": { "message": "Masukkan ID koleksi" }, @@ -2130,7 +2167,7 @@ }, "notifications10ActionText": { "message": "Lihat di pengaturan", - "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." + "description": "The 'call to action' on the button, or link, of the 'Visit in Settings' notification. Upon clicking, users will be taken to Settings page." }, "notifications10DescriptionOne": { "message": "Deteksi token yang ditingkatkan saat ini tersedia di jaringan Ethereum Mainnet, Polygon, BSC, dan Avalanche. Nantikan selengkapnya!" @@ -2154,11 +2191,21 @@ "message": "Aktifkan mode gelap" }, "notifications12Description": { - "message": "Mode Gelap akan diaktifkan untuk pengguna baru tergantung preferensi sistem mereka. Untuk pengguna lama, aktifkan Mode Gelap secara manual di bawah Pengaturan -> Eksperimental." + "message": "Mode gelap pada Ekstensi akhirnya hadir! Untuk menyalakannya, buka Pengaturan -> Eksperimental dan pilih salah satu opsi tampilan: Terang, Gelap, Sistem." }, "notifications12Title": { "message": "Kapan mode gelap? Ini saatnya mode gelap! ️🕶️🦊" }, + "notifications13ActionText": { + "message": "Tampilkan daftar jaringan khusus" + }, + "notifications13Description": { + "message": "Kini Anda dapat menambahkan jaringan khusus populer berikut dengan mudah: Arbitrum, Avalanche, Binance Smart Chain, Fantom, Harmony, Optimism, Palm, dan Polygon! Untuk mengaktifkan fitur ini, buka Pengaturan -> Eksperimental dan aktifkan \"Tampilkan daftar jaringan khusus\"!", + "description": "Description of a notification in the 'See What's New' popup. Describes popular network feature." + }, + "notifications13Title": { + "message": "Tambahkan Jaringan Populer" + }, "notifications1Description": { "message": "Pengguna MetaMask Mobile kini bisa menukar token di dalam dompet seluler mereka. Pindai kode QR untuk mendapatkan aplikasi seluler dan mulai menukar.", "description": "Description of a notification in the 'See What's New' popup. Describes the swapping on mobile feature." @@ -2225,7 +2272,7 @@ }, "notifications8ActionText": { "message": "Buka Pengaturan Lanjutan", - "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced Settings page." + "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced settings page." }, "notifications8DescriptionOne": { "message": "Pada MetaMask v10.4.0, Anda tidak lagi memerlukan Ledger Live untuk menghubungkan perangkat Ledger Anda ke MetaMask.", @@ -2261,10 +2308,6 @@ "notificationsMarkAllAsRead": { "message": "Tandai semua telah dibaca" }, - "numberOfNewTokensDetected": { - "message": "$1 token baru ditemukan di akun ini", - "description": "$1 is the number of new tokens detected" - }, "ofTextNofM": { "message": "dari" }, @@ -2344,9 +2387,6 @@ "message": "Buka MetaMask dalam layar penuh untuk menghubungkan ledger Anda melalui WebHID.", "description": "Shown to the user on the confirm screen when they are viewing MetaMask in a popup window but need to connect their ledger via webhid." }, - "openSourceCode": { - "message": "Periksa kode sumbernya" - }, "optional": { "message": "Opsional" }, @@ -2473,7 +2513,7 @@ }, "preferredLedgerConnectionType": { "message": "Jenis Koneksi Ledger Pilihan", - "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" + "description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message" }, "preparingSwap": { "message": "Mempersiapkan pertukaran..." @@ -2676,6 +2716,14 @@ "revealTheSeedPhrase": { "message": "Ungkap frasa seed" }, + "revokeAllTokensTitle": { + "message": "Cabut izin untuk mengakses seluruh $1 Anda?", + "description": "$1 is the symbol of the token for which the user is revoking approval" + }, + "revokeApproveForAllDescription": { + "message": "Dengan mencabut izin, $1 berikut tidak lagi dapat mengakses $2 Anda", + "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" + }, "rinkeby": { "message": "Jaringan Uji Rinkeby" }, @@ -2852,12 +2900,23 @@ "message": "Mengirim $1", "description": "$1 represents the native currency symbol for the current network (e.g. ETH or BNB)" }, + "sendingToTokenContractWarning": { + "message": "Peringatan: Anda akan mengirim kontrak token yang berpotensi mengakibatkan hilangnya dana. $1", + "description": "$1 is a clickable link with text defined by the 'learnMoreUpperCase' key. The link will open to a support article regarding the known contract address warning" + }, "setAdvancedPrivacySettings": { "message": "Atur pengaturan privasi lanjutan" }, "setAdvancedPrivacySettingsDetails": { "message": "MetaMask menggunakan layanan pihak ketiga tepercaya ini untuk meningkatkan kegunaan dan keamanan produk." }, + "setApprovalForAll": { + "message": "Atur Persetujuan untuk Semua" + }, + "setApprovalForAllTitle": { + "message": "Setujui $1 tanpa batas penggunaan", + "description": "The token symbol that is being approved" + }, "settings": { "message": "Pengaturan" }, @@ -2877,6 +2936,12 @@ "showAdvancedGasInlineDescription": { "message": "Pilih ini untuk menampilkan biaya gas dan kontrol batas secara langsung di layar kirim dan konfirmasi." }, + "showCustomNetworkList": { + "message": "Tampilkan Daftar Jaringan Khusus" + }, + "showCustomNetworkListDescription": { + "message": "Pilih ini untuk menampilkan daftar jaringan dengan detail yang telah diisi saat menambahkan jaringan baru." + }, "showFiatConversionInTestnets": { "message": "Tampilkan Konversi di Testnet" }, @@ -2967,10 +3032,6 @@ "snapInstallWarningCheck": { "message": "Untuk mengonfirmasikan Anda sudah paham, centang semua." }, - "snapInstallWarningKeyAccess": { - "message": "Anda memberikan akses kunci ke snap \"$1\". Tindakan ini tidak dapat dibatalkan dan memberikan kendali \"$1\" atas akun dan aset Anda. Sebelum melanjutkan, pastikan \"$1\" aman.", - "description": "The parameter is the name of the snap" - }, "snapRequestsPermission": { "message": "Snap ini meminta izin berikut:" }, @@ -2986,6 +3047,9 @@ "snapsToggle": { "message": "Snap hanya akan beroperasi jika diaktifkan" }, + "someNetworksMayPoseSecurity": { + "message": "Beberapa jaringan dapat menimbulkan risiko keamanan dan/atau privasi. Pahami risikonya sebelum menambahkan & menggunakan jaringan." + }, "somethingWentWrong": { "message": "Ups! Ada yang salah." }, @@ -3548,6 +3612,10 @@ "switchNetworks": { "message": "Beralih Jaringan" }, + "switchToNetwork": { + "message": "Beralih ke $1", + "description": "$1 represents the custom network that has previously been added" + }, "switchToThisAccount": { "message": "Beralih ke akun ini" }, @@ -3635,7 +3703,7 @@ }, "toggleTestNetworks": { "message": "$1 jaringan pengujian", - "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open to the advanced settings where users can enable the display of test networks in the network dropdown." + "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open Settings > Advanced where users can enable the display of test networks in the network dropdown." }, "token": { "message": "Token" @@ -3664,12 +3732,6 @@ "tokenDetectionAlertMessage": { "message": "Saat ini deteksi token tersedia di $1. $2" }, - "tokenDetectionAnnouncement": { - "message": "Baru! Deteksi token yang ditingkatkan tersedia di Ethereum Mainnet sebagai fitur eksperimental. $1" - }, - "tokenDetectionToggleDescription": { - "message": "API token ConsenSys mengumpulkan daftar token dari berbagai daftar token pihak ketiga. Menonaktifkannya akan menghentikan deteksi token baru yang ditambahkan ke dompet Anda, tetapi Anda akan tetap memiliki opsi untuk mencari token yang akan diimpor." - }, "tokenId": { "message": "ID token" }, @@ -3851,6 +3913,9 @@ "unknownCameraErrorTitle": { "message": "Ups! Ada yang salah..." }, + "unknownCollection": { + "message": "Koleksi tanpa nama" + }, "unknownNetwork": { "message": "Jaringan Privat Tidak Dikenal" }, @@ -3901,12 +3966,6 @@ "usePhishingDetectionDescription": { "message": "Menampilkan peringatan untuk domain pengelabuan yang menargetkan pengguna Ethereum" }, - "useTokenDetection": { - "message": "Gunakan Deteksi Token" - }, - "useTokenDetectionDescription": { - "message": "Kami menggunakan API pihak ketiga untuk mendeteksi dan menampilkan token baru yang dikirim ke dompet Anda. Matikan jika Anda tidak ingin MetaMask memakai data dari layanan tersebut." - }, "useTokenDetectionPrivacyDesc": { "message": "Menampilkan token yang dikirim ke akun Anda secara otomatis yang melibatkan komunikasi dengan server pihak ketiga untuk mengambil gambar token. Server tersebut akan memiliki akses ke alamat IP Anda." }, @@ -3987,6 +4046,9 @@ "walletCreationSuccessTitle": { "message": "Dompet berhasil dibuat" }, + "wantToAddThisNetwork": { + "message": "Ingin menambahkan jaringan ini?" + }, "warning": { "message": "Peringatan" }, @@ -4049,6 +4111,10 @@ "yesLetsTry": { "message": "Ya, mari kita coba" }, + "youHaveAddedAll": { + "message": "Anda telah menambahkan semua jaringan populer. Anda dapat menemukan lebih banyak jaringan $1 atau dapat $2", + "description": "$1 is a link with the text 'here' and $2 is a button with the text 'add more networks manually'" + }, "youNeedToAllowCameraAccess": { "message": "Anda harus mengizinkan akses kamera untuk menggunakan fitur ini." }, diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index bf140ebfd..6e24b8903 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -157,6 +157,9 @@ "addMemo": { "message": "メモを追加" }, + "addMoreNetworks": { + "message": "他のネットワークを手動で追加" + }, "addNetwork": { "message": "ネットワークを追加" }, @@ -227,6 +230,10 @@ "alerts": { "message": "アラート" }, + "allOfYour": { + "message": "すべての $1", + "description": "$1 is the symbol or name of the token that the user is approving spending" + }, "allowExternalExtensionTo": { "message": "この外部拡張機能に次の操作を許可します" }, @@ -263,6 +270,10 @@ "approve": { "message": "使用限度額の承認" }, + "approveAllTokensTitle": { + "message": "すべての $1 へのアクセスを許可しますか?", + "description": "$1 is the symbol of the token for which the user is granting approval" + }, "approveAndInstall": { "message": "承認してインストール" }, @@ -282,9 +293,6 @@ "approvedAsset": { "message": "承認済みのアセット" }, - "areYouDeveloper": { - "message": "開発者の方ですか?" - }, "areYouSure": { "message": "よろしいですか?" }, @@ -435,10 +443,10 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "Wyreで $1 を購入" + "message": "Wyreで$1を購入" }, "buyWithWyreDescription": { - "message": "Wyreを使用すると、デビット カードを使用して、$1 をMetaMaskアカウントに直接デポジットできます。" + "message": "簡単なオンボーディングプロセスで最高 $ 1000 購入可能。迅速かつインタラクティブな高限度額の購入検証。デビット・クレジットカード、Apple Pay、銀行送金に対応。100か国以上で利用可能。トークンは MetaMask アカウントに入金されます。" }, "bytes": { "message": "バイト" @@ -466,6 +474,13 @@ "message": "トランザクションを$1するには、ネットワークに認識されるようにガス代を 10% 以上増額する必要があります。", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwapForFee": { + "message": "$1 以下でスワップをキャンセル", + "description": "$1 could be e.g. $2.98, it is a cost for cancelling a Smart Transaction" + }, + "cancelSwapForFree": { + "message": "無料でスワップをキャンセル" + }, "cancellationGasFee": { "message": "キャンセルのガス代" }, @@ -732,7 +747,7 @@ }, "customGasSettingToolTipMessage": { "message": "ガス代をカスタマイズするには$1を使用します。慣れていない場合はわかりにくい可能性があります。自己責任で操作してください。", - "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold font-weight" }, "customGasSubTitle": { "message": "手数料を増やすと処理時間は短くなる可能性がありますが、必ずそうなるとは限りません。" @@ -818,7 +833,7 @@ }, "depositCrypto": { "message": "$1 を入金", - "description": "$1 represents the cypto symbol to be purchased" + "description": "$1 represents the crypto symbol to be purchased" }, "description": { "message": "説明" @@ -1196,9 +1211,6 @@ "failureMessage": { "message": "問題が発生しました。アクションを完了させることができません" }, - "fakeTokenWarning": { - "message": "既存のトークンの偽のバージョンの作成を含め、誰でもトークンを作成できます。$1に関する詳細をご覧ください" - }, "fast": { "message": "高速" }, @@ -1277,6 +1289,9 @@ "functionApprove": { "message": "機能: 承認" }, + "functionSetApprovalForAll": { + "message": "関数: SetApprovalForAll" + }, "functionType": { "message": "機能の種類" }, @@ -1463,7 +1478,7 @@ }, "highGasSettingToolTipMessage": { "message": "人気のNFTドロップなどによるネットワークトラフィックの急増に備えるため、$1を使用してください。", - "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold font-weight" }, "highLowercase": { "message": "高" @@ -1617,6 +1632,9 @@ "invalidSeedPhrase": { "message": "無効なシークレットリカバリーフレーズ" }, + "invalidSeedPhraseCaseSensitive": { + "message": "入力値が無効です!秘密のリカバリーフレーズは大文字・小文字が区別されます。" + }, "ipfsGateway": { "message": "IPFSゲートウェイ" }, @@ -1766,7 +1784,7 @@ }, "lowGasSettingToolTipMessage": { "message": "値下がりを待つには$1を使用してください。価格がやや予測不能なため、予想時間はあまり正確ではありません。", - "description": "$1 is key 'low' separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'low' separated here so that it can be passed in with bold font-weight" }, "lowLowercase": { "message": "低" @@ -1810,7 +1828,7 @@ }, "mediumGasSettingToolTipMessage": { "message": "現在の市場価格での迅速な処理には、$1を使用してください。", - "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold font-weight" }, "memo": { "message": "メモ" @@ -1892,6 +1910,19 @@ "message": "ネットワークの詳細の確認", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." }, + "mismatchedChainRecommendation": { + "message": "先に進む前に$1をお勧めします。", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key. The link will open to instructions for users to validate custom network details." + }, + "mismatchedNetworkName": { + "message": "弊社の記録によると、ネットワーク名がこのチェーン ID と正しく一致していない可能性があります。" + }, + "mismatchedNetworkSymbol": { + "message": "送信された通貨記号がこのチェーン ID に関して予想されるものと一致していません。" + }, + "mismatchedRpcUrl": { + "message": "弊社の記録によると、送信された RPC URL の値がこのチェーン ID の既知のプロバイダーと一致しません。" + }, "missingNFT": { "message": "NFTが見当たりませんか?" }, @@ -1943,6 +1974,9 @@ "network": { "message": "ネットワーク:" }, + "networkAddedSuccessfully": { + "message": "ネットワークが追加されました!" + }, "networkDetails": { "message": "ネットワークの詳細" }, @@ -2059,6 +2093,9 @@ "message": "ナンスが提案され$1よりも大きいです", "description": "The next nonce according to MetaMask's internal logic" }, + "nft": { + "message": "NFT" + }, "nftTokenIdPlaceholder": { "message": "コレクティブルIDを入力してください" }, @@ -2130,7 +2167,7 @@ }, "notifications10ActionText": { "message": "設定に移動", - "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." + "description": "The 'call to action' on the button, or link, of the 'Visit in Settings' notification. Upon clicking, users will be taken to Settings page." }, "notifications10DescriptionOne": { "message": "改善されたトークン検出は、現在 Ethereum Mainnet、Polygon、BSC、Avalanche ネットワークで利用できます。他のネットワークも追加される予定です!" @@ -2154,11 +2191,21 @@ "message": "ダークモードを有効にする" }, "notifications12Description": { - "message": "新規ユーザーの場合、システム設定に従ってダークモードが有効になります。既存のユーザーは、設定 -> 実験的機能で、ダークモードを手動で有効にできます。" + "message": "拡張機能のダークモードがついに追加されました!オンにするには、設定 - 実験的機能の順に移動し、ライト、ダーク、システムの表示オプションから一つを選択してください。" }, "notifications12Title": { "message": "いつダークモードに?今ダークモードです!🕶️🦊" }, + "notifications13ActionText": { + "message": "カスタムネットワークリストを表示" + }, + "notifications13Description": { + "message": "人気のカスタムネットワーク(Arbitrum、Avalanche、Binance Smart Chain、Fantom、Harmony、Optimism、Palm、Polygon)が簡単に追加できるようになりました!この機能を有効にするには、設定 -> 実験的機能に移動し、「カスタムネットワークリストを表示」をオンにしてください!", + "description": "Description of a notification in the 'See What's New' popup. Describes popular network feature." + }, + "notifications13Title": { + "message": "人気のネットワークを追加" + }, "notifications1Description": { "message": "MetaMask Mobileのユーザーが、モバイルウォレット内でトークンを交換できるようになりました。QRコードをスキャンしてモバイルアプリを取得し、スワップを開始します。", "description": "Description of a notification in the 'See What's New' popup. Describes the swapping on mobile feature." @@ -2225,7 +2272,7 @@ }, "notifications8ActionText": { "message": "高度な設定に移動", - "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced Settings page." + "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced settings page." }, "notifications8DescriptionOne": { "message": "MetaMask v10.4.0以降では、LedgerデバイスのMetaMaskへの接続にLedger Liveが不要になりました。", @@ -2261,10 +2308,6 @@ "notificationsMarkAllAsRead": { "message": "すべて既読にする" }, - "numberOfNewTokensDetected": { - "message": "$1 の新しいトークンがこのアカウントで見つかりました", - "description": "$1 is the number of new tokens detected" - }, "ofTextNofM": { "message": "中の" }, @@ -2344,9 +2387,6 @@ "message": "WebHIDでLedgerを接続するには、MetaMaskを全画面モードで開いてください。", "description": "Shown to the user on the confirm screen when they are viewing MetaMask in a popup window but need to connect their ledger via webhid." }, - "openSourceCode": { - "message": "ソースコードを確認" - }, "optional": { "message": "任意" }, @@ -2473,7 +2513,7 @@ }, "preferredLedgerConnectionType": { "message": "優先Ledger接続タイプ", - "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" + "description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message" }, "preparingSwap": { "message": "スワップを準備しています..." @@ -2676,6 +2716,14 @@ "revealTheSeedPhrase": { "message": "シードフレーズを表示" }, + "revokeAllTokensTitle": { + "message": "すべての $1 へのアクセス許可を取り消しますか?", + "description": "$1 is the symbol of the token for which the user is revoking approval" + }, + "revokeApproveForAllDescription": { + "message": "アクセス許可を取り消すと、次の $1 が今後 $2 にアクセスできなくなります", + "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" + }, "rinkeby": { "message": "Rinkebyテストネットワーク" }, @@ -2852,12 +2900,23 @@ "message": "$1を送信中", "description": "$1 represents the native currency symbol for the current network (e.g. ETH or BNB)" }, + "sendingToTokenContractWarning": { + "message": "警告: 資金の喪失に繋がる可能性のあるトークンコントラクトに送信しようとしています。$1", + "description": "$1 is a clickable link with text defined by the 'learnMoreUpperCase' key. The link will open to a support article regarding the known contract address warning" + }, "setAdvancedPrivacySettings": { "message": "高度なプライバシー設定を設定" }, "setAdvancedPrivacySettingsDetails": { "message": "MetaMaskはこれらの信頼できるサードパーティーサービスを使用して、製品の使いやすさと安全性を向上させています。" }, + "setApprovalForAll": { + "message": "すべてを承認に設定" + }, + "setApprovalForAllTitle": { + "message": "使用限度額なしで $1 を承認", + "description": "The token symbol that is being approved" + }, "settings": { "message": "設定" }, @@ -2877,6 +2936,12 @@ "showAdvancedGasInlineDescription": { "message": "これを選択すると、ガス代と限度額のコントロールが送金画面と確認画面に直接表示されます。" }, + "showCustomNetworkList": { + "message": "カスタムネットワークリストを表示" + }, + "showCustomNetworkListDescription": { + "message": "新規ネットワークの追加時に事前に情報が入力済みのネットワークのリストを表示するには、これを選択します。" + }, "showFiatConversionInTestnets": { "message": "テストネット上に変換を表示" }, @@ -2967,10 +3032,6 @@ "snapInstallWarningCheck": { "message": "理解したことを確認するために、すべての項目にチェックを入れてください。" }, - "snapInstallWarningKeyAccess": { - "message": "スナップ「$1」に重要なアクセス権を付与しようとしています。これは取り消し不可能で、「$1」によるアカウントとアセットのコントロールが可能になります。続行する前に、「$1」が信頼できることを確認してください。", - "description": "The parameter is the name of the snap" - }, "snapRequestsPermission": { "message": "このスナップが次のパーミッションをリクエストしています:" }, @@ -2986,6 +3047,9 @@ "snapsToggle": { "message": "スナップは有効になっている場合にのみ実行されます" }, + "someNetworksMayPoseSecurity": { + "message": "ネットワークによっては、セキュリティやプライバシーの面でリスクが伴う可能性があります。ネットワークを追加・使用する前にリスクを理解するようにしてください。" + }, "somethingWentWrong": { "message": "申し訳ありません。問題が発生しました。" }, @@ -3548,6 +3612,10 @@ "switchNetworks": { "message": "ネットワークを切り替える" }, + "switchToNetwork": { + "message": "$1 に切り替える", + "description": "$1 represents the custom network that has previously been added" + }, "switchToThisAccount": { "message": "このアカウントに切り替える" }, @@ -3635,7 +3703,7 @@ }, "toggleTestNetworks": { "message": "$1テストネットワーク", - "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open to the advanced settings where users can enable the display of test networks in the network dropdown." + "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open Settings > Advanced where users can enable the display of test networks in the network dropdown." }, "token": { "message": "トークン" @@ -3664,12 +3732,6 @@ "tokenDetectionAlertMessage": { "message": "トークン検出は現在 $1 で利用可能です。$2" }, - "tokenDetectionAnnouncement": { - "message": "新機能! 実験的な機能として、Ethereum Mainnetでのトークン検出が改善されました。$1" - }, - "tokenDetectionToggleDescription": { - "message": "ConsenSys のトークン API は、さまざまなサードパーティのトークンリストからトークンのリストを集積します。これをオフにすると、ウォレットに追加された新しいトークンは検出されなくなりますが、引き続きトークンを検索してインポートすることは可能です。" - }, "tokenId": { "message": "トークン ID" }, @@ -3851,6 +3913,9 @@ "unknownCameraErrorTitle": { "message": "申し訳ありません。問題が発生しました..." }, + "unknownCollection": { + "message": "無名のコレクション" + }, "unknownNetwork": { "message": "不明なプライベートネットワーク" }, @@ -3901,12 +3966,6 @@ "usePhishingDetectionDescription": { "message": "イーサリアムユーザーを対象としたドメインのフィッシングに対して警告を表示します" }, - "useTokenDetection": { - "message": "トークン検出を使用" - }, - "useTokenDetectionDescription": { - "message": "弊社はユーザーのウォレットに送信された新しいトークンを検出して表示するために、サードパーティーAPIを使用します。MetaMaskにこれらのサービスからデータを取得させたくない場合は、この機能をオフにしてください。" - }, "useTokenDetectionPrivacyDesc": { "message": "アカウントに送られたトークンを自動的に表示するには、サードパーティーサーバーと通信し、トークンの画像を取得する必要があります。これらのサーバーはユーザーの IP アドレスにアクセスできます。" }, @@ -3962,7 +4021,7 @@ "description": "$1 is the action type. e.g (Account, Transaction, Swap)" }, "visitWebSite": { - "message": "弊社Webサイトにアクセス" + "message": "弊社 Web サイトにアクセス" }, "walletConnectionGuide": { "message": "弊社のハードウェアウォレット接続ガイド" @@ -3987,6 +4046,9 @@ "walletCreationSuccessTitle": { "message": "ウォレットが作成されました" }, + "wantToAddThisNetwork": { + "message": "このネットワークを追加しますか?" + }, "warning": { "message": "警告" }, @@ -4049,11 +4111,15 @@ "yesLetsTry": { "message": "はい、やってみます" }, + "youHaveAddedAll": { + "message": "すべての人気ネットワークを追加しました。$1で他のネットワークを発見するか、$2できます。", + "description": "$1 is a link with the text 'here' and $2 is a button with the text 'add more networks manually'" + }, "youNeedToAllowCameraAccess": { "message": "この機能を使用するには、カメラへのアクセスを許可する必要があります。" }, "youSign": { - "message": "署名しています" + "message": "著名しています" }, "yourPrivateSeedPhrase": { "message": "秘密のシークレットリカバリーフレーズ" diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index 8a5ba0a7b..c5e1cb03b 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -157,6 +157,9 @@ "addMemo": { "message": "메모 추가" }, + "addMoreNetworks": { + "message": "네트워크 직접 추가" + }, "addNetwork": { "message": "네트워크 추가" }, @@ -227,6 +230,10 @@ "alerts": { "message": "경고" }, + "allOfYour": { + "message": "내 $1 모두", + "description": "$1 is the symbol or name of the token that the user is approving spending" + }, "allowExternalExtensionTo": { "message": "이 외부 확장을 통해 다음을 허용:" }, @@ -263,6 +270,10 @@ "approve": { "message": "지출 한도 승인" }, + "approveAllTokensTitle": { + "message": "내 모든 $1에 액세스할 수 있는 권한을 부여할까요?", + "description": "$1 is the symbol of the token for which the user is granting approval" + }, "approveAndInstall": { "message": "승인 및 설치" }, @@ -282,9 +293,6 @@ "approvedAsset": { "message": "승인된 자산" }, - "areYouDeveloper": { - "message": "개발자이신가요?" - }, "areYouSure": { "message": "확실한가요?" }, @@ -438,7 +446,7 @@ "message": "Wyre로 $1 구매" }, "buyWithWyreDescription": { - "message": "Wyre를 사용하면 체크카드를 이용하여 $1 를 MetaMask 계정에 바로 예치할 수 있습니다." + "message": "최대 $ 1000 구매까지 간편한 온보딩. 신속한 대화형 상한 구매 확인. 직불/신용 카드, Apple Pay, 은행 송금 지원. 100여국 이상에서 사용 가능. MetaMask 계정으로 토큰 입금" }, "bytes": { "message": "바이트" @@ -466,6 +474,13 @@ "message": "거래를 $1하려면 가스비를 최소 10%를 인상해야 네트워크에서 인식될 수 있습니다.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwapForFee": { + "message": "~$1 비용으로 스왑 취소", + "description": "$1 could be e.g. $2.98, it is a cost for cancelling a Smart Transaction" + }, + "cancelSwapForFree": { + "message": "무료로 스왑 취소" + }, "cancellationGasFee": { "message": "가스 수수료 취소" }, @@ -732,7 +747,7 @@ }, "customGasSettingToolTipMessage": { "message": "$1을(를) 사용하여 가스 가격을 맞춤설정하세요. 익숙하지 않은 경우 혼동될 수 있습니다. 자신의 책임하에 상호 작용하세요.", - "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold font-weight" }, "customGasSubTitle": { "message": "수수료를 올리면 처리 시간이 단축되기도 하지만 항상 그렇지는 않습니다." @@ -818,7 +833,7 @@ }, "depositCrypto": { "message": "$1 입금", - "description": "$1 represents the cypto symbol to be purchased" + "description": "$1 represents the crypto symbol to be purchased" }, "description": { "message": "설명" @@ -1196,9 +1211,6 @@ "failureMessage": { "message": "문제가 발생했습니다. 작업을 완료할 수 없습니다." }, - "fakeTokenWarning": { - "message": "기존 토큰의 가짜 버전 생성을 포함하여 누구나 토큰을 생성할 수 있습니다. $1에 대해 자세히 알아보기" - }, "fast": { "message": "빠름" }, @@ -1277,6 +1289,9 @@ "functionApprove": { "message": "기능: 승인" }, + "functionSetApprovalForAll": { + "message": "기능: 모두승인설정" + }, "functionType": { "message": "기능 유형" }, @@ -1463,7 +1478,7 @@ }, "highGasSettingToolTipMessage": { "message": "인기 있는 NFT의 하락 등으로 인한 네트워크 트래픽 급증을 커버하려면 $1을 사용하세요.", - "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold font-weight" }, "highLowercase": { "message": "높음" @@ -1617,6 +1632,9 @@ "invalidSeedPhrase": { "message": "잘못된 비밀 복구 구문" }, + "invalidSeedPhraseCaseSensitive": { + "message": "입력 오류! 비밀 복구 구문은 대소문자를 구분해야 합니다." + }, "ipfsGateway": { "message": "IPFS 게이트웨이" }, @@ -1766,7 +1784,7 @@ }, "lowGasSettingToolTipMessage": { "message": "$1 사용을 통해 더 저렴한 가격을 기다리세요. 가격 예측이 힘들기 때문에 시간 추정은 더욱 부정확합니다.", - "description": "$1 is key 'low' separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'low' separated here so that it can be passed in with bold font-weight" }, "lowLowercase": { "message": "낮음" @@ -1810,7 +1828,7 @@ }, "mediumGasSettingToolTipMessage": { "message": "현재 시장 가격으로 빠르게 처리할 수 있도록 $1을(를) 사용하세요.", - "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold font-weight" }, "memo": { "message": "메모" @@ -1892,6 +1910,19 @@ "message": "네트워크 세부 정보 검증", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." }, + "mismatchedChainRecommendation": { + "message": "계속 진행하기 전에 $1 확인을 권합니다.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key. The link will open to instructions for users to validate custom network details." + }, + "mismatchedNetworkName": { + "message": "기록에 따르면 네트워크 이름이 이 체인 ID와 일치하지 않는 것 같습니다." + }, + "mismatchedNetworkSymbol": { + "message": "제출하신 환율 기호가 이 체인 ID의 환율과 일치하지 않습니다." + }, + "mismatchedRpcUrl": { + "message": "기록에 따르면 제출하신 RPC URL 값이 이 체인 ID에 대해 알려진 공급업체와 일치하지 않습니다." + }, "missingNFT": { "message": "NFT가 보이지 않나요?" }, @@ -1943,6 +1974,9 @@ "network": { "message": "네트워크:" }, + "networkAddedSuccessfully": { + "message": "성공적으로 네트워크를 추가했습니다!" + }, "networkDetails": { "message": "네트워크 세부 정보" }, @@ -2059,6 +2093,9 @@ "message": "임시값이 권장 임시값인 $1보다 큽니다.", "description": "The next nonce according to MetaMask's internal logic" }, + "nft": { + "message": "NFT\n" + }, "nftTokenIdPlaceholder": { "message": "수집 가능한 ID를 입력하세요." }, @@ -2130,7 +2167,7 @@ }, "notifications10ActionText": { "message": "설정으로 이동하기", - "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." + "description": "The 'call to action' on the button, or link, of the 'Visit in Settings' notification. Upon clicking, users will be taken to Settings page." }, "notifications10DescriptionOne": { "message": "향상된 토큰 감지 기능을 현재 이더리움 메인넷과 Polygon, BSC, Avalanche 네트워크에서 이용할 수 있습니다. 더 많은 기능이 준비 중입니다!" @@ -2154,11 +2191,21 @@ "message": "다크모드 활성화" }, "notifications12Description": { - "message": "신규 사용자의 경우 시스템 설정에 따라 다크모드가 활성화됩니다. 기존의 사용자는 설정 -> 실험에서 직접 다크 모드를 활성화해야 합니다." + "message": "다크모드가 마침내 활성화되었습니다! 설정(Settings) -> 시험 기능(Experimental)으로 이동하여 라이트, 다크, 시스템 중 선택하세요." }, "notifications12Title": { "message": "다크모드를 원하세요? 이제 다크모드를 사용하세요! 🕶️🦊" }, + "notifications13ActionText": { + "message": "사용자 정의 네트워크 목록 보기" + }, + "notifications13Description": { + "message": "이제 Arbitrum, Avalanche, Binance Smart Chain, Fantom, Harmony, Optimism, Palm 및 Polygon과 같은 인기 있는 사용자 정의 네트워크를 쉽게 추가할 수 있습니다! 이 기능을 활성화하려면 설정 -> 실험으로 이동하여 \"사용자 지정 네트워크 목록 표시\"를 켜세요!", + "description": "Description of a notification in the 'See What's New' popup. Describes popular network feature." + }, + "notifications13Title": { + "message": "인기 네트워크 추가" + }, "notifications1Description": { "message": "MetaMask 모바일 사용자는 이제 모바일 지갑에서 토큰을 스왑할 수 있습니다. QR 코드를 스캔하여 모바일 앱을 설치하고 스왑을 시작하세요.", "description": "Description of a notification in the 'See What's New' popup. Describes the swapping on mobile feature." @@ -2225,7 +2272,7 @@ }, "notifications8ActionText": { "message": "고급 설정으로 이동하기", - "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced Settings page." + "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced settings page." }, "notifications8DescriptionOne": { "message": "MetaMask v10.4.0부터는 Ledger 장치를 MetaMask에 연결할 때 더 이상 Ledger Live를 사용하지 않아도 됩니다.", @@ -2261,10 +2308,6 @@ "notificationsMarkAllAsRead": { "message": "모두 읽음으로 표시" }, - "numberOfNewTokensDetected": { - "message": "계정에서 $1개의 새로운 토큰이 발견됨", - "description": "$1 is the number of new tokens detected" - }, "ofTextNofM": { "message": "/" }, @@ -2344,9 +2387,6 @@ "message": "전체 화면에서 MetaMask를 열어 WebHID를 통해 Ledger를 연결합니다.", "description": "Shown to the user on the confirm screen when they are viewing MetaMask in a popup window but need to connect their ledger via webhid." }, - "openSourceCode": { - "message": "소스 코드를 확인하세요" - }, "optional": { "message": "옵션" }, @@ -2473,7 +2513,7 @@ }, "preferredLedgerConnectionType": { "message": "선호하는 Ledger 연결 유형", - "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" + "description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message" }, "preparingSwap": { "message": "스왑 준비 중..." @@ -2676,6 +2716,14 @@ "revealTheSeedPhrase": { "message": "시드 구문 보기" }, + "revokeAllTokensTitle": { + "message": "내 모든 $1에 액세스할 수 있는 권한을 취소할까요?", + "description": "$1 is the symbol of the token for which the user is revoking approval" + }, + "revokeApproveForAllDescription": { + "message": "권한을 취소하면 다음 $1의 $2 권한은 더 이상 유효하지 않습니다", + "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" + }, "rinkeby": { "message": "Rinkeby 테스트 네트워크" }, @@ -2852,12 +2900,23 @@ "message": "$1 보내기", "description": "$1 represents the native currency symbol for the current network (e.g. ETH or BNB)" }, + "sendingToTokenContractWarning": { + "message": "경고: 토큰 주소를 전송하면 토큰이 손실될 수 있습니다. $1", + "description": "$1 is a clickable link with text defined by the 'learnMoreUpperCase' key. The link will open to a support article regarding the known contract address warning" + }, "setAdvancedPrivacySettings": { "message": "개인정보 설정 고급 지정" }, "setAdvancedPrivacySettingsDetails": { "message": "이와 같이 MetaMask는 신용있는 타사의 서비스를 사용하여 제품 가용성과 안전성을 향상합니다." }, + "setApprovalForAll": { + "message": "모두 승인 설정" + }, + "setApprovalForAllTitle": { + "message": "$1 무제한 지출 승인", + "description": "The token symbol that is being approved" + }, "settings": { "message": "설정" }, @@ -2877,6 +2936,12 @@ "showAdvancedGasInlineDescription": { "message": "이 항목을 선택하면 보내기 및 확인 화면에서 바로 가스 가격과 한도 조절을 확인할 수 있습니다." }, + "showCustomNetworkList": { + "message": "사용자 정의 네트워크 보기" + }, + "showCustomNetworkListDescription": { + "message": "이를 선택하면 새로 네트워크를 추가할 때 네트워크 목록에 상세 설명이 함께 나타납니다." + }, "showFiatConversionInTestnets": { "message": "테스트넷에 전환 표시" }, @@ -2967,10 +3032,6 @@ "snapInstallWarningCheck": { "message": "이해하셨으면 모두 체크해 주세요." }, - "snapInstallWarningKeyAccess": { - "message": "'$1' 스냅 이용에 필요한 키 액세스 권한을 부여하고 있습니다. 이 작업은 사용자의 계정과 자산에 '$1' 제어 권한을 부여하며 취소가 불가능합니다. '$1의 신뢰성을 확인한 후에 진행하세요.", - "description": "The parameter is the name of the snap" - }, "snapRequestsPermission": { "message": "이 스냅이 다음 권한을 요청하고 있습니다." }, @@ -2986,6 +3047,9 @@ "snapsToggle": { "message": "스냅은 활성화된 상태에서만 작동합니다." }, + "someNetworksMayPoseSecurity": { + "message": "네트워크에 따라 보안이나 개인 정보 유출의 위험이 있을 수 있습니다. 네트워크 추가 및 사용 이전에 위험 요소를 파악하세요." + }, "somethingWentWrong": { "message": "죄송합니다! 문제가 생겼습니다." }, @@ -3548,6 +3612,10 @@ "switchNetworks": { "message": "네트워크 전환" }, + "switchToNetwork": { + "message": "$1 네트워크로 전환", + "description": "$1 represents the custom network that has previously been added" + }, "switchToThisAccount": { "message": "이 계정으로 전환" }, @@ -3635,7 +3703,7 @@ }, "toggleTestNetworks": { "message": "$1 테스트 네트워크", - "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open to the advanced settings where users can enable the display of test networks in the network dropdown." + "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open Settings > Advanced where users can enable the display of test networks in the network dropdown." }, "token": { "message": "토큰" @@ -3664,12 +3732,6 @@ "tokenDetectionAlertMessage": { "message": "토큰 감지 기능은 현재 $1. $2에서 사용할 수 있습니다." }, - "tokenDetectionAnnouncement": { - "message": "신규! 개선된 토큰 감지는 실험적 기능으로 이더리움 메인넷에서 사용할 수 있습니다. $1" - }, - "tokenDetectionToggleDescription": { - "message": "ConsenSys의 토큰 API는 타사의 다양한 목록을 모아 하나의 토큰 목록을 작성합니다. 이 API를 끄면 신규 토큰을 감지해서 지갑에 추가하는 기능은 중단되지만 토큰을 검색해서 가져오는 기능은 계속 사용할 수 있습니다." - }, "tokenId": { "message": "토큰 ID" }, @@ -3851,6 +3913,9 @@ "unknownCameraErrorTitle": { "message": "죄송합니다! 문제가 생겼습니다...." }, + "unknownCollection": { + "message": "제목 미지정 콜렉션" + }, "unknownNetwork": { "message": "알 수 없는 비공개 네트워크" }, @@ -3901,12 +3966,6 @@ "usePhishingDetectionDescription": { "message": "이더리움 사용자를 노리는 피싱 도메인에 대한 경고를 표시합니다" }, - "useTokenDetection": { - "message": "토큰 감지 사용" - }, - "useTokenDetectionDescription": { - "message": "당사는 타사 API를 사용하여 지갑으로 전송된 새 토큰을 감지하고 표시합니다. MetaMask가 해당 서비스에서 데이터를 가져오는 것을 원하지 않으면 이 기능을 사용하지 마세요." - }, "useTokenDetectionPrivacyDesc": { "message": "계정으로 전송된 토큰이 자동으로 표시되도록 하려면 타사 서버와의 통신을 통해 토큰 이미지를 불러와야 합니다. 이를 위해 타사 서버는 사용자의 IP 주소에 액세스하게 됩니다." }, @@ -3962,7 +4021,7 @@ "description": "$1 is the action type. e.g (Account, Transaction, Swap)" }, "visitWebSite": { - "message": "당사 웹사이트 방문하기" + "message": "웹사이트를 방문하세요" }, "walletConnectionGuide": { "message": "당사의 하드웨어 지갑 연결 가이드" @@ -3987,6 +4046,9 @@ "walletCreationSuccessTitle": { "message": "지갑 생성 성공" }, + "wantToAddThisNetwork": { + "message": "이 네트워크를 추가할까요?" + }, "warning": { "message": "경고" }, @@ -4049,6 +4111,10 @@ "yesLetsTry": { "message": "예, 시도하겠습니다." }, + "youHaveAddedAll": { + "message": "모든 인기 네트워크를 추가했습니다. $1에서 더 많은 네트워크를 확인하거나 $2 할 수 있습니다.", + "description": "$1 is a link with the text 'here' and $2 is a button with the text 'add more networks manually'" + }, "youNeedToAllowCameraAccess": { "message": "이 기능을 사용하려면 카메라 액세스를 허용해야 합니다." }, diff --git a/app/_locales/ph/messages.json b/app/_locales/ph/messages.json index 9d64198d3..af0a3c7a6 100644 --- a/app/_locales/ph/messages.json +++ b/app/_locales/ph/messages.json @@ -2216,7 +2216,7 @@ "message": "Welcome sa MetaMask" }, "welcomeBack": { - "message": "Welcome Back!" + "message": "Welcome back!" }, "whatsNew": { "message": "Ano'ng bago", diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index b8b40ee7a..3e6e965b2 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -157,6 +157,9 @@ "addMemo": { "message": "Adicionar observação" }, + "addMoreNetworks": { + "message": "adicionar mais redes manualmente" + }, "addNetwork": { "message": "Adicionar rede" }, @@ -227,6 +230,10 @@ "alerts": { "message": "Alertas" }, + "allOfYour": { + "message": "Todos os seus $1", + "description": "$1 is the symbol or name of the token that the user is approving spending" + }, "allowExternalExtensionTo": { "message": "Permitir que essa extensão externa:" }, @@ -263,6 +270,10 @@ "approve": { "message": "Aprovar" }, + "approveAllTokensTitle": { + "message": "Dar permissão para acessar todos os seus $1?", + "description": "$1 is the symbol of the token for which the user is granting approval" + }, "approveAndInstall": { "message": "Aprovar e instalar" }, @@ -282,9 +293,6 @@ "approvedAsset": { "message": "Ativo aprovado" }, - "areYouDeveloper": { - "message": "Você é desenvolvedor?" - }, "areYouSure": { "message": "Tem certeza?" }, @@ -435,10 +443,10 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "Comprar $1 com Wyre" + "message": "Comprar $1 com o Wyre" }, "buyWithWyreDescription": { - "message": "Com o Wyre, você pode usar um cartão de débito para depositar $1 diretamente na sua conta da MetaMask." + "message": "Integração fácil para compras de até US$ 1.000. Verificação de compra de alto limite rápida e interativa. Aceita cartão de crédito/débito, Apple Pay, transferências bancárias. Disponível em mais de 100 países. Depósito de tokens em sua conta na MetaMask" }, "bytes": { "message": "Bytes" @@ -466,6 +474,13 @@ "message": "Para $1 uma transação, a taxa de gás deve ser aumentada em pelo menos 10% para que seja reconhecida pela rede.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwapForFee": { + "message": "Cancelar swap por ~$1", + "description": "$1 could be e.g. $2.98, it is a cost for cancelling a Smart Transaction" + }, + "cancelSwapForFree": { + "message": "Cancelar swap gratuitamente" + }, "cancellationGasFee": { "message": "Taxa de gás por cancelamento" }, @@ -650,7 +665,7 @@ "message": "Interação com contrato" }, "convertTokenToNFTDescription": { - "message": "Detectamos que esse ativo é um NFT. A MetaMask agora oferece suporte nativo a NFTs. Gostaria de removê-lo da sua lista de tokens e adicioná-lo como NFT?" + "message": "Detectamos que esse ativo é um NFT. A MetaMask agora oferece suporte nativo a NFTs. Gostaria de removê-lo de sua lista de tokens e adicioná-lo como NFT?" }, "convertTokenToNFTExistDescription": { "message": "Detectamos que esse ativo foi adicionado como NFT. Deseja removê-lo da sua lista de tokens?" @@ -732,7 +747,7 @@ }, "customGasSettingToolTipMessage": { "message": "Use $1 para personalizar o preço do gás. Isso pode parecer confuso se você não estiver familiarizado. Interaja por sua conta e risco.", - "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold font-weight" }, "customGasSubTitle": { "message": "Aumentar a taxa pode diminuir o tempo de processamento, mas isso não é garantido." @@ -818,7 +833,7 @@ }, "depositCrypto": { "message": "Depositar $1", - "description": "$1 represents the cypto symbol to be purchased" + "description": "$1 represents the crypto symbol to be purchased" }, "description": { "message": "Descrição" @@ -1196,9 +1211,6 @@ "failureMessage": { "message": "Ocorreu algum erro e não conseguimos concluir a ação" }, - "fakeTokenWarning": { - "message": "Qualquer um pode criar um token, incluindo versões falsas de tokens existentes. Saiba mais sobre $1" - }, "fast": { "message": "Rápido" }, @@ -1277,6 +1289,9 @@ "functionApprove": { "message": "Função: aprovar" }, + "functionSetApprovalForAll": { + "message": "Função: SetApprovalForAll" + }, "functionType": { "message": "Tipo de função" }, @@ -1463,7 +1478,7 @@ }, "highGasSettingToolTipMessage": { "message": "Alta probabilidade, mesmo em mercados voláteis. Use $1 para cobrir picos no tráfego de rede em razão de coisas como quedas em NFTs populares.", - "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold font-weight" }, "highLowercase": { "message": "alta" @@ -1617,6 +1632,9 @@ "invalidSeedPhrase": { "message": "Frase Secreta de Recuperação inválida" }, + "invalidSeedPhraseCaseSensitive": { + "message": "Entrada inválida! A frase secreta de recuperação diferencia maiúsculas e minúsculas." + }, "ipfsGateway": { "message": "Gateway IPFS" }, @@ -1766,7 +1784,7 @@ }, "lowGasSettingToolTipMessage": { "message": "Use $1 para aguardar um preço mais baixo. As estimativas de tempo são muito menos exatas, pois os preços são relativamente imprevisíveis.", - "description": "$1 is key 'low' separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'low' separated here so that it can be passed in with bold font-weight" }, "lowLowercase": { "message": "baixa" @@ -1810,7 +1828,7 @@ }, "mediumGasSettingToolTipMessage": { "message": "Use $1 para um processamento rápido pelo preço atual de mercado.", - "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold font-weight" }, "memo": { "message": "memorando" @@ -1892,6 +1910,19 @@ "message": "verifique os detalhes da rede", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." }, + "mismatchedChainRecommendation": { + "message": "Recomendamos que você $1 antes de prosseguir.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key. The link will open to instructions for users to validate custom network details." + }, + "mismatchedNetworkName": { + "message": "De acordo com os nossos registros, o nome da rede pode não corresponder à ID desta cadeia." + }, + "mismatchedNetworkSymbol": { + "message": "O símbolo de moeda enviado não corresponde ao esperado para a ID desta cadeia." + }, + "mismatchedRpcUrl": { + "message": "De acordo com os nossos registros, o valor da URL da RPC enviado não corresponde a um provedor conhecido da ID desta cadeia." + }, "missingNFT": { "message": "Não está vendo o seu NFT?" }, @@ -1943,6 +1974,9 @@ "network": { "message": "Ethereum:" }, + "networkAddedSuccessfully": { + "message": "Rede adicionada com sucesso!" + }, "networkDetails": { "message": "Detalhes da rede" }, @@ -2059,6 +2093,9 @@ "message": "Nonce é maior que o nonce sugerido de $1", "description": "The next nonce according to MetaMask's internal logic" }, + "nft": { + "message": "NFT" + }, "nftTokenIdPlaceholder": { "message": "Insira o ID do token" }, @@ -2130,7 +2167,7 @@ }, "notifications10ActionText": { "message": "Veja em configurações", - "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." + "description": "The 'call to action' on the button, or link, of the 'Visit in Settings' notification. Upon clicking, users will be taken to Settings page." }, "notifications10DescriptionOne": { "message": "A detecção aperfeiçoada de tokens está atualmente disponível nas redes Ethereum Mainnet, Polygon, BSC e Avalanche. Há outras por vir!" @@ -2154,11 +2191,21 @@ "message": "Ativar o modo escuro" }, "notifications12Description": { - "message": "O Modo Escuro será ativado para novos usuários de acordo com suas preferências de sistema. Para usuários antigos, ative o Modo Escuro manualmente em Configurações -> Experimental." + "message": "O modo escuro na extensão finalmente chegou! Para ativá-lo, acesse Configurações -> Experimental e selecione uma das opções de exibição: claro, escuro, sistema." }, "notifications12Title": { "message": "Modo escuro quando? Modo escuro agora! 🕶️🦊" }, + "notifications13ActionText": { + "message": "Exibir lista de redes personalizadas" + }, + "notifications13Description": { + "message": "Agora você pode adicionar facilmente as seguintes redes personalizadas que são populares: Arbitrum, Avalanche, Binance Smart Chain, Fantom, Harmony, Optimism, Palm e Polygon. Para ativar esse recurso, acesse Configurações -> Experimentais e ative \"Exibir lista de redes personalizadas\".", + "description": "Description of a notification in the 'See What's New' popup. Describes popular network feature." + }, + "notifications13Title": { + "message": "Adicionar redes populares" + }, "notifications1Description": { "message": "Usuários da MetaMask Mobile agora podem trocar tokens dentro de sua carteira mobile. Leia o QR code para obter o aplicativo para dispositivos móveis e comece a trocar.", "description": "Description of a notification in the 'See What's New' popup. Describes the swapping on mobile feature." @@ -2225,7 +2272,7 @@ }, "notifications8ActionText": { "message": "Ir para Configurações Avançadas", - "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced Settings page." + "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced settings page." }, "notifications8DescriptionOne": { "message": "A partir da MetaMask v10.4.0, não é mais necessário o Ledger Live para conectar o seu dispositivo Ledger à MetaMask.", @@ -2261,10 +2308,6 @@ "notificationsMarkAllAsRead": { "message": "Marcar todas como lidas" }, - "numberOfNewTokensDetected": { - "message": "$1 novos tokens encontrados nesta conta", - "description": "$1 is the number of new tokens detected" - }, "ofTextNofM": { "message": "de" }, @@ -2344,9 +2387,6 @@ "message": "Abra a MetaMask em tela cheia para conectar sua ledger por meio do WebHID.", "description": "Shown to the user on the confirm screen when they are viewing MetaMask in a popup window but need to connect their ledger via webhid." }, - "openSourceCode": { - "message": "Verifique o código-fonte" - }, "optional": { "message": "Opcional" }, @@ -2473,7 +2513,7 @@ }, "preferredLedgerConnectionType": { "message": "Tipo de conexão preferencial com o Ledger", - "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" + "description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message" }, "preparingSwap": { "message": "Preparando swap..." @@ -2676,6 +2716,14 @@ "revealTheSeedPhrase": { "message": "Revelar a frase de recuperação" }, + "revokeAllTokensTitle": { + "message": "Revogar permissão de acesso a todos os seus $1?", + "description": "$1 is the symbol of the token for which the user is revoking approval" + }, + "revokeApproveForAllDescription": { + "message": "Ao revogar a permissão, o $1 a seguir não terá mais acesso ao seu $2", + "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" + }, "rinkeby": { "message": "Rede de Teste Rinkeby" }, @@ -2852,12 +2900,23 @@ "message": "Enviando $1", "description": "$1 represents the native currency symbol for the current network (e.g. ETH or BNB)" }, + "sendingToTokenContractWarning": { + "message": "Aviso: você está prestes a enviar a um contrato de token que pode resultar em perda de fundos. $1", + "description": "$1 is a clickable link with text defined by the 'learnMoreUpperCase' key. The link will open to a support article regarding the known contract address warning" + }, "setAdvancedPrivacySettings": { "message": "Definir configurações avançadas de privacidade" }, "setAdvancedPrivacySettingsDetails": { "message": "A MetaMask utiliza esses serviços terceirizados de confiança para aumentar a usabilidade e a segurança dos produtos." }, + "setApprovalForAll": { + "message": "Definir aprovação para todos" + }, + "setApprovalForAllTitle": { + "message": "Aprovar $1 sem limite de gastos", + "description": "The token symbol that is being approved" + }, "settings": { "message": "Definições" }, @@ -2877,6 +2936,12 @@ "showAdvancedGasInlineDescription": { "message": "Selecione isso para mostrar o preço do gás e limitar os controles diretamente nas telas de envio e de confirmação." }, + "showCustomNetworkList": { + "message": "Exibir lista de redes personalizadas" + }, + "showCustomNetworkListDescription": { + "message": "Selecione esta opção para exibir uma lista de redes com as informações pré-preenchidas ao adicionar uma nova rede." + }, "showFiatConversionInTestnets": { "message": "Mostrar conversão nas redes de teste" }, @@ -2967,10 +3032,6 @@ "snapInstallWarningCheck": { "message": "Para confirmar que você entende, marque todas." }, - "snapInstallWarningKeyAccess": { - "message": "Você está concedendo ao snap \"$1\" acesso à sua chave. Isso é irrevogável e concede a \"$1\" controle sobre suas contas e ativos. Certifique-se de que confia em \"$1\" antes de prosseguir.", - "description": "The parameter is the name of the snap" - }, "snapRequestsPermission": { "message": "Esse snap está solicitando as seguintes permissões:" }, @@ -2986,6 +3047,9 @@ "snapsToggle": { "message": "O snap só será executado se estiver ativado" }, + "someNetworksMayPoseSecurity": { + "message": "Algumas redes podem representar riscos de segurança e/ou privacidade. Tenha os riscos em mente antes de adicionar e usar uma rede." + }, "somethingWentWrong": { "message": "Ops! Algo deu errado." }, @@ -3548,6 +3612,10 @@ "switchNetworks": { "message": "Trocar redes" }, + "switchToNetwork": { + "message": "Trocar para $1", + "description": "$1 represents the custom network that has previously been added" + }, "switchToThisAccount": { "message": "Trocar para esta conta" }, @@ -3635,7 +3703,7 @@ }, "toggleTestNetworks": { "message": "$1 redes de teste", - "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open to the advanced settings where users can enable the display of test networks in the network dropdown." + "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open Settings > Advanced where users can enable the display of test networks in the network dropdown." }, "token": { "message": "Token" @@ -3664,12 +3732,6 @@ "tokenDetectionAlertMessage": { "message": "A detecção de tokens está atualmente disponível em $1. $2" }, - "tokenDetectionAnnouncement": { - "message": "Novidade! A detecção aprimorada de token está disponível na Mainnet do Ethereum como uma funcionalidade experimental. $1" - }, - "tokenDetectionToggleDescription": { - "message": "A API de token da ConsenSys agrega uma lista de tokens de várias listas de tokens de terceiros. Se você desativá-la, não haverá detecção de novos tokens adicionados à sua carteira, mas continuará com a opção de procurar tokens para importar." - }, "tokenId": { "message": "ID do token" }, @@ -3851,6 +3913,9 @@ "unknownCameraErrorTitle": { "message": "Ops! Algo deu errado...." }, + "unknownCollection": { + "message": "Coleção sem nome" + }, "unknownNetwork": { "message": "Rede Privada Desconhecida" }, @@ -3901,12 +3966,6 @@ "usePhishingDetectionDescription": { "message": "Exibir uma advertência para os domínios de phishing destinados a usuários do Ethereum" }, - "useTokenDetection": { - "message": "Usar detecção de tokens" - }, - "useTokenDetectionDescription": { - "message": "Utilizamos APIs terceirizadas para detectar e exibir novos tokens enviados à sua carteira. Desative essa opção se não deseja que a MetaMask extraia dados desses serviços." - }, "useTokenDetectionPrivacyDesc": { "message": "A exibição automática de tokens enviados para a sua conta envolve a comunicação com servidores de terceiros para buscar as imagens dos tokens. Esses servidores terão acesso ao seu endereço IP." }, @@ -3962,7 +4021,7 @@ "description": "$1 is the action type. e.g (Account, Transaction, Swap)" }, "visitWebSite": { - "message": "Visite o nosso site" + "message": "Visite nosso site" }, "walletConnectionGuide": { "message": "nosso guia de conexão com a carteira de hardware" @@ -3987,6 +4046,9 @@ "walletCreationSuccessTitle": { "message": "Carteira criada com sucesso" }, + "wantToAddThisNetwork": { + "message": "Desejar adicionar esta rede?" + }, "warning": { "message": "Atenção" }, @@ -4049,6 +4111,10 @@ "yesLetsTry": { "message": "Sim, vamos tentar" }, + "youHaveAddedAll": { + "message": "Você adicionou todas as redes populares. Você pode descobrir mais redes $1 Ou você pode $2", + "description": "$1 is a link with the text 'here' and $2 is a button with the text 'add more networks manually'" + }, "youNeedToAllowCameraAccess": { "message": "Você precisa permitir o acesso à câmera para usar esse recurso." }, diff --git a/app/_locales/pt_BR/messages.json b/app/_locales/pt_BR/messages.json index 35a8c9b30..5b2c10459 100644 --- a/app/_locales/pt_BR/messages.json +++ b/app/_locales/pt_BR/messages.json @@ -1031,9 +1031,6 @@ "failureMessage": { "message": "Ocorreu algum erro e não conseguimos concluir a ação" }, - "fakeTokenWarning": { - "message": "Qualquer um pode criar um token, incluindo versões falsas de tokens existentes. Saiba mais sobre $1" - }, "fast": { "message": "Rápido" }, @@ -1517,7 +1514,7 @@ }, "lowGasSettingToolTipMessage": { "message": "Use $1 para aguardar um preço mais baixo. As estimativas de tempo são muito menos exatas, pois os preços são relativamente imprevisíveis.", - "description": "$1 is key 'low' separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'low' separated here so that it can be passed in with bold font-weight" }, "lowLowercase": { "message": "baixa" @@ -1549,7 +1546,7 @@ }, "mediumGasSettingToolTipMessage": { "message": "Use $1 para um processamento rápido pelo preço atual de mercado.", - "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold font-weight" }, "memo": { "message": "nota" @@ -1895,7 +1892,7 @@ }, "notifications8ActionText": { "message": "Ir para Configurações Avançadas", - "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced Settings page." + "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced settings page." }, "notifications8DescriptionOne": { "message": "A partir da MetaMask v10.4.0, não é mais necessário o Ledger Live para conectar o seu dispositivo Ledger à MetaMask.", @@ -2069,7 +2066,7 @@ }, "preferredLedgerConnectionType": { "message": "Tipo de conexão preferencial com o Ledger", - "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" + "description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message" }, "prev": { "message": "Anterior" @@ -2991,7 +2988,7 @@ }, "toggleTestNetworks": { "message": "$1 redes de teste", - "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open to the advanced settings where users can enable the display of test networks in the network dropdown." + "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open Settings > Advanced where users can enable the display of test networks in the network dropdown." }, "token": { "message": "Token" @@ -3005,9 +3002,6 @@ "tokenDecimalFetchFailed": { "message": "A casa decimal do token é necessária." }, - "tokenDetectionAnnouncement": { - "message": "Novidade! A detecção aprimorada de token está disponível na Mainnet do Ethereum como uma funcionalidade experimental. $1" - }, "tokenId": { "message": "ID do token" }, @@ -3220,12 +3214,6 @@ "usePhishingDetectionDescription": { "message": "Exibir uma advertência para os domínios de phishing destinados a usuários do Ethereum" }, - "useTokenDetection": { - "message": "Usar detecção de tokens" - }, - "useTokenDetectionDescription": { - "message": "Utilizamos APIs terceirizadas para detectar e exibir novos tokens enviados à sua carteira. Desative essa opção se não deseja que a MetaMask extraia dados desses serviços." - }, "usedByClients": { "message": "Usado por diversos clientes diferentes" }, diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index 16fa10c05..46090715e 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -157,6 +157,9 @@ "addMemo": { "message": "Добавить примечание" }, + "addMoreNetworks": { + "message": "добавить другие сети вручную" + }, "addNetwork": { "message": "Добавить сеть" }, @@ -227,6 +230,10 @@ "alerts": { "message": "Предупреждения" }, + "allOfYour": { + "message": "Все ваши $1", + "description": "$1 is the symbol or name of the token that the user is approving spending" + }, "allowExternalExtensionTo": { "message": "Разрешить этому внешнему расширению:" }, @@ -263,6 +270,10 @@ "approve": { "message": "Одобрить лимит расходов" }, + "approveAllTokensTitle": { + "message": "Разрешить доступ к всем вашим $1?", + "description": "$1 is the symbol of the token for which the user is granting approval" + }, "approveAndInstall": { "message": "Одобрить и установить" }, @@ -282,9 +293,6 @@ "approvedAsset": { "message": "Одобренный актив" }, - "areYouDeveloper": { - "message": "Вы разработчик?" - }, "areYouSure": { "message": "Вы уверены?" }, @@ -435,10 +443,10 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "Купить $1 с помощью Wyre" + "message": "Купить 1 $ с помощью Wyre" }, "buyWithWyreDescription": { - "message": "Wyre позволяет использовать дебетовую карту для внесения $1 прямо на ваш счет MetaMask." + "message": "Простая регистрация для покупок на сумму до 1000 $. Быстрая интерактивная проверка покупки с высоким лимитом. Поддерживает дебетовые/кредитные карты, Apple Pay, банковские переводы. Доступно в более чем 100 странах. Токены зачисляются на ваш счет MetaMask" }, "bytes": { "message": "Байты" @@ -466,6 +474,13 @@ "message": "Чтобы $1 транзакции плата за газ должна быть увеличена как минимум на 10%. Это позволит обеспечить прием транзакции сетью.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwapForFee": { + "message": "Отменить обмен на ~$1", + "description": "$1 could be e.g. $2.98, it is a cost for cancelling a Smart Transaction" + }, + "cancelSwapForFree": { + "message": "Отменить обмен бесплатно" + }, "cancellationGasFee": { "message": "Плата за газ при отмене" }, @@ -732,7 +747,7 @@ }, "customGasSettingToolTipMessage": { "message": "Использовать $1, чтобы настроить цену на газ. Это может сбивать с толку, если вы не знакомы с этим. Взаимодействуйте на свой страх и риск.", - "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold font-weight" }, "customGasSubTitle": { "message": "Увеличение комиссии может сократить время обработки, но это не гарантируется." @@ -818,7 +833,7 @@ }, "depositCrypto": { "message": "Внесите $1", - "description": "$1 represents the cypto symbol to be purchased" + "description": "$1 represents the crypto symbol to be purchased" }, "description": { "message": "Описание" @@ -1196,9 +1211,6 @@ "failureMessage": { "message": "Что-то пошло не так, и мы не смогли завершить действие" }, - "fakeTokenWarning": { - "message": "Кто угодно может создать токен, в том числе создать поддельные версии существующих токенов. Узнайте подробнее о $1" - }, "fast": { "message": "Быстрый" }, @@ -1277,6 +1289,9 @@ "functionApprove": { "message": "Функция: Одобрить" }, + "functionSetApprovalForAll": { + "message": "Функция: SetApprovalForAll" + }, "functionType": { "message": "Тип функции" }, @@ -1463,7 +1478,7 @@ }, "highGasSettingToolTipMessage": { "message": "Используйте $1, чтобы компенсировать скачки сетевого трафика из-за таких событий, как дропы популярных NFT.", - "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold font-weight" }, "highLowercase": { "message": "высокая" @@ -1617,6 +1632,9 @@ "invalidSeedPhrase": { "message": "Неверная секретная фраза для восстановления" }, + "invalidSeedPhraseCaseSensitive": { + "message": "Неправильный ввод! Секретная фраза для восстановления чувствительна к регистру." + }, "ipfsGateway": { "message": "Шлюз IPFS" }, @@ -1766,7 +1784,7 @@ }, "lowGasSettingToolTipMessage": { "message": "Используйте $1, чтобы дождаться более низкой цены. Оценки времени намного менее точны, поскольку цены в некоторой степени непредсказуемы.", - "description": "$1 is key 'low' separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'low' separated here so that it can be passed in with bold font-weight" }, "lowLowercase": { "message": "низкая" @@ -1810,7 +1828,7 @@ }, "mediumGasSettingToolTipMessage": { "message": "Используйте $1 для быстрой обработки по текущей рыночной цене.", - "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold font-weight" }, "memo": { "message": "заметка" @@ -1892,6 +1910,19 @@ "message": "проверить сведения о сети", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." }, + "mismatchedChainRecommendation": { + "message": "Мы рекомендуем вам $1, прежде чем продолжить.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key. The link will open to instructions for users to validate custom network details." + }, + "mismatchedNetworkName": { + "message": "Согласно нашим данным, имя сети может не соответствовать этому идентификатору блокчейна." + }, + "mismatchedNetworkSymbol": { + "message": "Представленный символ валюты не соответствует тому, что мы ожидаем для этого идентификатора блокчейна." + }, + "mismatchedRpcUrl": { + "message": "Согласно нашим записям, отправленное значение URL-адреса RPC не соответствует известному поставщику для этого идентификатора блокчейна." + }, "missingNFT": { "message": "Не видите свои NFT?" }, @@ -1943,6 +1974,9 @@ "network": { "message": "Сеть:" }, + "networkAddedSuccessfully": { + "message": "Сеть успешно добавлена!" + }, "networkDetails": { "message": "Сведения о сети" }, @@ -2059,6 +2093,9 @@ "message": "Одноразовый номер больше, чем предложенный одноразовый номер $1", "description": "The next nonce according to MetaMask's internal logic" }, + "nft": { + "message": "NFT" + }, "nftTokenIdPlaceholder": { "message": "Введите ид. коллекционного актива" }, @@ -2130,7 +2167,7 @@ }, "notifications10ActionText": { "message": "Смотреть в настройках", - "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." + "description": "The 'call to action' on the button, or link, of the 'Visit in Settings' notification. Upon clicking, users will be taken to Settings page." }, "notifications10DescriptionOne": { "message": "Улучшенное обнаружение токенов в настоящее время доступно в сетях Ethereum Mainnet, Polygon, BSC и Avalanche. Это еще не все!" @@ -2159,6 +2196,16 @@ "notifications12Title": { "message": "Когда появится темный режим? Он уже появился! ️" }, + "notifications13ActionText": { + "message": "Показать пользовательский список сетей" + }, + "notifications13Description": { + "message": "Теперь вы можете легко добавить следующие популярные пользовательские сети: Arbitrum, Avalanche, Binance Smart Chain, Fantom, Harmony, Optimism, Palm и Polygon! Чтобы включить эту функцию, перейдите в «Настройки» -> «Экспериментальная версия» и включите «Показать пользовательский список сетей»!", + "description": "Description of a notification in the 'See What's New' popup. Describes popular network feature." + }, + "notifications13Title": { + "message": "Добавить популярные сети" + }, "notifications1Description": { "message": "Теперь пользователи MetaMask Mobile могут обменивать токены в своем мобильном кошельке. Отсканируйте QR-код, чтобы скачать мобильное приложение и начать обмен.", "description": "Description of a notification in the 'See What's New' popup. Describes the swapping on mobile feature." @@ -2225,7 +2272,7 @@ }, "notifications8ActionText": { "message": "Перейти в Дополнительные настройки", - "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced Settings page." + "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced settings page." }, "notifications8DescriptionOne": { "message": "Начиная с версии MetaMask 10.4.0, вам больше не требуется Ledger Live для подключения леджера к MetaMask.", @@ -2261,10 +2308,6 @@ "notificationsMarkAllAsRead": { "message": "Отметить все как прочитанные" }, - "numberOfNewTokensDetected": { - "message": "$1 новых токена(-ов) найдены в этом аккаунте", - "description": "$1 is the number of new tokens detected" - }, "ofTextNofM": { "message": "из" }, @@ -2344,9 +2387,6 @@ "message": "Откройте MetaMask в полноэкранном режиме, чтобы подключить свой леджер через WebHID.", "description": "Shown to the user on the confirm screen when they are viewing MetaMask in a popup window but need to connect their ledger via webhid." }, - "openSourceCode": { - "message": "Проверьте исходный код" - }, "optional": { "message": "Необязательно" }, @@ -2473,7 +2513,7 @@ }, "preferredLedgerConnectionType": { "message": "Предпочтительный тип подключения к леджеру", - "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" + "description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message" }, "preparingSwap": { "message": "Подготовка обмена..." @@ -2676,6 +2716,14 @@ "revealTheSeedPhrase": { "message": "Показать сид-фразу" }, + "revokeAllTokensTitle": { + "message": "Отозвать разрешение на доступ ко всем вашим $1?", + "description": "$1 is the symbol of the token for which the user is revoking approval" + }, + "revokeApproveForAllDescription": { + "message": "При отмене разрешения следующий $1 больше не сможет получить доступ к вашему $2", + "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" + }, "rinkeby": { "message": "Тестовая сеть Rinkeby" }, @@ -2852,12 +2900,23 @@ "message": "Отправка $1...", "description": "$1 represents the native currency symbol for the current network (e.g. ETH or BNB)" }, + "sendingToTokenContractWarning": { + "message": "Предупреждение: вы собираетесь отправить токен-контракт, что может привести к потере средств. $1", + "description": "$1 is a clickable link with text defined by the 'learnMoreUpperCase' key. The link will open to a support article regarding the known contract address warning" + }, "setAdvancedPrivacySettings": { "message": "Задать дополнительные настройки конфиденциальности" }, "setAdvancedPrivacySettingsDetails": { "message": "MetaMask использует эти доверенные сторонние сервисы для повышения удобства использования и безопасности продукта." }, + "setApprovalForAll": { + "message": "Установить одобрение для всех" + }, + "setApprovalForAllTitle": { + "message": "Одобрить $1 без ограничений по расходам", + "description": "The token symbol that is being approved" + }, "settings": { "message": "Настройки" }, @@ -2877,6 +2936,12 @@ "showAdvancedGasInlineDescription": { "message": "Выберите это, чтобы отображать цену газа и управление лимитами непосредственно на экранах отправки и подтверждения." }, + "showCustomNetworkList": { + "message": "Показать пользовательский список сетей" + }, + "showCustomNetworkListDescription": { + "message": "Выберите это, чтобы отобразить список сетей с предварительно заполненными данными при добавлении новой сети." + }, "showFiatConversionInTestnets": { "message": "Показывать конвертацию в тестовых сетях" }, @@ -2967,10 +3032,6 @@ "snapInstallWarningCheck": { "message": "Чтобы подтвердить, что вы понимаете, отметьте все." }, - "snapInstallWarningKeyAccess": { - "message": "Вы предоставляете ключевой доступ к снапу «$1». Это действие является безотзывным и предоставляет «$1» контроль над вашими счетами и активами. Прежде чем продолжить, убедитесь, что вы доверяете «$1».", - "description": "The parameter is the name of the snap" - }, "snapRequestsPermission": { "message": "Этот снап запрашивает следующие разрешения:" }, @@ -2986,6 +3047,9 @@ "snapsToggle": { "message": "Снап будет работать только в том случае, если он включен" }, + "someNetworksMayPoseSecurity": { + "message": "Некоторые сети могут представлять угрозу безопасности и/или конфиденциальности. Прежде чем добавлять и использовать сеть, ознакомьтесь с рисками." + }, "somethingWentWrong": { "message": "Ой! Что-то пошло не так." }, @@ -3548,6 +3612,10 @@ "switchNetworks": { "message": "Сменить сети" }, + "switchToNetwork": { + "message": "Переключиться на $1", + "description": "$1 represents the custom network that has previously been added" + }, "switchToThisAccount": { "message": "Переключиться на этот счет" }, @@ -3635,7 +3703,7 @@ }, "toggleTestNetworks": { "message": "$1 тестовые сети", - "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open to the advanced settings where users can enable the display of test networks in the network dropdown." + "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open Settings > Advanced where users can enable the display of test networks in the network dropdown." }, "token": { "message": "Токен" @@ -3664,12 +3732,6 @@ "tokenDetectionAlertMessage": { "message": "Обнаружение токена в настоящее время доступно на $1. $2" }, - "tokenDetectionAnnouncement": { - "message": "Новинка! Улучшенное обнаружение токенов доступно в сети Ethereum Mainnet в качестве экспериментальной функции. $1" - }, - "tokenDetectionToggleDescription": { - "message": "API токенов ConsenSys объединяет список токенов из различных списков сторонних токенов. Отключение этого параметра прекратит обнаружение новых токенов, добавляемых в ваш кошелек, но сохранит возможность поиска токенов для импорта." - }, "tokenId": { "message": "Ид. токена" }, @@ -3851,6 +3913,9 @@ "unknownCameraErrorTitle": { "message": "Ой! Что-то пошло не так...." }, + "unknownCollection": { + "message": "Безымянная коллекция" + }, "unknownNetwork": { "message": "Неизвестная частная сеть" }, @@ -3901,12 +3966,6 @@ "usePhishingDetectionDescription": { "message": "Показывать предупреждение для фишинговых доменов, нацеленных на пользователей Ethereum" }, - "useTokenDetection": { - "message": "Использовать обнаружение токенов" - }, - "useTokenDetectionDescription": { - "message": "Мы используем сторонние API для обнаружения и отображения новых токенов, отправленных в ваш кошелек. Отключите, если не хотите, чтобы MetaMask получал данные от этих служб." - }, "useTokenDetectionPrivacyDesc": { "message": "Автоматическое отображение токенов, отправленных на ваш счет, требует обмена данными со сторонними серверами для получения изображений токенов. Эти серверы получат доступ к вашему IP-адресу." }, @@ -3987,6 +4046,9 @@ "walletCreationSuccessTitle": { "message": "Кошелек создан" }, + "wantToAddThisNetwork": { + "message": "Хотите добавить эту сеть?" + }, "warning": { "message": "Предупреждение" }, @@ -4049,6 +4111,10 @@ "yesLetsTry": { "message": "Да, давайте попробуем" }, + "youHaveAddedAll": { + "message": "Вы добавили все популярные сети. Вы можете открыть для себя больше сетей $1 или можете $2", + "description": "$1 is a link with the text 'here' and $2 is a button with the text 'add more networks manually'" + }, "youNeedToAllowCameraAccess": { "message": "Для использования этой функции вам необходимо предоставить доступ к камере." }, diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index 5ed22eaba..72098a20a 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -157,6 +157,9 @@ "addMemo": { "message": "Magdagdag ng memo" }, + "addMoreNetworks": { + "message": "magdagdag pa ng mga network nang mano-mano" + }, "addNetwork": { "message": "Magdagdag ng Network" }, @@ -227,6 +230,10 @@ "alerts": { "message": "Mga Alerto" }, + "allOfYour": { + "message": "Lahat ng iyong $1", + "description": "$1 is the symbol or name of the token that the user is approving spending" + }, "allowExternalExtensionTo": { "message": "Payagan ang external extension na ito na:" }, @@ -263,6 +270,10 @@ "approve": { "message": "Aprubahan ang limitasyon sa paggastos" }, + "approveAllTokensTitle": { + "message": "Magbigay ng pahintulot na i-access ang lahat ng iyong $1?", + "description": "$1 is the symbol of the token for which the user is granting approval" + }, "approveAndInstall": { "message": "Aprubahan at I-install" }, @@ -282,9 +293,6 @@ "approvedAsset": { "message": "Aprubadong asset" }, - "areYouDeveloper": { - "message": "Isa ka bang developer?" - }, "areYouSure": { "message": "Sigurado ka ba?" }, @@ -466,6 +474,13 @@ "message": "Sa $1 na transaksyon ang singil sa gas ay dapat tumaas nang hindi bababa sa 10% para ito ay makilala ng network.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwapForFee": { + "message": "Kanselahin ang swap sa halagang ~$1", + "description": "$1 could be e.g. $2.98, it is a cost for cancelling a Smart Transaction" + }, + "cancelSwapForFree": { + "message": "Kanselahin ang swap nang libre" + }, "cancellationGasFee": { "message": "Bayarin sa Gasolina para sa Pagkansela" }, @@ -732,7 +747,7 @@ }, "customGasSettingToolTipMessage": { "message": "Gamitin ang $1 para i-customize ang presyo ng gas. Ito ay maaaring nakakalito kung hindi ka pamilyar. Harapin ang sarili mong panganib.", - "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold font-weight" }, "customGasSubTitle": { "message": "Kapag dinagdagan ang bayarin, mababawasan ang mga oras ng pagproseso, pero hindi ito garantisado." @@ -818,7 +833,7 @@ }, "depositCrypto": { "message": "Magdeposito ng $1", - "description": "$1 represents the cypto symbol to be purchased" + "description": "$1 represents the crypto symbol to be purchased" }, "description": { "message": "Deskripsyon" @@ -1196,9 +1211,6 @@ "failureMessage": { "message": "Nagkaproblema, at hindi namin makumpleto ang aksyon" }, - "fakeTokenWarning": { - "message": "Sinuman ay maaaring gumawa ng token, kabilang ang paggawa ng mga pekeng bersyon ng mga umiiral na token. Alamin pa ang tungkol sa $1" - }, "fast": { "message": "Mabilis" }, @@ -1277,6 +1289,9 @@ "functionApprove": { "message": "Function: Aprubahan" }, + "functionSetApprovalForAll": { + "message": "Function: ItakdaAngPag-aprubaParaSaLahat" + }, "functionType": { "message": "Uri ng Function" }, @@ -1463,7 +1478,7 @@ }, "highGasSettingToolTipMessage": { "message": "Gamitin ang $1 upang pagtakpan ang mga surge sa network traffic dahil sa mga bagay tulad ng popular na pagbagsak ng NFT.", - "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold font-weight" }, "highLowercase": { "message": "mataas" @@ -1617,6 +1632,9 @@ "invalidSeedPhrase": { "message": "Hindi valid ang Secret Recovery Phrase" }, + "invalidSeedPhraseCaseSensitive": { + "message": "Di-wastong input! Ang Secret Recovery Phrase ay case sensitive." + }, "ipfsGateway": { "message": "Gateway na IPFS" }, @@ -1766,7 +1784,7 @@ }, "lowGasSettingToolTipMessage": { "message": "Gamitin ang $1 para maghintay ng mas murang presyo. Ang mga pagtatantya sa oras ay hindi gaanong tumpak dahil ang mga presyo ay medyo hindi mahuhulaan.", - "description": "$1 is key 'low' separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'low' separated here so that it can be passed in with bold font-weight" }, "lowLowercase": { "message": "mababa" @@ -1810,7 +1828,7 @@ }, "mediumGasSettingToolTipMessage": { "message": "Gamitin ang $1 para sa pagproseso sa kasalukuyang market price.", - "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold font-weight" }, "memo": { "message": "memo" @@ -1892,6 +1910,19 @@ "message": "i-verify ang mga detalye ng network", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." }, + "mismatchedChainRecommendation": { + "message": "Inirerekomenda namin na $1 ka bago magpatuloy.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key. The link will open to instructions for users to validate custom network details." + }, + "mismatchedNetworkName": { + "message": "Ayon sa aming talaan, ang pangalan ng network ay maaaring hindi tumugma nang tama sa chain ID na ito." + }, + "mismatchedNetworkSymbol": { + "message": "Ang isinumiteng simbolo ng currency ay hindi tumutugma sa inaasahan namin para sa chain ID na ito." + }, + "mismatchedRpcUrl": { + "message": "Ayon sa aming mga talaan, ang isinumiteng RPC URL value ay hindi tumutugma sa isang kilalang provider para sa chain ID na ito." + }, "missingNFT": { "message": "Hindi makita ang NFT mo?" }, @@ -1943,6 +1974,9 @@ "network": { "message": "Network:" }, + "networkAddedSuccessfully": { + "message": "Matagumpay na naidagdag ang network!" + }, "networkDetails": { "message": "Mga Detalye ng Network" }, @@ -2059,6 +2093,9 @@ "message": "Mas mataas ang noncesa iminumungkahing nonce na $1", "description": "The next nonce according to MetaMask's internal logic" }, + "nft": { + "message": "NFT" + }, "nftTokenIdPlaceholder": { "message": "Ilagay ang collectible ID" }, @@ -2130,7 +2167,7 @@ }, "notifications10ActionText": { "message": "Bisitahin sa mga setting", - "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." + "description": "The 'call to action' on the button, or link, of the 'Visit in Settings' notification. Upon clicking, users will be taken to Settings page." }, "notifications10DescriptionOne": { "message": "Ang pinahusay na pagtukoy ng token ay kasalukuyang magagamit sa Ethereum Mainnet, Polygon, BSC, at mga Avalanche network. Marami pang darating!" @@ -2159,6 +2196,16 @@ "notifications12Title": { "message": "Wen dark mode? Ngayon dark mode! 🕶️🦊" }, + "notifications13ActionText": { + "message": "Ipakita ang listahan ng custom na network" + }, + "notifications13Description": { + "message": "Madali mo na ngayong maidagdag ang mga sumusunod na sikat na custom na network: Arbitrum, Avalanche, Binance Smart Chain, Fantom, Harmony, Optimism, Palm at Polygon! Para i-enable ang feature na ito, pumunta sa Mga Setting -> Experimental at i-on ang \"Ipakita ang listahan ng custom na network\"!", + "description": "Description of a notification in the 'See What's New' popup. Describes popular network feature." + }, + "notifications13Title": { + "message": "Magdagdag ng mga Sikat na Network" + }, "notifications1Description": { "message": "Ang mga user ng MetaMask Mobile ay maaari na ngayong mag-swap ng mga token sa loob ng kanilang mobile wallet. I-scan ang QR code para makuha ang mobile app at magsimulang mag-swap.", "description": "Description of a notification in the 'See What's New' popup. Describes the swapping on mobile feature." @@ -2225,7 +2272,7 @@ }, "notifications8ActionText": { "message": "Magpunta sa Advanced Settings", - "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced Settings page." + "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced settings page." }, "notifications8DescriptionOne": { "message": "Para sa MetaMask v10.4.0, hindi mo na kailangang ikonekta ang Ledger Live sa iyong Ledger device sa MetaMask.", @@ -2261,10 +2308,6 @@ "notificationsMarkAllAsRead": { "message": "Markahan ang lahat bilang nabasa na" }, - "numberOfNewTokensDetected": { - "message": "$1 bagong token ang nakita sa account na ito", - "description": "$1 is the number of new tokens detected" - }, "ofTextNofM": { "message": "ng" }, @@ -2344,9 +2387,6 @@ "message": "Buksan ang MetaMask sa buong screen para ikonekta ang ledger mo sa pamamagitan ng WebHID.", "description": "Shown to the user on the confirm screen when they are viewing MetaMask in a popup window but need to connect their ledger via webhid." }, - "openSourceCode": { - "message": "Suriin ang code ng pinagmulan" - }, "optional": { "message": "Opsyonal" }, @@ -2473,7 +2513,7 @@ }, "preferredLedgerConnectionType": { "message": "Napiling Uri ng Ledger Connection", - "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" + "description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message" }, "preparingSwap": { "message": "Inihahanda ang pagpapalit..." @@ -2676,6 +2716,14 @@ "revealTheSeedPhrase": { "message": "Ipakita ang seed phrase" }, + "revokeAllTokensTitle": { + "message": "Bawiin ang pahintulot na i-access ang lahat ng iyong $1?", + "description": "$1 is the symbol of the token for which the user is revoking approval" + }, + "revokeApproveForAllDescription": { + "message": "Sa pamamagitan ng pagbawi ng pahintulot, hindi na maa-access ng sumusunod na $1 ang iyong $2", + "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" + }, "rinkeby": { "message": "Rinkeby Test Network" }, @@ -2852,12 +2900,23 @@ "message": "Nagpapadala ng $1", "description": "$1 represents the native currency symbol for the current network (e.g. ETH or BNB)" }, + "sendingToTokenContractWarning": { + "message": "Babala: magpapadala ka sa isang kontrata ng token na maaaring magresulta sa pagkawala ng mga pondo. $1", + "description": "$1 is a clickable link with text defined by the 'learnMoreUpperCase' key. The link will open to a support article regarding the known contract address warning" + }, "setAdvancedPrivacySettings": { "message": "Magtakda ng advanced privacy settings" }, "setAdvancedPrivacySettingsDetails": { "message": "Ginagamit ng MetaMask ang mga pinagkakatiwalaang serbisyo ng third-party na ito para mapahusay ang kakayahang magamit at kaligtasan ng produkto." }, + "setApprovalForAll": { + "message": "Itakda ang Pag-apruba para sa Lahat" + }, + "setApprovalForAllTitle": { + "message": "Aprubahan ang $1 nang walang limitasyon sa paggastos", + "description": "The token symbol that is being approved" + }, "settings": { "message": "Mga Setting" }, @@ -2877,6 +2936,12 @@ "showAdvancedGasInlineDescription": { "message": "Piliin ito para direktang maipakita ang presyo ng gas at mga kontrol sa limitasyon sa mga screen ng pagpapadala at pagkumpirma." }, + "showCustomNetworkList": { + "message": "Ipakita ang Listahan ng Custom na Network" + }, + "showCustomNetworkListDescription": { + "message": "Piliin ito para magpakita ng listahan ng mga network na may prefilled na mga detalye kapag nagdaragdag ng bagong network." + }, "showFiatConversionInTestnets": { "message": "Ipakita ang Conversion sa Testnets" }, @@ -2967,10 +3032,6 @@ "snapInstallWarningCheck": { "message": "Para kumpirmahing naunawaan mo, tsekan lahat." }, - "snapInstallWarningKeyAccess": { - "message": "Ipinagkakaloob mo ang key access sa snap \"$1\". Hindi ito maaaring bawiin at ipinagkakaloob sa \"$1\" ang kontrol sa iyong mga account at mga asset. Tiyaking pinagkakatiwalaan mo ang \"$1\" bago magpatuloy.", - "description": "The parameter is the name of the snap" - }, "snapRequestsPermission": { "message": "Hinihiling ng snap na ito ang mga sumusunod na pahintulot:" }, @@ -2986,6 +3047,9 @@ "snapsToggle": { "message": "Tatakbo lamang ang snap kapag pinagana ito" }, + "someNetworksMayPoseSecurity": { + "message": "Maaaring magdulot ang ilang network ng mga panganib sa seguridad at/o pagkapribado. Unawain ang mga panganib bago idagdag o gamitin ang isang network." + }, "somethingWentWrong": { "message": "Oops! Nagkaproblema." }, @@ -3548,6 +3612,10 @@ "switchNetworks": { "message": "Lumipat ng Network" }, + "switchToNetwork": { + "message": "Lumipat sa $1", + "description": "$1 represents the custom network that has previously been added" + }, "switchToThisAccount": { "message": "Lumipat sa account na ito" }, @@ -3635,7 +3703,7 @@ }, "toggleTestNetworks": { "message": "$1 na test network", - "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open to the advanced settings where users can enable the display of test networks in the network dropdown." + "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open Settings > Advanced where users can enable the display of test networks in the network dropdown." }, "token": { "message": "Token" @@ -3664,12 +3732,6 @@ "tokenDetectionAlertMessage": { "message": "Ang pagtukoy ng token ay kasalukuyang magagamit sa $1. $2" }, - "tokenDetectionAnnouncement": { - "message": "Bago! Ang pinahusay na pagtukoy ng token ay magagamit sa Ethereum Mainnet bilang isang pang-eksperimentong feature. $1" - }, - "tokenDetectionToggleDescription": { - "message": "Pinagsasama-sama ng ConsenSys’ token API ang listahan ng mga token mula sa maraming listahan ng token ng third party. Ang pag-off dito ay magpapahinto sa pagtuklas ng mga bagong token na madadagdag sa iyong wallet, ngunit pananatilihin ang opsyon sa paghahanap ng mga token para i-import." - }, "tokenId": { "message": "Token ID" }, @@ -3851,6 +3913,9 @@ "unknownCameraErrorTitle": { "message": "Ooops! Nagkaproblema...." }, + "unknownCollection": { + "message": "Walang pangalang koleksyon" + }, "unknownNetwork": { "message": "Hindi Alam na Pribadong Network" }, @@ -3901,12 +3966,6 @@ "usePhishingDetectionDescription": { "message": "Magpakita ng babala para sa mga phishing domain na nagta-target sa mga user ng Ethereum" }, - "useTokenDetection": { - "message": "Gamitin ang Pag-detect ng Token" - }, - "useTokenDetectionDescription": { - "message": "Gumagamit kami ng mga third-party na API para makita at magpakita ng mga bagong token na ipinadala sa iyong wallet. I-off kung ayaw mong makuha ng MetaMask ang data mula sa mga serbisyong iyon." - }, "useTokenDetectionPrivacyDesc": { "message": "Awtomatikong ipinapakita ang mga token na ipinadala sa iyong account na nakapaloob sa komunikasyon ng mga server ng third party para makuha ang mga larawan ng token. Ang mga server na iyon ay magkakaroon ng access sa iyong IP address." }, @@ -3987,6 +4046,9 @@ "walletCreationSuccessTitle": { "message": "Matagumpay ang paggawa ng wallet" }, + "wantToAddThisNetwork": { + "message": "Gusto mo bang idagdag ang network na ito?" + }, "warning": { "message": "Babala" }, @@ -4049,6 +4111,10 @@ "yesLetsTry": { "message": "Oo, subukan natin" }, + "youHaveAddedAll": { + "message": "Idinagdag mo ang lahat ng sikat na network. Maaari kang makatuklas ng higit pang mga network $1 O maaari kang", + "description": "$1 is a link with the text 'here' and $2 is a button with the text 'add more networks manually'" + }, "youNeedToAllowCameraAccess": { "message": "Kailangan mong payagan ang pag-access sa camera para magamit ang feature na ito." }, diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index 05719bd53..0954b697f 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -157,6 +157,9 @@ "addMemo": { "message": "Not ekleyin" }, + "addMoreNetworks": { + "message": "manuel olarak daha fazla ağ ekleyin" + }, "addNetwork": { "message": "Ağ ekle" }, @@ -227,6 +230,10 @@ "alerts": { "message": "Uyarılar" }, + "allOfYour": { + "message": "Sahip olduğunuz tüm $1", + "description": "$1 is the symbol or name of the token that the user is approving spending" + }, "allowExternalExtensionTo": { "message": "Bu harici uzantının şunu yapmasına izin ver:" }, @@ -263,6 +270,10 @@ "approve": { "message": "Harcama limitini onayla" }, + "approveAllTokensTitle": { + "message": "Sahip olduğunuz tüm $1 için erişim izni verilsin mi?", + "description": "$1 is the symbol of the token for which the user is granting approval" + }, "approveAndInstall": { "message": "Onayla ve Yükle" }, @@ -282,9 +293,6 @@ "approvedAsset": { "message": "Onaylanan varlık" }, - "areYouDeveloper": { - "message": "Geliştirici misin?" - }, "areYouSure": { "message": "Emin misin?" }, @@ -438,7 +446,7 @@ "message": "Wyre ile $1 satın al" }, "buyWithWyreDescription": { - "message": "Wyre, doğrudan MetaMask hesabınıza $1 yatırma işlemleri için banka kartı kullanmanıza izin verir." + "message": "1000$'a kadar satın alma işlemlerinde kolay oryantasyon. Banka Kartı/Kredi Kartı, Apple Pay, Banka Transferlerini destekler. +100 ülkede kullanılabilir. Token'lar MetaMask Hesabına yatırılır" }, "bytes": { "message": "Bayt" @@ -466,6 +474,13 @@ "message": "İşlemi $1 için, gaz ücretinin ağ tarafından tanınması amacıyla en az %10 oranında artırılması gerekir.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwapForFee": { + "message": "~$1 için swap işlemini iptal edin", + "description": "$1 could be e.g. $2.98, it is a cost for cancelling a Smart Transaction" + }, + "cancelSwapForFree": { + "message": "Swap işlemini ücretsiz iptal edin" + }, "cancellationGasFee": { "message": "İptal İşlemi Gaz Ücreti" }, @@ -732,7 +747,7 @@ }, "customGasSettingToolTipMessage": { "message": "Gaz fiyatını özelleştirmek için $1 kullanın. Bu, bilgi sahibi değilseniz kafa karıştırıcı olabilir. Riski size ait olmak üzere kullanın.", - "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold font-weight" }, "customGasSubTitle": { "message": "Ücretin artırılması işlem süresini kısaltabilir ancak bu garanti edilmez." @@ -818,7 +833,7 @@ }, "depositCrypto": { "message": "$1 yatır", - "description": "$1 represents the cypto symbol to be purchased" + "description": "$1 represents the crypto symbol to be purchased" }, "description": { "message": "Açıklama" @@ -1196,9 +1211,6 @@ "failureMessage": { "message": "Bir şeyler ters gitti ve işlemi tamamlayamadık" }, - "fakeTokenWarning": { - "message": "Mevcut tokenlerin sahteleri de dahil olmak üzere herkes bir token oluşturabilir. $1 hakkında daha fazla bilgi edinin" - }, "fast": { "message": "Hızlı" }, @@ -1277,6 +1289,9 @@ "functionApprove": { "message": "İşlev: Onayla" }, + "functionSetApprovalForAll": { + "message": "İşlev: TümüİçinOnayVer" + }, "functionType": { "message": "İşlev Türü" }, @@ -1463,7 +1478,7 @@ }, "highGasSettingToolTipMessage": { "message": "Popüler NFT düşüşleri gibi şeyler nedeniyle ağ trafiğindeki dalgalanmaları kapsayacak şekilde $1 kullanın.", - "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold font-weight" }, "highLowercase": { "message": "yüksek" @@ -1617,6 +1632,9 @@ "invalidSeedPhrase": { "message": "Gizli Kurtarma İfadesi geçersiz" }, + "invalidSeedPhraseCaseSensitive": { + "message": "Giriş geçersiz! Gizli Kurtarma İfadesi büyük/küçük harf duyarlıdır." + }, "ipfsGateway": { "message": "IPFS Ağ Geçidi" }, @@ -1766,7 +1784,7 @@ }, "lowGasSettingToolTipMessage": { "message": "Daha ucuz bir fiyat için beklemek için $1 kullanın. Fiyatlar bir şekilde öngörülemez oldukları için süre tahminleri çok daha az kesindir.", - "description": "$1 is key 'low' separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'low' separated here so that it can be passed in with bold font-weight" }, "lowLowercase": { "message": "düşük" @@ -1810,7 +1828,7 @@ }, "mediumGasSettingToolTipMessage": { "message": "Mevcut piyasa fiyatında hızlı işleme almak için $1 kullanın.", - "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold font-weight" }, "memo": { "message": "not" @@ -1892,6 +1910,19 @@ "message": "ağ bilgilerini doğrula", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." }, + "mismatchedChainRecommendation": { + "message": "İlerlemeden önce şunu öneririz: $1.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key. The link will open to instructions for users to validate custom network details." + }, + "mismatchedNetworkName": { + "message": "Kayıtlarımıza göre, ağ adı bu zincir kimliği ile doğru bir şekilde uyumlu olmayabilir." + }, + "mismatchedNetworkSymbol": { + "message": "Sunulan para birimi sembolü bu zincir kimliği için beklediğimiz sembolle uyumlu değil." + }, + "mismatchedRpcUrl": { + "message": "Kayıtlarımıza göre, sunulan RPC URL adresi değeri bu zincir kimliğinin bilinen bir sağlayıcısı ile uyumlu değil." + }, "missingNFT": { "message": "NFT'nizi görmüyor musunuz?" }, @@ -1943,6 +1974,9 @@ "network": { "message": "Ağ:" }, + "networkAddedSuccessfully": { + "message": "Ağ başarılı bir şekilde eklendi!" + }, "networkDetails": { "message": "Ağ Bilgileri" }, @@ -2059,6 +2093,9 @@ "message": "Geçici anahtar, önerilen $1 geçici anahtarından daha büyük", "description": "The next nonce according to MetaMask's internal logic" }, + "nft": { + "message": "NFT" + }, "nftTokenIdPlaceholder": { "message": "Toplanabilir kimliğini girin" }, @@ -2130,7 +2167,7 @@ }, "notifications10ActionText": { "message": "Ayarlarda ziyaret et", - "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." + "description": "The 'call to action' on the button, or link, of the 'Visit in Settings' notification. Upon clicking, users will be taken to Settings page." }, "notifications10DescriptionOne": { "message": "Geliştirilmiş token algılama şu anda Ethereum Mainnet, Polygon, BSC ve Avalanche ağlarında mevcut. Daha fazlası gelecek!" @@ -2154,11 +2191,21 @@ "message": "Karanlık modu etkinleştir" }, "notifications12Description": { - "message": "Karanlık Mod, sistem tercihlerine bağlı olarak yeni kullanıcılar için etkinleştirilecektir. Mevcut kullanıcılar için, Ayarlar -> Deneysel altında Karanlık Modu manuel olarak etkinleştir." + "message": "Uzantıda karanlık mod sonunda burada! Bunu açmak için Ayarlar -> Deneysel kısmına git ve ekran seçeneklerinden birini seç: Aydınlık, Karanlık, Sistem." }, "notifications12Title": { "message": "Karanlık mod mu? Şimdi karanlık mod! 🕶️🦊" }, + "notifications13ActionText": { + "message": "Özel ağ listesini göster" + }, + "notifications13Description": { + "message": "Artık şu popüler özel ağları kolayca ekleyebilirsiniz: Arbitrum, Avalanche, Binance Smart Chain, Fantom, Harmony, Optimism, Palm ve Polygon! Bu özelliği etkinleştirmek için Ayarlar -> Deneysel kısmına gidip \"Özel ağ listesini göster\" seçeneğini açın!", + "description": "Description of a notification in the 'See What's New' popup. Describes popular network feature." + }, + "notifications13Title": { + "message": "Popüler Ağları Ekle" + }, "notifications1Description": { "message": "MetaMask Mobil kullanıcıları artık mobil cüzdanları içinde token takas edebilirler. Mobil uygulamayı edinmek ve takas yapmaya başlamak için QR kodunu tarayın.", "description": "Description of a notification in the 'See What's New' popup. Describes the swapping on mobile feature." @@ -2225,7 +2272,7 @@ }, "notifications8ActionText": { "message": "Gelişmiş ayarlara git", - "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced Settings page." + "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced settings page." }, "notifications8DescriptionOne": { "message": "MetaMask 10.4.0 sürümü itibariyle Kayıt Defteri cihazınızı Metamask'e bağlamak için artık Ledger Live'e ihtiyacınız yok.", @@ -2261,10 +2308,6 @@ "notificationsMarkAllAsRead": { "message": "Tümünü okundu olarak işaretle" }, - "numberOfNewTokensDetected": { - "message": "Bu hesapta $1 yeni token bulundu", - "description": "$1 is the number of new tokens detected" - }, "ofTextNofM": { "message": "/" }, @@ -2344,9 +2387,6 @@ "message": "Kayıt defterinizi WebHID üzerinden bağlamak için MetaMask'i tam ekran açın.", "description": "Shown to the user on the confirm screen when they are viewing MetaMask in a popup window but need to connect their ledger via webhid." }, - "openSourceCode": { - "message": "Kaynak kodunu kontrol et" - }, "optional": { "message": "İsteğe bağlı" }, @@ -2473,7 +2513,7 @@ }, "preferredLedgerConnectionType": { "message": "Tercih Edilen Kayıt Defteri Bağlantı Türü", - "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" + "description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message" }, "preparingSwap": { "message": "Takas hazırlanıyor..." @@ -2676,6 +2716,14 @@ "revealTheSeedPhrase": { "message": "Tohum ifadesini ortaya çıkar" }, + "revokeAllTokensTitle": { + "message": "Sahip olduğunuz tüm $1 için izin geri çekilsin mi?", + "description": "$1 is the symbol of the token for which the user is revoking approval" + }, + "revokeApproveForAllDescription": { + "message": "İzni geri çektiğinizde aşağıdaki $1 artık $2 alanınıza erişim sağlayamayacak", + "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" + }, "rinkeby": { "message": "Rinkeby Test Ağı" }, @@ -2852,12 +2900,23 @@ "message": "$1 Gönderiliyor", "description": "$1 represents the native currency symbol for the current network (e.g. ETH or BNB)" }, + "sendingToTokenContractWarning": { + "message": "Uyarı: Para kaybı ile sonuçlanabilecek bir token sözleşmesi göndermek üzeresiniz. $1", + "description": "$1 is a clickable link with text defined by the 'learnMoreUpperCase' key. The link will open to a support article regarding the known contract address warning" + }, "setAdvancedPrivacySettings": { "message": "Gelişmiş gizlilik ayarlarını yapın" }, "setAdvancedPrivacySettingsDetails": { "message": "MetaMask, ürünün kullanılabilirliğini ve güvenliğini iyileştirmek amacıyla bu güvenilir üçüncü taraf hizmetlerini kullanır." }, + "setApprovalForAll": { + "message": "Tümüne Onay Ver" + }, + "setApprovalForAllTitle": { + "message": "$1 için harcama limiti olmadan onay ver", + "description": "The token symbol that is being approved" + }, "settings": { "message": "Ayarlar" }, @@ -2877,6 +2936,12 @@ "showAdvancedGasInlineDescription": { "message": "Gaz fiyatı ve limit kontrollerini doğrudan gönder ve onayla ekranlarında göstermek için bunu seçin." }, + "showCustomNetworkList": { + "message": "Özel Ağ Listesini Göster" + }, + "showCustomNetworkListDescription": { + "message": "Yeni bir ağ eklerken önceden doldurulan bilgilerle ağ listesini görüntülenmesi için bunu seçin." + }, "showFiatConversionInTestnets": { "message": "Test ağlarında Dönüşümü göster" }, @@ -2967,10 +3032,6 @@ "snapInstallWarningCheck": { "message": "Anladığını doğrulamak için hepsini kontrol et." }, - "snapInstallWarningKeyAccess": { - "message": "\"$1\" snap'ine anahtar erişimi veriyorsun. Bu geri alınamaz ve hesapların ve varlıkların üzerinde \"1$\" kontrol sağlar. Devam etmeden önce \"$1\" öğesine güvendiğinden emin ol.", - "description": "The parameter is the name of the snap" - }, "snapRequestsPermission": { "message": "Bu ek, aşağıdaki izinleri istiyor:" }, @@ -2986,6 +3047,9 @@ "snapsToggle": { "message": "Bir snap yalnızca etkinleştirilmişse çalışır" }, + "someNetworksMayPoseSecurity": { + "message": "Bazı ağlar güvenlik ve/veya gizlilik riskleri teşkil edebilir. Bir ağ eklemeden ve kullanmadan önce riskleri anlayın." + }, "somethingWentWrong": { "message": "Eyvah! Bir şeyler ters gitti." }, @@ -3548,6 +3612,10 @@ "switchNetworks": { "message": "Ağları Değiştir" }, + "switchToNetwork": { + "message": "$1 ağına geçin", + "description": "$1 represents the custom network that has previously been added" + }, "switchToThisAccount": { "message": "Bu hesaba geç" }, @@ -3635,7 +3703,7 @@ }, "toggleTestNetworks": { "message": "Test ağlarını $1", - "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open to the advanced settings where users can enable the display of test networks in the network dropdown." + "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open Settings > Advanced where users can enable the display of test networks in the network dropdown." }, "token": { "message": "Token" @@ -3664,12 +3732,6 @@ "tokenDetectionAlertMessage": { "message": "Token algılama şu anda $1 üzerinden kullanılabilir. $2" }, - "tokenDetectionAnnouncement": { - "message": "Yeni! Deney aşamasında olan bir özellik olarak Ethereum Mainnet'te gelişmiş token algılama mevcut. $1" - }, - "tokenDetectionToggleDescription": { - "message": "ConsenSys'in token API'si, çeşitli üçüncü taraf token listelerinden token'ların bir listesini toplar. Kapatmak, cüzdanına eklenen yeni token'ları algılamayı durduracak, ancak içe aktarılacak token'ları arama seçeneğini koruyacaktır." - }, "tokenId": { "message": "Token Kimliği" }, @@ -3851,6 +3913,9 @@ "unknownCameraErrorTitle": { "message": "Eyvah! Bir şeyler ters gitti...." }, + "unknownCollection": { + "message": "İsimsiz koleksiyon" + }, "unknownNetwork": { "message": "Bilinmeyen Özel Ağ" }, @@ -3901,12 +3966,6 @@ "usePhishingDetectionDescription": { "message": "Ethereum kullanıcılarını hedefleyen kimlik avı alanları için bir uyarı görüntüler" }, - "useTokenDetection": { - "message": "Token Algılama Kullan" - }, - "useTokenDetectionDescription": { - "message": "Cüzdanınıza gönderilen yeni tokenleri algılamak ve görüntülemek için üçüncü taraf API'leri kullanıyoruz. MetaMask tarafından bu hizmetlerden veri çekilmesini istemiyorsanız bunu kapatın." - }, "useTokenDetectionPrivacyDesc": { "message": "Hesabına gönderilen token'ların otomatik olarak görüntülenmesi, token'ın görüntülerini almak için üçüncü taraf sunucularla iletişimi içerir. Bu servislerin IP adresine erişimi olacaktır." }, @@ -3962,7 +4021,7 @@ "description": "$1 is the action type. e.g (Account, Transaction, Swap)" }, "visitWebSite": { - "message": "Web sitemizi ziyaret edin" + "message": "Web sitemizi ziyaret et" }, "walletConnectionGuide": { "message": "donanım cüzdanı bağlantı kılavuzumuz" @@ -3987,6 +4046,9 @@ "walletCreationSuccessTitle": { "message": "Cüzdan oluşturma başarılı" }, + "wantToAddThisNetwork": { + "message": "Bu ağı eklemek istiyor musunuz?" + }, "warning": { "message": "Uyarı" }, @@ -4049,6 +4111,10 @@ "yesLetsTry": { "message": "Evet, deneyelim" }, + "youHaveAddedAll": { + "message": "Tüm popüler ağları eklediniz. $1 daha fazla ağ gekşefedebilir veya $2 seçeneğini seçebilirsiniz", + "description": "$1 is a link with the text 'here' and $2 is a button with the text 'add more networks manually'" + }, "youNeedToAllowCameraAccess": { "message": "Bu özelliği kullanmak için kamera erişimine izin vermeniz gerekir." }, diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index a38862ed5..6a40728d3 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -157,6 +157,9 @@ "addMemo": { "message": "Thêm bản ghi nhớ" }, + "addMoreNetworks": { + "message": "thêm thủ công các mạng khác" + }, "addNetwork": { "message": "Thêm mạng" }, @@ -227,6 +230,10 @@ "alerts": { "message": "Cảnh báo" }, + "allOfYour": { + "message": "Tất cả $1 của bạn", + "description": "$1 is the symbol or name of the token that the user is approving spending" + }, "allowExternalExtensionTo": { "message": "Cho phép tiện ích bên ngoài này:" }, @@ -263,6 +270,10 @@ "approve": { "message": "Phê duyệt giới hạn chi tiêu" }, + "approveAllTokensTitle": { + "message": "Cấp quyền truy cập vào tất cả $1 của bạn?", + "description": "$1 is the symbol of the token for which the user is granting approval" + }, "approveAndInstall": { "message": "Chấp nhận và cài đặt" }, @@ -282,9 +293,6 @@ "approvedAsset": { "message": "Tài sản được chấp nhận" }, - "areYouDeveloper": { - "message": "Bạn có phải là lập trình viên không?" - }, "areYouSure": { "message": "Bạn có chắc chắn không?" }, @@ -438,7 +446,7 @@ "message": "Mua $1 qua Wyre" }, "buyWithWyreDescription": { - "message": "Wyre cho phép bạn dùng thẻ ghi nợ để nạp $1 trực tiếp vào tài khoản MetaMask của mình." + "message": "Dễ dàng tham gia đối với các giao dịch mua lên đến $1.000. Xác minh mua hàng giới hạn cao và tương tác nhanh. Hỗ trợ Thẻ Tín dụng/Ghi nợ, Apple Pay, Chuyển khoản Ngân hàng. Hiện có tại hơn 100 quốc gia. Nạp token vào Tài khoản MetaMask của bạn" }, "bytes": { "message": "Byte" @@ -466,6 +474,13 @@ "message": "Để $1 một giao dịch, phí gas phải tăng tối thiểu 10% để mạng nhận ra giao dịch này.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwapForFee": { + "message": "Hủy hoán đổi với giá ~$1", + "description": "$1 could be e.g. $2.98, it is a cost for cancelling a Smart Transaction" + }, + "cancelSwapForFree": { + "message": "Hủy hoán đổi miễn phí" + }, "cancellationGasFee": { "message": "Phí gas hủy" }, @@ -650,7 +665,7 @@ "message": "Tương tác với hợp đồng" }, "convertTokenToNFTDescription": { - "message": "Chúng tôi phát hiện tài sản này là một NFT. MetaMask hiện đã hỗ trợ gốc đầy đủ cho NFT. Bạn có muốn xóa tài sản khỏi danh sách token và thêm tài sản dưới dạng NFT không?" + "message": "Chúng tôi phát hiện tài sản này là một NFT. MetaMask hiện đã hỗ trợ toàn diện và đầy đủ cho NFT. Bạn có muốn xóa tài sản khỏi danh sách token và thêm tài sản dưới dạng NFT không?" }, "convertTokenToNFTExistDescription": { "message": "Chúng tôi phát hiện tài sản này đã được thêm dưới dạng NFT. Bạn có muốn xóa tài sản khỏi danh sách token không?" @@ -732,7 +747,7 @@ }, "customGasSettingToolTipMessage": { "message": "Sử dụng $1 để tùy chỉnh giá gas. Việc này có thể gây nhầm lẫn nếu bạn không quen thuộc. Bạn phải tự chịu trách nhiệm nếu thực hiện.", - "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold font-weight" }, "customGasSubTitle": { "message": "Việc tăng phí có thể giúp giảm thời gian xử lý, nhưng điều này không được đảm bảo." @@ -818,7 +833,7 @@ }, "depositCrypto": { "message": "Nạp $1", - "description": "$1 represents the cypto symbol to be purchased" + "description": "$1 represents the crypto symbol to be purchased" }, "description": { "message": "Mô tả" @@ -1196,9 +1211,6 @@ "failureMessage": { "message": "Đã xảy ra sự cố và chúng tôi không thể hoàn tất hành động" }, - "fakeTokenWarning": { - "message": "Bất kỳ ai cũng có thể tạo token, bao gồm cả phiên bản giả mạo của các token hiện tại. Tìm hiểu thêm về $1" - }, "fast": { "message": "Nhanh" }, @@ -1277,6 +1289,9 @@ "functionApprove": { "message": "Chức năng: Phê duyệt" }, + "functionSetApprovalForAll": { + "message": "Chức năng: SetApprovalForAll" + }, "functionType": { "message": "Loại chức năng" }, @@ -1463,7 +1478,7 @@ }, "highGasSettingToolTipMessage": { "message": "Sử dụng $1 để bù đắp khi lưu lượng mạng lưới tăng vọt trong những trường hợp như phát hành NFT nổi tiếng.", - "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold font-weight" }, "highLowercase": { "message": "cao" @@ -1617,6 +1632,9 @@ "invalidSeedPhrase": { "message": "Cụm mật khẩu khôi phục bí mật không hợp lệ" }, + "invalidSeedPhraseCaseSensitive": { + "message": "Nội dung nhập không hợp lệ! Cụm từ khôi phục bí mật phân biệt chữ hoa và chữ thường." + }, "ipfsGateway": { "message": "Cổng kết nối IPFS" }, @@ -1766,7 +1784,7 @@ }, "lowGasSettingToolTipMessage": { "message": "Sử dụng $1 để chờ mức giá rẻ hơn. Thời gian dự kiến sẽ kém chính xác hơn nhiều do mức giá tương đối khó dự đoán.", - "description": "$1 is key 'low' separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'low' separated here so that it can be passed in with bold font-weight" }, "lowLowercase": { "message": "thấp" @@ -1810,7 +1828,7 @@ }, "mediumGasSettingToolTipMessage": { "message": "Sử dụng $1 để xử lý nhanh theo giá thị trường hiện tại.", - "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold font-weight" }, "memo": { "message": "bản ghi nhớ" @@ -1892,6 +1910,19 @@ "message": "xác minh thông tin về mạng", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." }, + "mismatchedChainRecommendation": { + "message": "Bạn nên $1 trước khi tiếp tục.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key. The link will open to instructions for users to validate custom network details." + }, + "mismatchedNetworkName": { + "message": "Theo hồ sơ của chúng tôi, tên mạng có thể không khớp hoàn toàn với ID chuỗi này." + }, + "mismatchedNetworkSymbol": { + "message": "Ký hiệu đơn vị tiền tệ đã gửi không khớp với những gì chúng tôi mong đợi cho ID chuỗi này." + }, + "mismatchedRpcUrl": { + "message": "Theo hồ sơ của chúng tôi, giá trị RPC URL đã gửi không khớp với một nhà cung cấp đã biết cho ID chuỗi này." + }, "missingNFT": { "message": "Không thấy NFT của mình?" }, @@ -1943,6 +1974,9 @@ "network": { "message": "Mạng:" }, + "networkAddedSuccessfully": { + "message": "Đã thêm mạng thành công!" + }, "networkDetails": { "message": "Thông tin về mạng" }, @@ -2059,6 +2093,9 @@ "message": "Số chỉ dùng một lần lớn hơn số chỉ dùng một lần gợi ý là $1", "description": "The next nonce according to MetaMask's internal logic" }, + "nft": { + "message": "NFT" + }, "nftTokenIdPlaceholder": { "message": "Nhập ID bộ sưu tập" }, @@ -2130,7 +2167,7 @@ }, "notifications10ActionText": { "message": "Xem trong cài đặt", - "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." + "description": "The 'call to action' on the button, or link, of the 'Visit in Settings' notification. Upon clicking, users will be taken to Settings page." }, "notifications10DescriptionOne": { "message": "Tính năng phát hiện token cải tiến hiện đã có sẵn trên Mạng chính thức của Ethereum, mạng Polygon, BSC và Avalanche. Sẽ sớm có thêm nhiều mạng khác!" @@ -2154,11 +2191,21 @@ "message": "Bật chế độ tối" }, "notifications12Description": { - "message": "Chế độ tối sẽ được kích hoạt dành cho người dùng mới tùy theo tùy chọn hệ thống của họ. Đối với người dùng hiện tại, có thể bật Chế độ tối theo cách thủ công trong phần Cài đặt -> Thử nghiệm." + "message": "Tiện ích Chế độ tối hiện đã ra mắt! Để bật, hãy vào Cài đặt -> Thử nghiệm và chọn một trong các tùy chọn hiển thị: Sáng, Tối, Hệ thống." }, "notifications12Title": { "message": "Dùng chế độ tối khi nào? Ngay bây giờ! 🕶️🦊" }, + "notifications13ActionText": { + "message": "Hiển thị danh sách mạng tùy chỉnh" + }, + "notifications13Description": { + "message": "Giờ đây, bạn có thể dễ dàng thêm các mạng tùy chỉnh phổ biến sau: Arbitrum, Avalanche, Binance Smart Chain, Fantom, Harmony, Optimism, Palm và Polygon! Để bật tính năng này, hãy chuyển đến Cài đặt -> Thử nghiệm và bật \"Hiển thị danh sách mạng tùy chỉnh\"!", + "description": "Description of a notification in the 'See What's New' popup. Describes popular network feature." + }, + "notifications13Title": { + "message": "Thêm các mạng phổ biến" + }, "notifications1Description": { "message": "Giờ đây, người dùng MetaMask trên điện thoại di động có thể hoán đổi token trong ví di động của họ. Quét mã QR để tải ứng dụng di động và bắt đầu hoán đổi.", "description": "Description of a notification in the 'See What's New' popup. Describes the swapping on mobile feature." @@ -2225,7 +2272,7 @@ }, "notifications8ActionText": { "message": "Đến Cài Đặt Nâng Cao", - "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced Settings page." + "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced settings page." }, "notifications8DescriptionOne": { "message": "Kể từ phiên bản MetaMask v10.4.0, bạn không cần phần mềm Ledger Live để kết nối thiết bị Ledger của mình với MetaMask nữa.", @@ -2261,10 +2308,6 @@ "notificationsMarkAllAsRead": { "message": "Đánh dấu đã đọc tất cả" }, - "numberOfNewTokensDetected": { - "message": "Tìm thấy $1 token mới trong tài khoản này", - "description": "$1 is the number of new tokens detected" - }, "ofTextNofM": { "message": "trên" }, @@ -2344,9 +2387,6 @@ "message": "Mở MetaMask ở chế độ toàn màn hình để kết nối thiết bị Ledger của bạn qua WebHID.", "description": "Shown to the user on the confirm screen when they are viewing MetaMask in a popup window but need to connect their ledger via webhid." }, - "openSourceCode": { - "message": "Kiểm tra mã nguồn" - }, "optional": { "message": "Không bắt buộc" }, @@ -2473,7 +2513,7 @@ }, "preferredLedgerConnectionType": { "message": "Dạng Kết Nối Ledger Ưu Tiên", - "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" + "description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message" }, "preparingSwap": { "message": "Đang chuẩn bị hoán đổi..." @@ -2676,6 +2716,14 @@ "revealTheSeedPhrase": { "message": "Hiện cụm từ khôi phục bí mật" }, + "revokeAllTokensTitle": { + "message": "Thu hồi quyền truy cập vào tất cả $1 của bạn?", + "description": "$1 is the symbol of the token for which the user is revoking approval" + }, + "revokeApproveForAllDescription": { + "message": "Bằng cách thu hồi quyền truy cập, $1 sau đây sẽ không thể truy cập vào $2 của bạn nữa", + "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" + }, "rinkeby": { "message": "Mạng thử nghiệm Rinkeby" }, @@ -2852,12 +2900,23 @@ "message": "Gửi $1", "description": "$1 represents the native currency symbol for the current network (e.g. ETH or BNB)" }, + "sendingToTokenContractWarning": { + "message": "Cảnh báo: bạn sắp gửi đến một hợp đồng token và điều này có thể dẫn đến nguy cơ mất tiền. $1", + "description": "$1 is a clickable link with text defined by the 'learnMoreUpperCase' key. The link will open to a support article regarding the known contract address warning" + }, "setAdvancedPrivacySettings": { "message": "Thiết lập cài đặt quyền riêng tư nâng cao" }, "setAdvancedPrivacySettingsDetails": { "message": "MetaMask sử dụng các dịch vụ của bên thứ ba đáng tin cậy này để nâng cao sự hữu ích và an toàn của sản phẩm." }, + "setApprovalForAll": { + "message": "Cài đặt phê duyệt tất cả" + }, + "setApprovalForAllTitle": { + "message": "Phê duyệt $1 không có giới hạn chi tiêu", + "description": "The token symbol that is being approved" + }, "settings": { "message": "Cài đặt" }, @@ -2877,6 +2936,12 @@ "showAdvancedGasInlineDescription": { "message": "Chọn tùy chọn này để hiển thị các quyền kiểm soát giá gas và giới hạn ngay trên màn hình gửi và xác nhận." }, + "showCustomNetworkList": { + "message": "Hiển thị danh sách mạng tùy chỉnh" + }, + "showCustomNetworkListDescription": { + "message": "Chọn tùy chọn này để hiển thị danh sách các mạng có thông tin được điền sẵn khi thêm mạng mới." + }, "showFiatConversionInTestnets": { "message": "Hiển thị tỷ lệ quy đổi trên các mạng thử nghiệm" }, @@ -2967,10 +3032,6 @@ "snapInstallWarningCheck": { "message": "Để xác nhận rằng bạn hiểu, hãy đánh dấu vào tất cả." }, - "snapInstallWarningKeyAccess": { - "message": "Bạn đang cấp quyền truy cập khóa cho Snap \"$1\". Hành động này không thể hủy bỏ và sẽ cấp quyền kiểm soát tài khoản và tài sản của bạn cho \"$1\". Đảm bảo bạn tin tưởng \"$1\" trước khi tiếp tục.", - "description": "The parameter is the name of the snap" - }, "snapRequestsPermission": { "message": "Snap này đang yêu cầu các quyền sau:" }, @@ -2986,6 +3047,9 @@ "snapsToggle": { "message": "Snap chỉ hoạt động khi đã bật" }, + "someNetworksMayPoseSecurity": { + "message": "Một số mạng có thể gây ra rủi ro về bảo mật và/hoặc quyền riêng tư. Bạn cần hiểu rõ các rủi ro này trước khi thêm và sử dụng mạng." + }, "somethingWentWrong": { "message": "Rất tiếc! Đã xảy ra sự cố." }, @@ -3548,6 +3612,10 @@ "switchNetworks": { "message": "Chuyển mạng" }, + "switchToNetwork": { + "message": "Chuyển sang $1", + "description": "$1 represents the custom network that has previously been added" + }, "switchToThisAccount": { "message": "Chuyển sang tài khoản này" }, @@ -3635,7 +3703,7 @@ }, "toggleTestNetworks": { "message": "$1 mạng thử nghiệm", - "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open to the advanced settings where users can enable the display of test networks in the network dropdown." + "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open Settings > Advanced where users can enable the display of test networks in the network dropdown." }, "token": { "message": "Token" @@ -3664,12 +3732,6 @@ "tokenDetectionAlertMessage": { "message": "Tính năng phát hiện token hiện có sẵn trên $1. $2" }, - "tokenDetectionAnnouncement": { - "message": "Mới! Tính năng phát hiện token được cải tiến hiện đã có sẵn trên Mạng chính thức của Ethereum dưới dạng một tính năng thử nghiệm. $1" - }, - "tokenDetectionToggleDescription": { - "message": "API token của ConsenSys sẽ tổng hợp danh sách token từ các danh sách token của nhiều bên thứ ba khác nhau. Tắt tính năng này sẽ ngừng phát hiện token mới được thêm vào ví của bạn, nhưng sẽ giữ lại tùy chọn tìm kiếm token để nhập." - }, "tokenId": { "message": "ID Token" }, @@ -3851,6 +3913,9 @@ "unknownCameraErrorTitle": { "message": "Rất tiếc! Đã xảy ra sự cố...." }, + "unknownCollection": { + "message": "Bộ sưu tập chưa có tên" + }, "unknownNetwork": { "message": "Mạng riêng không xác định" }, @@ -3901,12 +3966,6 @@ "usePhishingDetectionDescription": { "message": "Hiển thị cảnh báo đối với các tên miền lừa đảo nhắm đến người dùng Ethereum" }, - "useTokenDetection": { - "message": "Sử Dụng Phát Hiện Token" - }, - "useTokenDetectionDescription": { - "message": "Chúng tôi sử dụng API của bên thứ ba để phát hiện và hiển thị các token mới được gửi vào ví của bạn. Hãy tắt tính năng này nếu bạn không muốn MetaMask lấy dữ liệu từ các dịch vụ đó." - }, "useTokenDetectionPrivacyDesc": { "message": "Tự động hiển thị các token được gửi vào tài khoản của bạn có liên quan đến hoạt động trao đổi thông tin với các máy chủ bên thứ ba để tìm nạp hình ảnh của token. Các máy chủ đó sẽ có quyền truy cập vào địa chỉ IP của bạn." }, @@ -3987,6 +4046,9 @@ "walletCreationSuccessTitle": { "message": "Tạo ví thành công" }, + "wantToAddThisNetwork": { + "message": "Bạn muốn thêm mạng này?" + }, "warning": { "message": "Cảnh báo" }, @@ -4049,6 +4111,10 @@ "yesLetsTry": { "message": "Có, hãy thử" }, + "youHaveAddedAll": { + "message": "Bạn đã thêm tất cả các mạng phổ biến. Bạn có thể khám phá thêm nhiều mạng khác $1 Hoặc bạn có thể $2", + "description": "$1 is a link with the text 'here' and $2 is a button with the text 'add more networks manually'" + }, "youNeedToAllowCameraAccess": { "message": "Bạn cần cho phép truy cập vào máy ảnh để sử dụng tính năng này." }, diff --git a/app/_locales/zh/messages.json b/app/_locales/zh/messages.json index 66984cbd4..37d0db906 100644 --- a/app/_locales/zh/messages.json +++ b/app/_locales/zh/messages.json @@ -157,6 +157,9 @@ "addMemo": { "message": "添加备忘录" }, + "addMoreNetworks": { + "message": "手动添加更多网络" + }, "addNetwork": { "message": "添加网络" }, @@ -227,6 +230,10 @@ "alerts": { "message": "提醒" }, + "allOfYour": { + "message": "您的所有$1", + "description": "$1 is the symbol or name of the token that the user is approving spending" + }, "allowExternalExtensionTo": { "message": "允许此外部扩展程序:" }, @@ -263,6 +270,10 @@ "approve": { "message": "批准消费限额" }, + "approveAllTokensTitle": { + "message": "是否允许访问您的所有$1?", + "description": "$1 is the symbol of the token for which the user is granting approval" + }, "approveAndInstall": { "message": "批准并安装" }, @@ -435,10 +446,10 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "使用 Wyre 购买 $1" + "message": "使用Wyre购买$1" }, "buyWithWyreDescription": { - "message": "您可以通过 Wyre 使用借记卡将 $1 存入您的 MetaMask 账户。" + "message": "购买不超过$1000可以轻松开通。快速交互式上限购买验证。支持借记卡/信用卡、Apple Pay、银行转账。适用于100多个国家。代币存入您的MetaMask账户" }, "bytes": { "message": "字节" @@ -466,6 +477,13 @@ "message": "若要$1交易,燃料费用必须增加至少10%才能被网络认可。", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwapForFee": { + "message": "以~$1取消兑换", + "description": "$1 could be e.g. $2.98, it is a cost for cancelling a Smart Transaction" + }, + "cancelSwapForFree": { + "message": "免费取消兑换" + }, "cancellationGasFee": { "message": "取消燃料费用" }, @@ -1196,9 +1214,6 @@ "failureMessage": { "message": "出了点问题,我们无法完成此操作" }, - "fakeTokenWarning": { - "message": "任何人都可以创建代币,包括创建现有代币的虚假版本。了解关于 $ 的更多详情" - }, "fast": { "message": "快" }, @@ -1277,6 +1292,9 @@ "functionApprove": { "message": "功能:批准" }, + "functionSetApprovalForAll": { + "message": "功能:SetApprovalForAll" + }, "functionType": { "message": "功能类型" }, @@ -1617,6 +1635,9 @@ "invalidSeedPhrase": { "message": "助记词无效" }, + "invalidSeedPhraseCaseSensitive": { + "message": "输入无效!助记词须区分大小写。" + }, "ipfsGateway": { "message": "IPFS 网关" }, @@ -1646,7 +1667,7 @@ "message": "已知合约地址。" }, "knownTokenWarning": { - "message": "此操作将编辑已经在您的钱包中列出的代币,有可能被用来欺骗您。只有确定要更改这些代币的内容时,才通过此操作。了解更多关于 $1" + "message": "此操作将编辑已经在您的钱包中列出的代币,有肯能被用来欺骗您。只有确定要更改这些代币的内容时,才通过此操作。了解更多关于 $1" }, "kovan": { "message": "Kovan 测试网络" @@ -1892,6 +1913,19 @@ "message": "验证网络信息", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." }, + "mismatchedChainRecommendation": { + "message": "我们建议您在继续之前$1。", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key. The link will open to instructions for users to validate custom network details." + }, + "mismatchedNetworkName": { + "message": "根据我们的记录,该网络名称可能与此链ID不匹配。" + }, + "mismatchedNetworkSymbol": { + "message": "所提交的货币符号与我们对此链ID的预期不匹配。" + }, + "mismatchedRpcUrl": { + "message": "根据我们的记录,所提交的RPC URL值与此链ID的已知提供者不匹配。" + }, "missingNFT": { "message": "找不到您的 NFT?" }, @@ -1943,6 +1977,9 @@ "network": { "message": "网络: " }, + "networkAddedSuccessfully": { + "message": "网络添加成功!" + }, "networkDetails": { "message": "网络详情" }, @@ -2059,6 +2096,9 @@ "message": "Nonce 高于建议的 nouce 值 $1", "description": "The next nonce according to MetaMask's internal logic" }, + "nft": { + "message": "非同质化代币(NFT)" + }, "nftTokenIdPlaceholder": { "message": "输入代币ID" }, @@ -2154,11 +2194,21 @@ "message": "启用黑暗模式" }, "notifications12Description": { - "message": "将根据新用户的系统偏好设置为其启用黑暗模式。对于现有用户,请在“设置 -> 实验项”下手动启用黑暗模式。" + "message": "扩展程序的深色模式终于来了!若要开启,请前往“设置 -> 实验项”,然后选择一个显示选项:浅色、深色、系统。" }, "notifications12Title": { "message": "何时启用黑暗模式?现在启用黑暗模式! 🕶️🦊" }, + "notifications13ActionText": { + "message": "显示自定义网络列表" + }, + "notifications13Description": { + "message": "您现在可以轻松添加以下热门自定义网络:Arbitrum、Avalanche、Binance Smart Chain、Fantom、Harmony、Optimism、Palm和Polygon!如需启用此功能,请转到“设置” -> “实验”,然后打开“显示自定义网络列表”!", + "description": "Description of a notification in the 'See What's New' popup. Describes popular network feature." + }, + "notifications13Title": { + "message": "添加热门网络" + }, "notifications1Description": { "message": "MetaMask Mobile 用户现在可以在他们的移动钱包中交换代币。扫描二维码以获取移动应用程序并开始交换。", "description": "Description of a notification in the 'See What's New' popup. Describes the swapping on mobile feature." @@ -2676,6 +2726,14 @@ "revealTheSeedPhrase": { "message": "显示助记词" }, + "revokeAllTokensTitle": { + "message": "撤销访问您的所有$1的权限?", + "description": "$1 is the symbol of the token for which the user is revoking approval" + }, + "revokeApproveForAllDescription": { + "message": "通过撤销权限,以下$1将无法再访问您的$2", + "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" + }, "rinkeby": { "message": "Rinkeby 测试网络" }, @@ -2852,12 +2910,23 @@ "message": "正在发送 $1", "description": "$1 represents the native currency symbol for the current network (e.g. ETH or BNB)" }, + "sendingToTokenContractWarning": { + "message": "警告:您将要发送到代币合约,这可能会导致资金损失。$1", + "description": "$1 is a clickable link with text defined by the 'learnMoreUpperCase' key. The link will open to a support article regarding the known contract address warning" + }, "setAdvancedPrivacySettings": { "message": "设置高级隐私设置" }, "setAdvancedPrivacySettingsDetails": { "message": "MetaMask 使用这些可信的第三方服务来提高产品可用性和安全性。" }, + "setApprovalForAll": { + "message": "设置批准所有" + }, + "setApprovalForAllTitle": { + "message": "批准$1,且无消费限制", + "description": "The token symbol that is being approved" + }, "settings": { "message": "设置" }, @@ -2877,6 +2946,12 @@ "showAdvancedGasInlineDescription": { "message": "选择此项可直接在发送和确认界面显示燃料价格和上限控制。" }, + "showCustomNetworkList": { + "message": "显示自定义网络列表" + }, + "showCustomNetworkListDescription": { + "message": "选择此项,在添加新网络时就会显示附有预填详细信息的网络列表。" + }, "showFiatConversionInTestnets": { "message": "在测试网络上显示转换" }, @@ -2967,10 +3042,6 @@ "snapInstallWarningCheck": { "message": "请勾选全部以确认您理解。" }, - "snapInstallWarningKeyAccess": { - "message": "您正在向snap \"$1\"授予密钥访问权限。此操作不可撤销,并会向\"$1\"授予对您的账户和资产的控制权。在继续之前,请确保您信任\"$1\"。", - "description": "The parameter is the name of the snap" - }, "snapRequestsPermission": { "message": "此Snap正在请求以下权限:" }, @@ -2986,6 +3057,9 @@ "snapsToggle": { "message": "Snap仅在启用后才会运行" }, + "someNetworksMayPoseSecurity": { + "message": "某些网络可能会带来安全和/或隐私风险。在添加和使用网络之前,请先了解风险。" + }, "somethingWentWrong": { "message": "哎呀!出了点问题。" }, @@ -3548,6 +3622,10 @@ "switchNetworks": { "message": "切换网络" }, + "switchToNetwork": { + "message": "切换至$1", + "description": "$1 represents the custom network that has previously been added" + }, "switchToThisAccount": { "message": "切换到该账户" }, @@ -3664,9 +3742,6 @@ "tokenDetectionAlertMessage": { "message": "代币检测目前适用于 $1. $2" }, - "tokenDetectionAnnouncement": { - "message": "新功能!以太坊主网上提供了经过改进的代币检测作为实验功能。$1" - }, "tokenDetectionToggleDescription": { "message": "ConsenSys的代币API使用来自各种第三方的代币列表,汇总成一个代币列表。关闭它将会停止检测添加到您钱包中的新代币,但会保留搜索代币以导入的选项。" }, @@ -3851,6 +3926,9 @@ "unknownCameraErrorTitle": { "message": "糟糕!出问题了...." }, + "unknownCollection": { + "message": "未命名的收藏" + }, "unknownNetwork": { "message": "未知的私有网络" }, @@ -3901,12 +3979,6 @@ "usePhishingDetectionDescription": { "message": "显示针对 Ethereum 用户的网络钓鱼域名警告" }, - "useTokenDetection": { - "message": "使用代币检测" - }, - "useTokenDetectionDescription": { - "message": "我们使用第三方 API 来检测和显示发送到您钱包的新代币。如果您不希望 MetaMask 从这些服务中提取数据,请关闭。" - }, "useTokenDetectionPrivacyDesc": { "message": "要自动显示发送到您账户的代币,需要与第三方服务器通信以获取代币的图像。这些服务器将拥有您的IP地址的访问权限。" }, @@ -3987,6 +4059,9 @@ "walletCreationSuccessTitle": { "message": "钱包创建成功" }, + "wantToAddThisNetwork": { + "message": "想要添加此网络吗?" + }, "warning": { "message": "警告" }, @@ -4049,6 +4124,10 @@ "yesLetsTry": { "message": "是的,我们试一下" }, + "youHaveAddedAll": { + "message": "您已经添加了所有热门网络。您可以探索更多网络$1,或者您可以$2", + "description": "$1 is a link with the text 'here' and $2 is a button with the text 'add more networks manually'" + }, "youNeedToAllowCameraAccess": { "message": "需要开启相机访问权限,才能使用该功能。" }, diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index 64633eb4b..147485e81 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -613,7 +613,7 @@ }, "customGasSettingToolTipMessage": { "message": "使用$1来定制燃料价格。如果您不熟悉这可能会引起混淆。操作风险自付。", - "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'advanced' (text: 'Advanced') separated here so that it can be passed in with bold font-weight" }, "customGasSubTitle": { "message": "提升费用可能会缩短处理时间,但不保证绝对有效。" @@ -1017,9 +1017,6 @@ "failureMessage": { "message": "出了点问题,我们无法完成这个操作。" }, - "fakeTokenWarning": { - "message": "任何人都可以创建代币,包括创建现有代币的假版本。了解更多关于 $1" - }, "fast": { "message": "快" }, @@ -1233,7 +1230,7 @@ }, "highGasSettingToolTipMessage": { "message": "使用$1来覆盖网络流量因像流行的 NFT 丢弃而出现的剧增。", - "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'high' (text: 'Aggressive') separated here so that it can be passed in with bold font-weight" }, "highLowercase": { "message": "高" @@ -1484,7 +1481,7 @@ }, "lowGasSettingToolTipMessage": { "message": "使用$1等待较便宜的价格。时间估计远不准确,因为价格有些难以预测。", - "description": "$1 is key 'low' separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'low' separated here so that it can be passed in with bold font-weight" }, "lowLowercase": { "message": "低" @@ -1519,7 +1516,7 @@ }, "mediumGasSettingToolTipMessage": { "message": "使用$1按当前市场价格快速处理。", - "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold fontweight" + "description": "$1 is key 'medium' (text: 'Market') separated here so that it can be passed in with bold font-weight" }, "memo": { "message": "备忘" @@ -1865,7 +1862,7 @@ }, "notifications8ActionText": { "message": "转到高级设置", - "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced Settings page." + "description": "Description on an action button that appears in the What's New popup. Tells the user that if they click it, they will go to our Advanced settings page." }, "notifications8DescriptionOne": { "message": "从MetaMaskv10.4.0开始,您不再需要Ledger Live连接您的Ledger设备到Metamask。", @@ -2039,7 +2036,7 @@ }, "preferredLedgerConnectionType": { "message": "首选Ledger连接类型", - "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" + "description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message" }, "prev": { "message": "上一个" @@ -2952,7 +2949,7 @@ }, "toggleTestNetworks": { "message": "$1 测试网络", - "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open to the advanced settings where users can enable the display of test networks in the network dropdown." + "description": "$1 is a clickable link with text defined by the 'showHide' key. The link will open Settings > Advanced where users can enable the display of test networks in the network dropdown." }, "token": { "message": "代币" @@ -2966,9 +2963,6 @@ "tokenDecimalFetchFailed": { "message": "需要代币十进制。" }, - "tokenDetectionAnnouncement": { - "message": "新功能!改进的代币检测可以作为实验功能在Ethereum Mainnet上进行。$1" - }, "tokenSymbol": { "message": "代币符号" }, @@ -3178,12 +3172,6 @@ "usePhishingDetectionDescription": { "message": "显示针对 Ethereum 用户钓鱼域名的警告。" }, - "useTokenDetection": { - "message": "使用代币检测" - }, - "useTokenDetectionDescription": { - "message": "我们使用第三方API来检测和显示发送到您钱包的新代币。 如果您不想从这些服务中拉取数据,请关闭" - }, "usedByClients": { "message": "可用于各种不同的客户端" }, diff --git a/app/fonts/Euclid/EuclidCircularB-Medium.ttf b/app/fonts/Euclid/EuclidCircularB-Medium.ttf new file mode 100644 index 000000000..7a2ae44a1 Binary files /dev/null and b/app/fonts/Euclid/EuclidCircularB-Medium.ttf differ diff --git a/app/home.html b/app/home.html index 46bbb857e..4a4df3f4e 100644 --- a/app/home.html +++ b/app/home.html @@ -10,7 +10,7 @@
- +
diff --git a/app/images/eth_badge.svg b/app/images/eth_badge.svg new file mode 100644 index 000000000..90063426f --- /dev/null +++ b/app/images/eth_badge.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/app/manifest/v3/_base.json b/app/manifest/v3/_base.json index 3980afdc5..7b28cd2ed 100644 --- a/app/manifest/v3/_base.json +++ b/app/manifest/v3/_base.json @@ -47,6 +47,7 @@ ], "default_locale": "en", "description": "__MSG_appDescription__", + "host_permissions": ["file://*/*", "http://*/*", "https://*/*"], "icons": { "16": "images/icon-16.png", "19": "images/icon-19.png", @@ -61,6 +62,7 @@ "name": "__MSG_appName__", "permissions": [ "storage", + "scripting", "unlimitedStorage", "clipboardWrite", "http://localhost:8545/", @@ -72,11 +74,5 @@ "*://*.eth/", "notifications" ], - "short_name": "__MSG_appName__", - "web_accessible_resources": [ - { - "resources": ["inpage.js", "phishing.html"], - "matches": ["http://*/*", "https://*/*"] - } - ] + "short_name": "__MSG_appName__" } diff --git a/app/scripts/app-init.js b/app/scripts/app-init.js index 7b9c1dfd1..4ae247c5b 100644 --- a/app/scripts/app-init.js +++ b/app/scripts/app-init.js @@ -1,42 +1,87 @@ +/* global chrome */ +// This file is used only for manifest version 3 + +// Represents if importAllScripts has been run +// eslint-disable-next-line +let scriptsLoadInitiated = false; + +const testMode = process.env.IN_TEST; + +const loadTimeLogs = []; + // eslint-disable-next-line import/unambiguous function tryImport(...fileNames) { try { + const startTime = new Date().getTime(); // eslint-disable-next-line importScripts(...fileNames); + const endTime = new Date().getTime(); + loadTimeLogs.push({ + name: fileNames[0], + value: endTime - startTime, + children: [], + startTime, + endTime, + }); + return true; } catch (e) { console.error(e); - return false; } + + return false; } function importAllScripts() { + // Bail if we've already imported scripts + if (scriptsLoadInitiated) { + return; + } + scriptsLoadInitiated = true; + const files = []; + + // In testMode individual files are imported, this is to help capture load time stats + const loadFile = (fileName) => { + if (testMode) { + tryImport(fileName); + } else { + files.push(fileName); + } + }; + const startImportScriptsTime = Date.now(); + // value of applyLavaMoat below is dynamically replaced at build time with actual value - const applyLavaMoat = true; + const applyLavaMoat = process.env.APPLY_LAVAMOAT; + if (typeof applyLavaMoat !== 'boolean') { + throw new Error('Missing APPLY_LAVAMOAT environment variable'); + } - tryImport('./globalthis.js'); - tryImport('./sentry-install.js'); + loadFile('./globalthis.js'); + loadFile('./sentry-install.js'); - if (applyLavaMoat) { - tryImport('./runtime-lavamoat.js'); - tryImport('./lockdown-more.js'); - tryImport('./policy-load.js'); + // Always apply LavaMoat in e2e test builds, so that we can capture initialization stats + if (testMode || applyLavaMoat) { + loadFile('./runtime-lavamoat.js'); + loadFile('./lockdown-more.js'); + loadFile('./policy-load.js'); } else { - tryImport('./init-globals.js'); - tryImport('./lockdown-install.js'); - tryImport('./lockdown-run.js'); - tryImport('./lockdown-more.js'); - tryImport('./runtime-cjs.js'); + loadFile('./init-globals.js'); + loadFile('./lockdown-install.js'); + loadFile('./lockdown-run.js'); + loadFile('./lockdown-more.js'); + loadFile('./runtime-cjs.js'); } - const fileList = [ - // The list of files is injected at build time by replacing comment below with comma separated strings of file names - // https://github.com/MetaMask/metamask-extension/blob/496d9d81c3367931031edc11402552690c771acf/development/build/scripts.js#L406 - /** FILE NAMES */ - ]; + // This environment variable is set to a string of comma-separated relative file paths. + const rawFileList = process.env.FILE_NAMES; + const fileList = rawFileList.split(','); + fileList.forEach((fileName) => loadFile(fileName)); + + // Import all required resources + tryImport(...files); - fileList.forEach((fileName) => tryImport(fileName)); + const endImportScriptsTime = Date.now(); // for performance metrics/reference console.log( @@ -44,7 +89,55 @@ function importAllScripts() { (Date.now() - startImportScriptsTime) / 1000 }`, ); + + // In testMode load time logs are output to console + if (testMode) { + console.log( + `Time for each import: ${JSON.stringify( + { + name: 'Total', + children: loadTimeLogs, + startTime: startImportScriptsTime, + endTime: endImportScriptsTime, + value: endImportScriptsTime - startImportScriptsTime, + version: 1, + }, + undefined, + ' ', + )}`, + ); + } } -// Placing script import call here ensures that scripts are inported each time service worker is activated. -importAllScripts(); +// Ref: https://stackoverflow.com/questions/66406672/chrome-extension-mv3-modularize-service-worker-js-file +// eslint-disable-next-line no-undef +self.addEventListener('install', importAllScripts); + +/* + * A keepalive message listener to prevent Service Worker getting shut down due to inactivity. + * UI sends the message periodically, in a setInterval. + * Chrome will revive the service worker if it was shut down, whenever a new message is sent, but only if a listener was defined here. + * + * chrome below needs to be replaced by cross-browser object, + * but there is issue in importing webextension-polyfill into service worker. + * chrome does seems to work in at-least all chromium based browsers + */ +chrome.runtime.onMessage.addListener(() => { + importAllScripts(); + return false; +}); + +/* + * This content script is injected programmatically because + * MAIN world injection does not work properly via manifest + * https://bugs.chromium.org/p/chromium/issues/detail?id=634381 + */ +chrome.scripting.registerContentScripts([ + { + id: 'inpage', + matches: ['file://*/*', 'http://*/*', 'https://*/*'], + js: ['inpage.js'], + runAt: 'document_start', + world: 'MAIN', + }, +]); diff --git a/app/scripts/background.js b/app/scripts/background.js index e0caed345..084a0f0e6 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -22,6 +22,9 @@ import { SECOND } from '../../shared/constants/time'; import { REJECT_NOTFICIATION_CLOSE, REJECT_NOTFICIATION_CLOSE_SIG, + EVENT, + EVENT_NAMES, + TRAITS, } from '../../shared/constants/metametrics'; import { isManifestV3 } from '../../shared/modules/mv3.utils'; import { maskObject } from '../../shared/modules/object.utils'; @@ -69,6 +72,7 @@ let notificationIsOpen = false; let uiIsTriggering = false; const openMetamaskTabsIDs = {}; const requestAccountTabIds = {}; +let controller; // state persistence const inTest = process.env.IN_TEST; @@ -96,7 +100,7 @@ const initApp = async (remotePort) => { log.info('MetaMask initialization complete.'); }; -if (isManifestV3()) { +if (isManifestV3) { browser.runtime.onConnect.addListener(initApp); } else { // initialization flow @@ -314,7 +318,7 @@ function setupController(initState, initLangCode, remoteSourcePort) { // MetaMask Controller // - const controller = new MetamaskController({ + controller = new MetamaskController({ infuraProjectId: process.env.INFURA_PROJECT_ID, // User confirmation callbacks: showUserConfirmation: triggerUi, @@ -398,7 +402,7 @@ function setupController(initState, initLangCode, remoteSourcePort) { // // connect to other contexts // - if (isManifestV3() && remoteSourcePort) { + if (isManifestV3 && remoteSourcePort) { connectRemote(remoteSourcePort); } @@ -472,7 +476,7 @@ function setupController(initState, initLangCode, remoteSourcePort) { controller.isClientOpen = true; controller.setupTrustedCommunication(portStream, remotePort.sender); - if (isManifestV3()) { + if (isManifestV3) { // Message below if captured by UI code in app/scripts/ui.js which will trigger UI initialisation // This ensures that UI is initialised only after background is ready // It fixes the issue of blank screen coming when extension is loaded, the issue is very frequent in MV3 @@ -601,7 +605,7 @@ function setupController(initState, initLangCode, remoteSourcePort) { label = String(count); } // browserAction has been replaced by action in MV3 - if (isManifestV3()) { + if (isManifestV3) { browser.action.setBadgeText({ text: label }); browser.action.setBadgeBackgroundColor({ color: '#037DD6' }); } else { @@ -615,11 +619,11 @@ function setupController(initState, initLangCode, remoteSourcePort) { const { unapprovedMsgCount } = controller.messageManager; const { unapprovedPersonalMsgCount } = controller.personalMessageManager; const { unapprovedDecryptMsgCount } = controller.decryptMessageManager; - const { - unapprovedEncryptionPublicKeyMsgCount, - } = controller.encryptionPublicKeyManager; + const { unapprovedEncryptionPublicKeyMsgCount } = + controller.encryptionPublicKeyManager; const { unapprovedTypedMessagesCount } = controller.typedMessageManager; - const pendingApprovalCount = controller.approvalController.getTotalApprovalCount(); + const pendingApprovalCount = + controller.approvalController.getTotalApprovalCount(); const waitingForUnlockCount = controller.appStateController.waitingForUnlock.length; return ( @@ -751,12 +755,32 @@ async function openPopup() { }); } +// It adds the "App Installed" event into a queue of events, which will be tracked only after a user opts into metrics. +const addAppInstalledEvent = () => { + if (controller) { + controller.metaMetricsController.updateTraits({ + [TRAITS.INSTALL_DATE_EXT]: new Date().toISOString().split('T')[0], // yyyy-mm-dd + }); + controller.metaMetricsController.addEventBeforeMetricsOptIn({ + category: EVENT.CATEGORIES.APP, + event: EVENT_NAMES.APP_INSTALLED, + properties: {}, + }); + return; + } + setTimeout(() => { + // If the controller is not set yet, we wait and try to add the "App Installed" event again. + addAppInstalledEvent(); + }, 1000); +}; + // On first install, open a new tab with MetaMask browser.runtime.onInstalled.addListener(({ reason }) => { if ( reason === 'install' && !(process.env.METAMASK_DEBUG || process.env.IN_TEST) ) { + addAppInstalledEvent(); platform.openExtensionInBrowser(); } }); diff --git a/app/scripts/constants/contracts.js b/app/scripts/constants/contracts.js index 90df403c2..e822ccc7e 100644 --- a/app/scripts/constants/contracts.js +++ b/app/scripts/constants/contracts.js @@ -6,3 +6,17 @@ export const SINGLE_CALL_BALANCES_ADDRESS_ROPSTEN = '0xb8e671734ce5c8d7dfbbea5574fa4cf39f7a54a4'; export const SINGLE_CALL_BALANCES_ADDRESS_KOVAN = '0xb1d3fbb2f83aecd196f474c16ca5d9cffa0d0ffc'; +export const SINGLE_CALL_BALANCES_ADDRESS_GOERLI = + '0x9788C4E93f9002a7ad8e72633b11E8d1ecd51f9b'; +export const SINGLE_CALL_BALANCES_ADDRESS_BSC = + '0x2352c63A83f9Fd126af8676146721Fa00924d7e4'; +export const SINGLE_CALL_BALANCES_ADDRESS_OPTIMISM = + '0xB1c568e9C3E6bdaf755A60c7418C269eb11524FC'; +export const SINGLE_CALL_BALANCES_ADDRESS_POLYGON = + '0x2352c63A83f9Fd126af8676146721Fa00924d7e4'; +export const SINGLE_CALL_BALANCES_ADDRESS_AVALANCHE = + '0xD023D153a0DFa485130ECFdE2FAA7e612EF94818'; +export const SINGLE_CALL_BALANCES_ADDRESS_FANTOM = + '0x07f697424ABe762bB808c109860c04eA488ff92B'; +export const SINGLE_CALL_BALANCES_ADDRESS_ARBITRUM = + '0x151E24A486D7258dd7C33Fb67E4bB01919B7B32c'; diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index 5250a010e..a6fb3bcd1 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -1,4 +1,3 @@ -import querystring from 'querystring'; import pump from 'pump'; import { WindowPostMessageStream } from '@metamask/post-message-stream'; import ObjectMultiplex from 'obj-multiplex'; @@ -7,6 +6,7 @@ import PortStream from 'extension-port-stream'; import { obj as createThoughStream } from 'through2'; import { isManifestV3 } from '../../shared/modules/mv3.utils'; +import shouldInjectProvider from '../../shared/modules/provider-injection'; // These require calls need to use require to be statically recognized by browserify const fs = require('fs'); @@ -28,6 +28,8 @@ const PHISHING_WARNING_PAGE = 'metamask-phishing-warning-page'; const PHISHING_SAFELIST = 'metamask-phishing-safelist'; const PROVIDER = 'metamask-provider'; +// For more information about these legacy streams, see here: +// https://github.com/MetaMask/metamask-extension/issues/15491 // TODO:LegacyProvider: Delete const LEGACY_CONTENT_SCRIPT = 'contentscript'; const LEGACY_INPAGE = 'inpage'; @@ -42,7 +44,9 @@ if ( ) { setupPhishingStream(); } else if (shouldInjectProvider()) { - injectScript(inpageBundle); + if (!isManifestV3) { + injectScript(inpageBundle); + } setupStreams(); } @@ -56,12 +60,7 @@ function injectScript(content) { const container = document.head || document.documentElement; const scriptTag = document.createElement('script'); scriptTag.setAttribute('async', 'false'); - // Inline scripts do not work in MV3 due to more strict security policy - if (isManifestV3()) { - scriptTag.setAttribute('src', browser.runtime.getURL('inpage.js')); - } else { - scriptTag.textContent = content; - } + scriptTag.textContent = content; container.insertBefore(scriptTag, container.children[0]); container.removeChild(scriptTag); } catch (error) { @@ -263,108 +262,17 @@ function notifyInpageOfStreamFailure() { ); } -/** - * Determines if the provider should be injected - * - * @returns {boolean} {@code true} Whether the provider should be injected - */ -function shouldInjectProvider() { - return ( - doctypeCheck() && - suffixCheck() && - documentElementCheck() && - !blockedDomainCheck() - ); -} - -/** - * Checks the doctype of the current document if it exists - * - * @returns {boolean} {@code true} if the doctype is html or if none exists - */ -function doctypeCheck() { - const { doctype } = window.document; - if (doctype) { - return doctype.name === 'html'; - } - return true; -} - -/** - * Returns whether or not the extension (suffix) of the current document is prohibited - * - * This checks {@code window.location.pathname} against a set of file extensions - * that we should not inject the provider into. This check is indifferent of - * query parameters in the location. - * - * @returns {boolean} whether or not the extension of the current document is prohibited - */ -function suffixCheck() { - const prohibitedTypes = [/\.xml$/u, /\.pdf$/u]; - const currentUrl = window.location.pathname; - for (let i = 0; i < prohibitedTypes.length; i++) { - if (prohibitedTypes[i].test(currentUrl)) { - return false; - } - } - return true; -} - -/** - * Checks the documentElement of the current document - * - * @returns {boolean} {@code true} if the documentElement is an html node or if none exists - */ -function documentElementCheck() { - const documentElement = document.documentElement.nodeName; - if (documentElement) { - return documentElement.toLowerCase() === 'html'; - } - return true; -} - -/** - * Checks if the current domain is blocked - * - * @returns {boolean} {@code true} if the current domain is blocked - */ -function blockedDomainCheck() { - const blockedDomains = [ - 'adyen.com', - 'ani.gamer.com.tw', - 'blueskybooking.com', - 'cdn.shopify.com/s/javascripts/tricorder/xtld-read-only-frame.html', - 'docs.google.com', - 'dropbox.com', - 'gravityforms.com', - 'harbourair.com', - 'sharefile.com', - 'uscourts.gov', - 'webbyawards.com', - ]; - const currentUrl = window.location.href; - let currentRegex; - for (let i = 0; i < blockedDomains.length; i++) { - const blockedDomain = blockedDomains[i].replace('.', '\\.'); - currentRegex = new RegExp( - `(?:https?:\\/\\/)(?:(?!${blockedDomain}).)*$`, - 'u', - ); - if (!currentRegex.test(currentUrl)) { - return true; - } - } - return false; -} - /** * Redirects the current page to a phishing information page + * + * @param data */ -function redirectToPhishingWarning() { +function redirectToPhishingWarning(data = {}) { console.debug('MetaMask: Routing to Phishing Warning page.'); + const { hostname, href } = window.location; + const { newIssueUrl } = data; const baseUrl = process.env.PHISHING_WARNING_PAGE_URL; - window.location.href = `${baseUrl}#${querystring.stringify({ - hostname: window.location.hostname, - href: window.location.href, - })}`; + + const querystring = new URLSearchParams({ hostname, href, newIssueUrl }); + window.location.href = `${baseUrl}#${querystring}`; } diff --git a/app/scripts/controllers/app-state.js b/app/scripts/controllers/app-state.js index 5bf237e31..4dee8a8c3 100644 --- a/app/scripts/controllers/app-state.js +++ b/app/scripts/controllers/app-state.js @@ -37,6 +37,14 @@ export default class AppStateController extends EventEmitter { ...initState, qrHardware: {}, collectiblesDropdownState: {}, + usedNetworks: { + '0x1': true, + '0x2a': true, + '0x3': true, + '0x4': true, + '0x5': true, + '0x539': true, + }, }); this.timer = null; @@ -294,4 +302,18 @@ export default class AppStateController extends EventEmitter { collectiblesDropdownState, }); } + + /** + * Updates the array of the first time used networks + * + * @param chainId + * @returns {void} + */ + setFirstTimeUsedNetwork(chainId) { + const currentState = this.store.getState(); + const { usedNetworks } = currentState; + usedNetworks[chainId] = true; + + this.store.updateState({ usedNetworks }); + } } diff --git a/app/scripts/controllers/backup.js b/app/scripts/controllers/backup.js new file mode 100644 index 000000000..4d7b5c371 --- /dev/null +++ b/app/scripts/controllers/backup.js @@ -0,0 +1,77 @@ +import { exportAsFile } from '../../../shared/modules/export-utils'; +import { prependZero } from '../../../shared/modules/string-utils'; + +export default class BackupController { + constructor(opts = {}) { + const { + preferencesController, + addressBookController, + trackMetaMetricsEvent, + } = opts; + + this.preferencesController = preferencesController; + this.addressBookController = addressBookController; + this._trackMetaMetricsEvent = trackMetaMetricsEvent; + } + + async restoreUserData(jsonString) { + const existingPreferences = this.preferencesController.store.getState(); + const { preferences, addressBook } = JSON.parse(jsonString); + if (preferences) { + preferences.identities = existingPreferences.identities; + preferences.lostIdentities = existingPreferences.lostIdentities; + preferences.selectedAddress = existingPreferences.selectedAddress; + + this.preferencesController.store.updateState(preferences); + } + + if (addressBook) { + this.addressBookController.update(addressBook, true); + } + + if (preferences && addressBook) { + this._trackMetaMetricsEvent({ + event: 'User Data Imported', + category: 'Backup', + }); + } + } + + async backupUserData() { + const userData = { + preferences: { ...this.preferencesController.store.getState() }, + addressBook: { ...this.addressBookController.state }, + }; + + /** + * We can remove these properties since we will won't be restoring identities from backup + */ + delete userData.preferences.identities; + delete userData.preferences.lostIdentities; + delete userData.preferences.selectedAddress; + + const result = JSON.stringify(userData); + + const date = new Date(); + + const prefixZero = (num) => prependZero(num, 2); + + /* + * userData.YYYY_MM_DD_HH_mm_SS e.g userData.2022_01_13_13_45_56 + * */ + const userDataFileName = `MetaMaskUserData.${date.getFullYear()}_${prefixZero( + date.getMonth() + 1, + )}_${prefixZero(date.getDay())}_${prefixZero(date.getHours())}_${prefixZero( + date.getMinutes(), + )}_${prefixZero(date.getDay())}.json`; + + exportAsFile(userDataFileName, result); + + this._trackMetaMetricsEvent({ + event: 'User Data Exported', + category: 'Backup', + }); + + return result; + } +} diff --git a/app/scripts/controllers/backup.test.js b/app/scripts/controllers/backup.test.js new file mode 100644 index 000000000..b4e740bcf --- /dev/null +++ b/app/scripts/controllers/backup.test.js @@ -0,0 +1,118 @@ +import { strict as assert } from 'assert'; +import sinon from 'sinon'; +import BackupController from './backup'; + +function getMockController() { + const mcState = { + getSelectedAddress: sinon.stub().returns('0x01'), + selectedAddress: '0x01', + identities: { + '0x295e26495CEF6F69dFA69911d9D8e4F3bBadB89B': { + address: '0x295e26495CEF6F69dFA69911d9D8e4F3bBadB89B', + lastSelected: 1655380342907, + name: 'Account 3', + }, + }, + lostIdentities: { + '0xfd59bbe569376e3d3e4430297c3c69ea93f77435': { + address: '0xfd59bbe569376e3d3e4430297c3c69ea93f77435', + lastSelected: 1655379648197, + name: 'Ledger 1', + }, + }, + update: (store) => (mcState.store = store), + }; + + mcState.store = { + getState: sinon.stub().returns(mcState), + updateState: (store) => (mcState.store = store), + }; + + return mcState; +} + +const jsonData = `{"preferences":{"frequentRpcListDetail":[{"chainId":"0x539","nickname":"Localhost 8545","rpcPrefs":{},"rpcUrl":"http://localhost:8545","ticker":"ETH"},{"chainId":"0x38","nickname":"Binance Smart Chain Mainnet","rpcPrefs":{"blockExplorerUrl":"https://bscscan.com"},"rpcUrl":"https://bsc-dataseed1.binance.org","ticker":"BNB"},{"chainId":"0x61","nickname":"Binance Smart Chain Testnet","rpcPrefs":{"blockExplorerUrl":"https://testnet.bscscan.com"},"rpcUrl":"https://data-seed-prebsc-1-s1.binance.org:8545","ticker":"tBNB"},{"chainId":"0x89","nickname":"Polygon Mainnet","rpcPrefs":{"blockExplorerUrl":"https://polygonscan.com"},"rpcUrl":"https://polygon-rpc.com","ticker":"MATIC"}],"useBlockie":false,"useNonceField":false,"usePhishDetect":true,"dismissSeedBackUpReminder":false,"useTokenDetection":false,"useCollectibleDetection":false,"openSeaEnabled":false,"advancedGasFee":null,"featureFlags":{"sendHexData":true,"showIncomingTransactions":true},"knownMethodData":{},"currentLocale":"en","forgottenPassword":false,"preferences":{"hideZeroBalanceTokens":false,"showFiatInTestnets":false,"showTestNetworks":true,"useNativeCurrencyAsPrimaryCurrency":true},"ipfsGateway":"dweb.link","infuraBlocked":false,"ledgerTransportType":"webhid","theme":"light","customNetworkListEnabled":false,"textDirection":"auto"},"addressBook":{"addressBook":{"0x61":{"0x42EB768f2244C8811C63729A21A3569731535f06":{"address":"0x42EB768f2244C8811C63729A21A3569731535f06","chainId":"0x61","isEns":false,"memo":"","name":""}}}}}`; + +describe('BackupController', function () { + const getBackupController = () => { + return new BackupController({ + preferencesController: getMockController(), + addressBookController: getMockController(), + trackMetaMetricsEvent: sinon.stub(), + }); + }; + + describe('constructor', function () { + it('should setup correctly', async function () { + const backupController = getBackupController(); + const selectedAddress = + backupController.preferencesController.getSelectedAddress(); + assert.equal(selectedAddress, '0x01'); + }); + + it('should restore backup', async function () { + const backupController = getBackupController(); + backupController.restoreUserData(jsonData); + // check Preferences backup + assert.equal( + backupController.preferencesController.store.frequentRpcListDetail[0] + .chainId, + '0x539', + ); + assert.equal( + backupController.preferencesController.store.frequentRpcListDetail[1] + .chainId, + '0x38', + ); + // make sure identities are not lost after restore + assert.equal( + backupController.preferencesController.store.identities[ + '0x295e26495CEF6F69dFA69911d9D8e4F3bBadB89B' + ].lastSelected, + 1655380342907, + ); + assert.equal( + backupController.preferencesController.store.identities[ + '0x295e26495CEF6F69dFA69911d9D8e4F3bBadB89B' + ].name, + 'Account 3', + ); + assert.equal( + backupController.preferencesController.store.lostIdentities[ + '0xfd59bbe569376e3d3e4430297c3c69ea93f77435' + ].lastSelected, + 1655379648197, + ); + assert.equal( + backupController.preferencesController.store.lostIdentities[ + '0xfd59bbe569376e3d3e4430297c3c69ea93f77435' + ].name, + 'Ledger 1', + ); + // make sure selected address is not lost after restore + assert.equal( + backupController.preferencesController.store.selectedAddress, + '0x01', + ); + // check address book backup + assert.equal( + backupController.addressBookController.store.addressBook['0x61'][ + '0x42EB768f2244C8811C63729A21A3569731535f06' + ].chainId, + '0x61', + ); + assert.equal( + backupController.addressBookController.store.addressBook['0x61'][ + '0x42EB768f2244C8811C63729A21A3569731535f06' + ].address, + '0x42EB768f2244C8811C63729A21A3569731535f06', + ); + assert.equal( + backupController.addressBookController.store.addressBook['0x61'][ + '0x42EB768f2244C8811C63729A21A3569731535f06' + ].isEns, + false, + ); + }); + }); +}); diff --git a/app/scripts/controllers/detect-tokens.js b/app/scripts/controllers/detect-tokens.js index 697887c2f..daef5c7ac 100644 --- a/app/scripts/controllers/detect-tokens.js +++ b/app/scripts/controllers/detect-tokens.js @@ -1,13 +1,14 @@ import Web3 from 'web3'; import { warn } from 'loglevel'; -import SINGLE_CALL_BALANCES_ABI from 'single-call-balance-checker-abi'; -import { SINGLE_CALL_BALANCES_ADDRESS } from '../constants/contracts'; import { MINUTE } from '../../../shared/constants/time'; import { MAINNET_CHAIN_ID } from '../../../shared/constants/network'; +import { STATIC_MAINNET_TOKEN_LIST } from '../../../shared/constants/tokens'; import { isTokenDetectionEnabledForNetwork } from '../../../shared/modules/network.utils'; import { isEqualCaseInsensitive } from '../../../shared/modules/string-utils'; -import { TOKEN_STANDARDS } from '../../../ui/helpers/constants/common'; -import { ASSET_TYPES } from '../../../shared/constants/transaction'; +import { + ASSET_TYPES, + TOKEN_STANDARDS, +} from '../../../shared/constants/transaction'; import { EVENT, EVENT_NAMES } from '../../../shared/constants/metametrics'; // By default, poll every 3 minutes @@ -48,14 +49,15 @@ export default class DetectTokensController { this.network = network; this.keyringMemStore = keyringMemStore; this.tokenList = tokenList; + this.useTokenDetection = + this.preferences?.store.getState().useTokenDetection; this.selectedAddress = this.preferences?.store.getState().selectedAddress; this.tokenAddresses = this.tokensController?.state.tokens.map((token) => { return token.address; }); this.hiddenTokens = this.tokensController?.state.ignoredTokens; - this.detectedTokens = process.env.TOKEN_DETECTION_V2 - ? this.tokensController?.state.detectedTokens - : []; + this.detectedTokens = this.tokensController?.state.detectedTokens; + this.chainId = this.getChainIdFromNetworkStore(network); this._trackMetaMetricsEvent = trackMetaMetricsEvent; preferences?.store.subscribe(({ selectedAddress, useTokenDetection }) => { @@ -74,32 +76,11 @@ export default class DetectTokensController { return token.address; }); this.hiddenTokens = ignoredTokens; - this.detectedTokens = process.env.TOKEN_DETECTION_V2 - ? detectedTokens - : []; + this.detectedTokens = detectedTokens; }, ); } - /** - * TODO: Remove during TOKEN_DETECTION_V2 feature flag clean up - * - * @param tokens - */ - async _getTokenBalances(tokens) { - const ethContract = this.web3.eth - .contract(SINGLE_CALL_BALANCES_ABI) - .at(SINGLE_CALL_BALANCES_ADDRESS); - return new Promise((resolve, reject) => { - ethContract.balances([this.selectedAddress], tokens, (error, result) => { - if (error) { - return reject(error); - } - return resolve(result); - }); - }); - } - /** * For each token in the tokenlist provided by the TokenListController, check selectedAddress balance. */ @@ -108,31 +89,33 @@ export default class DetectTokensController { return; } if ( - process.env.TOKEN_DETECTION_V2 && - (!this.useTokenDetection || - !isTokenDetectionEnabledForNetwork( - this._network.store.getState().provider.chainId, - )) + !isTokenDetectionEnabledForNetwork( + this.getChainIdFromNetworkStore(this._network), + ) ) { return; } - const { tokenList } = this._tokenList.state; - // since the token detection is currently enabled only on Mainnet - // we can use the chainId check to ensure token detection is not triggered for any other network - // but once the balance check contract for other networks are deploayed and ready to use, we need to update this check. if ( - !process.env.TOKEN_DETECTION_V2 && - (this._network.store.getState().provider.chainId !== MAINNET_CHAIN_ID || - Object.keys(tokenList).length === 0) + !this.useTokenDetection && + this.getChainIdFromNetworkStore(this._network) !== MAINNET_CHAIN_ID ) { return; } + const isTokenDetectionInactiveInMainnet = + !this.useTokenDetection && + this.getChainIdFromNetworkStore(this._network) === MAINNET_CHAIN_ID; + const { tokenList } = this._tokenList.state; + + const tokenListUsed = isTokenDetectionInactiveInMainnet + ? STATIC_MAINNET_TOKEN_LIST + : tokenList; + const tokensToDetect = []; this.web3.setProvider(this._network._provider); - for (const tokenAddress in tokenList) { + for (const tokenAddress in tokenListUsed) { if ( - !this.tokenAddresses.find((address) => + !this.tokenAddresses.find(({ address }) => isEqualCaseInsensitive(address, tokenAddress), ) && !this.hiddenTokens.find((address) => @@ -152,12 +135,10 @@ export default class DetectTokensController { for (const tokensSlice of sliceOfTokensToDetect) { let result; try { - result = process.env.TOKEN_DETECTION_V2 - ? await this.assetsContractController.getBalancesInSingleCall( - this.selectedAddress, - tokensSlice, - ) - : await this._getTokenBalances(tokensSlice); + result = await this.assetsContractController.getBalancesInSingleCall( + this.selectedAddress, + tokensSlice, + ); } catch (error) { warn( `MetaMask - DetectTokensController single call balance fetch failed`, @@ -166,58 +147,36 @@ export default class DetectTokensController { return; } - let tokensWithBalance = []; - if (process.env.TOKEN_DETECTION_V2) { - const eventTokensDetails = []; - if (result) { - const nonZeroTokenAddresses = Object.keys(result); - for (const nonZeroTokenAddress of nonZeroTokenAddresses) { - const { - address, - symbol, - decimals, - iconUrl, - aggregators, - } = tokenList[nonZeroTokenAddress]; + const tokensWithBalance = []; + const eventTokensDetails = []; + if (result) { + const nonZeroTokenAddresses = Object.keys(result); + for (const nonZeroTokenAddress of nonZeroTokenAddresses) { + const { address, symbol, decimals, aggregators } = + tokenListUsed[nonZeroTokenAddress]; - eventTokensDetails.push(`${symbol} - ${address}`); + eventTokensDetails.push(`${symbol} - ${address}`); - tokensWithBalance.push({ - address, - symbol, - decimals, - image: iconUrl, - aggregators, - }); - } + tokensWithBalance.push({ + address, + symbol, + decimals, + aggregators, + }); + } - if (tokensWithBalance.length > 0) { - this._trackMetaMetricsEvent({ - event: EVENT_NAMES.TOKEN_DETECTED, - category: EVENT.CATEGORIES.WALLET, - properties: { - tokens: eventTokensDetails, - token_standard: TOKEN_STANDARDS.ERC20, - asset_type: ASSET_TYPES.TOKEN, - }, - }); - await this.tokensController.addDetectedTokens(tokensWithBalance); - } + if (tokensWithBalance.length > 0) { + this._trackMetaMetricsEvent({ + event: EVENT_NAMES.TOKEN_DETECTED, + category: EVENT.CATEGORIES.WALLET, + properties: { + tokens: eventTokensDetails, + token_standard: TOKEN_STANDARDS.ERC20, + asset_type: ASSET_TYPES.TOKEN, + }, + }); + await this.tokensController.addDetectedTokens(tokensWithBalance); } - } else { - tokensWithBalance = tokensSlice.filter((_, index) => { - const balance = result[index]; - return balance && !balance.isZero(); - }); - await Promise.all( - tokensWithBalance.map((tokenAddress) => { - return this.tokensController.addToken( - tokenAddress, - tokenList[tokenAddress].symbol, - tokenList[tokenAddress].decimals, - ); - }), - ); } } } @@ -235,6 +194,10 @@ export default class DetectTokensController { this.interval = DEFAULT_INTERVAL; } + getChainIdFromNetworkStore(network) { + return network?.store.getState().provider.chainId; + } + /* eslint-disable accessor-pairs */ /** * @type {number} @@ -258,6 +221,12 @@ export default class DetectTokensController { } this._network = network; this.web3 = new Web3(network._provider); + this._network.store.subscribe(() => { + if (this.chainId !== this.getChainIdFromNetworkStore(network)) { + this.restartTokenDetection(); + this.chainId = this.getChainIdFromNetworkStore(network); + } + }); } /** diff --git a/app/scripts/controllers/detect-tokens.test.js b/app/scripts/controllers/detect-tokens.test.js index 4fd5605b0..4f1e0334a 100644 --- a/app/scripts/controllers/detect-tokens.test.js +++ b/app/scripts/controllers/detect-tokens.test.js @@ -7,6 +7,7 @@ import { ControllerMessenger, TokenListController, TokensController, + AssetsContractController, } from '@metamask/controllers'; import { MAINNET, ROPSTEN } from '../../../shared/constants/network'; import { toChecksumHexAddress } from '../../../shared/modules/hexstring-utils'; @@ -15,9 +16,14 @@ import NetworkController from './network'; import PreferencesController from './preferences'; describe('DetectTokensController', function () { - let tokenListController; const sandbox = sinon.createSandbox(); - let keyringMemStore, network, preferences, provider, tokensController; + let assetsContractController, + keyringMemStore, + network, + preferences, + provider, + tokensController, + tokenListController; const noop = () => undefined; @@ -31,18 +37,44 @@ describe('DetectTokensController', function () { network.setInfuraProjectId('foo'); network.initializeProvider(networkControllerProviderConfig); provider = network.getProviderAndBlockTracker().provider; - preferences = new PreferencesController({ network, provider }); - tokensController = new TokensController({ - onPreferencesStateChange: preferences.store.subscribe.bind( - preferences.store, - ), - onNetworkStateChange: network.store.subscribe.bind(network.store), + + const tokenListMessenger = new ControllerMessenger().getRestricted({ + name: 'TokenListController', + }); + tokenListController = new TokenListController({ + chainId: '1', + preventPollingOnNetworkRestart: false, + onNetworkStateChange: sinon.spy(), + onPreferencesStateChange: sinon.spy(), + messenger: tokenListMessenger, + }); + await tokenListController.start(); + + preferences = new PreferencesController({ + network, + provider, + tokenListController, }); preferences.setAddresses([ '0x7e57e2', '0xbc86727e770de68b1060c91f6bb6945c73e10388', ]); preferences.setUseTokenDetection(true); + + tokensController = new TokensController({ + onPreferencesStateChange: preferences.store.subscribe.bind( + preferences.store, + ), + onNetworkStateChange: network.store.subscribe.bind(network.store), + }); + + assetsContractController = new AssetsContractController({ + onPreferencesStateChange: preferences.store.subscribe.bind( + preferences.store, + ), + onNetworkStateChange: network.store.subscribe.bind(network.store), + }); + sandbox .stub(network, 'getLatestBlock') .callsFake(() => Promise.resolve({})); @@ -122,17 +154,6 @@ describe('DetectTokensController', function () { .get(`/tokens/3`) .reply(200, { error: 'ChainId 3 is not supported' }) .persist(); - const tokenListMessenger = new ControllerMessenger().getRestricted({ - name: 'TokenListController', - }); - tokenListController = new TokenListController({ - chainId: '1', - useStaticTokenList: false, - onNetworkStateChange: sinon.spy(), - onPreferencesStateChange: sinon.spy(), - messenger: tokenListMessenger, - }); - await tokenListController.start(); }); after(function () { @@ -155,6 +176,7 @@ describe('DetectTokensController', function () { keyringMemStore, tokenList: tokenListController, tokensController, + assetsContractController, }); controller.isOpen = true; controller.isUnlocked = true; @@ -171,7 +193,7 @@ describe('DetectTokensController', function () { sandbox.assert.calledThrice(stub); }); - it('should not check tokens while on test network', async function () { + it('should not check and add tokens while on unsupported networks', async function () { sandbox.useFakeTimers(); network.setProviderType(ROPSTEN); const tokenListMessengerRopsten = new ControllerMessenger().getRestricted({ @@ -179,7 +201,6 @@ describe('DetectTokensController', function () { }); tokenListController = new TokenListController({ chainId: '3', - useStaticTokenList: false, onNetworkStateChange: sinon.spy(), onPreferencesStateChange: sinon.spy(), messenger: tokenListMessengerRopsten, @@ -191,17 +212,21 @@ describe('DetectTokensController', function () { keyringMemStore, tokenList: tokenListController, tokensController, + assetsContractController, }); controller.isOpen = true; controller.isUnlocked = true; - const stub = sandbox.stub(controller, '_getTokenBalances'); + const stub = sandbox.stub( + assetsContractController, + 'getBalancesInSingleCall', + ); await controller.detectNewTokens(); sandbox.assert.notCalled(stub); }); - it('should skip adding tokens listed in hiddenTokens array', async function () { + it('should skip adding tokens listed in ignoredTokens array', async function () { sandbox.useFakeTimers(); network.setProviderType(MAINNET); const controller = new DetectTokensController({ @@ -210,52 +235,49 @@ describe('DetectTokensController', function () { keyringMemStore, tokenList: tokenListController, tokensController, + assetsContractController, + trackMetaMetricsEvent: noop, }); controller.isOpen = true; controller.isUnlocked = true; const { tokenList } = tokenListController.state; - const erc20ContractAddresses = Object.keys(tokenList); - - const existingTokenAddress = erc20ContractAddresses[0]; - const existingToken = tokenList[existingTokenAddress]; - await tokensController.addToken( - existingTokenAddress, - existingToken.symbol, - existingToken.decimals, - ); + const tokenValues = Object.values(tokenList); - const tokenAddressToSkip = erc20ContractAddresses[1]; - const tokenToSkip = tokenList[tokenAddressToSkip]; - await tokensController.addToken( - tokenAddressToSkip, - tokenToSkip.symbol, - tokenToSkip.decimals, - ); + await tokensController.addDetectedTokens([ + { + address: tokenValues[0].address, + symbol: tokenValues[0].symbol, + decimals: tokenValues[0].decimals, + aggregators: tokenValues[0].aggregators, + image: undefined, + isERC721: undefined, + }, + ]); sandbox - .stub(controller, '_getTokenBalances') + .stub(assetsContractController, 'getBalancesInSingleCall') .callsFake((tokensToDetect) => tokensToDetect.map((token) => - token === tokenAddressToSkip ? new BigNumber(10) : 0, + token.address === tokenValues[1].address ? new BigNumber(10) : 0, ), ); + await tokensController.ignoreTokens([tokenValues[1].address]); - await tokensController.removeAndIgnoreToken(tokenAddressToSkip); await controller.detectNewTokens(); - - assert.deepEqual(tokensController.state.tokens, [ + assert.deepEqual(tokensController.state.detectedTokens, [ { - address: toChecksumHexAddress(existingTokenAddress), - decimals: existingToken.decimals, - symbol: existingToken.symbol, + address: toChecksumHexAddress(tokenValues[0].address), + decimals: tokenValues[0].decimals, + symbol: tokenValues[0].symbol, + aggregators: tokenValues[0].aggregators, image: undefined, - isERC721: false, + isERC721: undefined, }, ]); }); - it('should check and add tokens while on main network', async function () { + it('should check and add tokens while on supported networks', async function () { sandbox.useFakeTimers(); network.setProviderType(MAINNET); const controller = new DetectTokensController({ @@ -264,6 +286,8 @@ describe('DetectTokensController', function () { keyringMemStore, tokenList: tokenListController, tokensController, + assetsContractController, + trackMetaMetricsEvent: noop, }); controller.isOpen = true; controller.isUnlocked = true; @@ -273,105 +297,41 @@ describe('DetectTokensController', function () { const existingTokenAddress = erc20ContractAddresses[0]; const existingToken = tokenList[existingTokenAddress]; - await tokensController.addToken( - existingTokenAddress, - existingToken.symbol, - existingToken.decimals, - ); - - const tokenAddressToAdd = erc20ContractAddresses[1]; - const tokenToAdd = tokenList[tokenAddressToAdd]; - const contractAddressesToDetect = erc20ContractAddresses.filter( - (address) => address !== existingTokenAddress, - ); - const indexOfTokenToAdd = contractAddressesToDetect.indexOf( - tokenAddressToAdd, - ); - const balances = new Array(contractAddressesToDetect.length); - - balances[indexOfTokenToAdd] = new BigNumber(10); - - sandbox - .stub(controller, '_getTokenBalances') - .returns(Promise.resolve(balances)); - - await controller.detectNewTokens(); - assert.deepEqual(tokensController.state.tokens, [ + await tokensController.addDetectedTokens([ { - address: toChecksumHexAddress(existingTokenAddress), - decimals: existingToken.decimals, + address: existingToken.address, symbol: existingToken.symbol, - isERC721: false, - image: undefined, - }, - { - address: toChecksumHexAddress(tokenAddressToAdd), - decimals: tokenToAdd.decimals, - symbol: tokenToAdd.symbol, + decimals: existingToken.decimals, + aggregators: existingToken.aggregators, image: undefined, - isERC721: false, + isERC721: undefined, }, ]); - }); - - it('should check and add tokens while on non-default Mainnet', async function () { - sandbox.useFakeTimers(); - network.setRpcTarget('https://some-fake-RPC-endpoint.metamask.io', '0x1'); - const controller = new DetectTokensController({ - preferences, - network, - keyringMemStore, - tokenList: tokenListController, - tokensController, - }); - controller.isOpen = true; - controller.isUnlocked = true; - - const { tokenList } = tokenListController.state; - const erc20ContractAddresses = Object.keys(tokenList); - - const existingTokenAddress = erc20ContractAddresses[0]; - const existingToken = tokenList[existingTokenAddress]; - await tokensController.addToken( - existingTokenAddress, - existingToken.symbol, - existingToken.decimals, - ); - const tokenAddressToAdd = erc20ContractAddresses[1]; const tokenToAdd = tokenList[tokenAddressToAdd]; - - const contractAddressesToDetect = erc20ContractAddresses.filter( - (address) => address !== existingTokenAddress, - ); - const indexOfTokenToAdd = contractAddressesToDetect.indexOf( - tokenAddressToAdd, - ); - - const balances = new Array(contractAddressesToDetect.length); - balances[indexOfTokenToAdd] = new BigNumber(10); - sandbox - .stub(controller, '_getTokenBalances') - .returns(Promise.resolve(balances)); - + .stub(assetsContractController, 'getBalancesInSingleCall') + .callsFake(() => + Promise.resolve({ [tokenAddressToAdd]: new BigNumber(10) }), + ); await controller.detectNewTokens(); - - assert.deepEqual(tokensController.state.tokens, [ + assert.deepEqual(tokensController.state.detectedTokens, [ { address: toChecksumHexAddress(existingTokenAddress), decimals: existingToken.decimals, symbol: existingToken.symbol, + aggregators: existingToken.aggregators, image: undefined, - isERC721: false, + isERC721: undefined, }, { address: toChecksumHexAddress(tokenAddressToAdd), decimals: tokenToAdd.decimals, symbol: tokenToAdd.symbol, + aggregators: tokenToAdd.aggregators, image: undefined, - isERC721: false, + isERC721: undefined, }, ]); }); @@ -384,6 +344,7 @@ describe('DetectTokensController', function () { keyringMemStore, tokenList: tokenListController, tokensController, + assetsContractController, }); controller.isOpen = true; controller.isUnlocked = true; @@ -402,6 +363,7 @@ describe('DetectTokensController', function () { keyringMemStore, tokenList: tokenListController, tokensController, + assetsContractController, }); controller.isOpen = true; controller.selectedAddress = '0x0'; @@ -419,10 +381,14 @@ describe('DetectTokensController', function () { keyringMemStore, tokenList: tokenListController, tokensController, + assetsContractController, }); controller.isOpen = true; controller.isUnlocked = false; - const stub = sandbox.stub(controller, '_getTokenBalances'); + const stub = sandbox.stub( + assetsContractController, + 'getBalancesInSingleCall', + ); clock.tick(180000); sandbox.assert.notCalled(stub); }); @@ -435,6 +401,7 @@ describe('DetectTokensController', function () { network, keyringMemStore, tokensController, + assetsContractController, }); // trigger state update from preferences controller await preferences.setSelectedAddress( @@ -442,7 +409,10 @@ describe('DetectTokensController', function () { ); controller.isOpen = false; controller.isUnlocked = true; - const stub = sandbox.stub(controller, '_getTokenBalances'); + const stub = sandbox.stub( + assetsContractController, + 'getBalancesInSingleCall', + ); clock.tick(180000); sandbox.assert.notCalled(stub); }); diff --git a/app/scripts/controllers/ens/ens.js b/app/scripts/controllers/ens/ens.js index 0a629dd40..2242a2b8c 100644 --- a/app/scripts/controllers/ens/ens.js +++ b/app/scripts/controllers/ens/ens.js @@ -1,5 +1,6 @@ -import EthJsEns from 'ethjs-ens'; +import { ethers } from 'ethers'; import ensNetworkMap from 'ethereum-ens-network-map'; +import { NETWORK_ID_TO_ETHERS_NETWORK_NAME_MAP } from '../../../../shared/constants/network'; export default class Ens { static getNetworkEnsSupport(network) { @@ -7,17 +8,21 @@ export default class Ens { } constructor({ network, provider } = {}) { - this._ethJsEns = new EthJsEns({ - network, - provider, + const networkName = NETWORK_ID_TO_ETHERS_NETWORK_NAME_MAP[network]; + const ensAddress = ensNetworkMap[network]; + const ethProvider = new ethers.providers.Web3Provider(provider, { + chainId: parseInt(network, 10), + name: networkName, + ensAddress, }); + this._ethProvider = ethProvider; } lookup(ensName) { - return this._ethJsEns.lookup(ensName); + return this._ethProvider.resolveName(ensName); } reverse(address) { - return this._ethJsEns.reverse(address); + return this._ethProvider.lookupAddress(address); } } diff --git a/app/scripts/controllers/ens/index.test.js b/app/scripts/controllers/ens/index.test.js index c94f73a5d..d325e2885 100644 --- a/app/scripts/controllers/ens/index.test.js +++ b/app/scripts/controllers/ens/index.test.js @@ -20,7 +20,7 @@ describe('EnsController', function () { describe('#constructor', function () { it('should construct the controller given a provider and a network', async function () { const ens = new EnsController({ - provider: {}, + provider: sinon.fake(), getCurrentChainId, onNetworkDidChange, }); diff --git a/app/scripts/controllers/incoming-transactions.js b/app/scripts/controllers/incoming-transactions.js index 8b07f4a1f..1c264b97d 100644 --- a/app/scripts/controllers/incoming-transactions.js +++ b/app/scripts/controllers/incoming-transactions.js @@ -18,9 +18,8 @@ import { RINKEBY_CHAIN_ID, ROPSTEN_CHAIN_ID, } from '../../../shared/constants/network'; -import { SECOND } from '../../../shared/constants/time'; -const fetchWithTimeout = getFetchWithTimeout(SECOND * 30); +const fetchWithTimeout = getFetchWithTimeout(); /** * @typedef {import('../../../shared/constants/transaction').TransactionMeta} TransactionMeta diff --git a/app/scripts/controllers/incoming-transactions.test.js b/app/scripts/controllers/incoming-transactions.test.js index fd5f9d9cf..ee6f559e9 100644 --- a/app/scripts/controllers/incoming-transactions.test.js +++ b/app/scripts/controllers/incoming-transactions.test.js @@ -190,9 +190,8 @@ describe('IncomingTransactionsController', function () { ); assert(mockedNetworkMethods.onNetworkDidChange.calledOnce); - const networkControllerListenerCallback = mockedNetworkMethods.onNetworkDidChange.getCall( - 0, - ).args[0]; + const networkControllerListenerCallback = + mockedNetworkMethods.onNetworkDidChange.getCall(0).args[0]; assert.strictEqual(incomingTransactionsController._update.callCount, 0); networkControllerListenerCallback('testNetworkType'); assert.strictEqual(incomingTransactionsController._update.callCount, 1); @@ -253,8 +252,10 @@ describe('IncomingTransactionsController', function () { initState: getNonEmptyInitState(), }, ); - const startBlock = getNonEmptyInitState() - .incomingTxLastFetchedBlockByChainId[ROPSTEN_CHAIN_ID]; + const startBlock = + getNonEmptyInitState().incomingTxLastFetchedBlockByChainId[ + ROPSTEN_CHAIN_ID + ]; nock('https://api-ropsten.etherscan.io') .get( `/api?module=account&action=txlist&address=${MOCK_SELECTED_ADDRESS}&tag=latest&page=1&startBlock=${startBlock}`, @@ -546,8 +547,10 @@ describe('IncomingTransactionsController', function () { }, ); const NEW_MOCK_SELECTED_ADDRESS = `${MOCK_SELECTED_ADDRESS}9`; - const startBlock = getNonEmptyInitState() - .incomingTxLastFetchedBlockByChainId[ROPSTEN_CHAIN_ID]; + const startBlock = + getNonEmptyInitState().incomingTxLastFetchedBlockByChainId[ + ROPSTEN_CHAIN_ID + ]; nock('https://api-ropsten.etherscan.io') .get( `/api?module=account&action=txlist&address=${NEW_MOCK_SELECTED_ADDRESS}&tag=latest&page=1&startBlock=${startBlock}`, @@ -572,9 +575,10 @@ describe('IncomingTransactionsController', function () { incomingTransactionsController.store, ); - const subscription = incomingTransactionsController.preferencesController.store.subscribe.getCall( - 1, - ).args[0]; + const subscription = + incomingTransactionsController.preferencesController.store.subscribe.getCall( + 1, + ).args[0]; // The incoming transactions controller will always skip the first event // We need to call subscription twice to test the event handling // TODO: stop skipping the first event @@ -658,9 +662,10 @@ describe('IncomingTransactionsController', function () { incomingTransactionsController.store, ); - const subscription = incomingTransactionsController.preferencesController.store.subscribe.getCall( - 1, - ).args[0]; + const subscription = + incomingTransactionsController.preferencesController.store.subscribe.getCall( + 1, + ).args[0]; // The incoming transactions controller will always skip the first event // We need to call subscription twice to test the event handling // TODO: stop skipping the first event @@ -682,9 +687,8 @@ describe('IncomingTransactionsController', function () { }); it('should update when switching to a supported network', async function () { - const mockedNetworkMethods = getMockNetworkControllerMethods( - ROPSTEN_CHAIN_ID, - ); + const mockedNetworkMethods = + getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID); const incomingTransactionsController = new IncomingTransactionsController( { blockTracker: getMockBlockTracker(), @@ -693,8 +697,10 @@ describe('IncomingTransactionsController', function () { initState: getNonEmptyInitState(), }, ); - const startBlock = getNonEmptyInitState() - .incomingTxLastFetchedBlockByChainId[ROPSTEN_CHAIN_ID]; + const startBlock = + getNonEmptyInitState().incomingTxLastFetchedBlockByChainId[ + ROPSTEN_CHAIN_ID + ]; nock('https://api-ropsten.etherscan.io') .get( `/api?module=account&action=txlist&address=${MOCK_SELECTED_ADDRESS}&tag=latest&page=1&startBlock=${startBlock}`, @@ -715,8 +721,8 @@ describe('IncomingTransactionsController', function () { incomingTransactionsController.store, ); - const subscription = mockedNetworkMethods.onNetworkDidChange.getCall(0) - .args[0]; + const subscription = + mockedNetworkMethods.onNetworkDidChange.getCall(0).args[0]; await subscription(ROPSTEN_CHAIN_ID); await updateStateCalled(); @@ -763,9 +769,8 @@ describe('IncomingTransactionsController', function () { }); it('should not update when switching to an unsupported network', async function () { - const mockedNetworkMethods = getMockNetworkControllerMethods( - ROPSTEN_CHAIN_ID, - ); + const mockedNetworkMethods = + getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID); const incomingTransactionsController = new IncomingTransactionsController( { blockTracker: getMockBlockTracker(), @@ -796,8 +801,8 @@ describe('IncomingTransactionsController', function () { incomingTransactionsController.store, ); - const subscription = mockedNetworkMethods.onNetworkDidChange.getCall(0) - .args[0]; + const subscription = + mockedNetworkMethods.onNetworkDidChange.getCall(0).args[0]; incomingTransactionsController.getCurrentChainId = () => FAKE_CHAIN_ID; await subscription(); @@ -820,15 +825,14 @@ describe('IncomingTransactionsController', function () { describe('_update', function () { describe('when state is empty (initialized)', function () { it('should use provided block number and update the latest block seen', async function () { - const incomingTransactionsController = new IncomingTransactionsController( - { + const incomingTransactionsController = + new IncomingTransactionsController({ blockTracker: getMockBlockTracker(), ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getEmptyInitState(), getCurrentChainId: () => ROPSTEN_CHAIN_ID, - }, - ); + }); sinon.spy(incomingTransactionsController.store, 'updateState'); incomingTransactionsController._getNewIncomingTransactions = sinon @@ -857,15 +861,14 @@ describe('IncomingTransactionsController', function () { }); it('should update the last fetched block for network to highest block seen in incoming txs', async function () { - const incomingTransactionsController = new IncomingTransactionsController( - { + const incomingTransactionsController = + new IncomingTransactionsController({ blockTracker: getMockBlockTracker(), ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getEmptyInitState(), getCurrentChainId: () => ROPSTEN_CHAIN_ID, - }, - ); + }); const NEW_TRANSACTION_ONE = { id: 555, @@ -911,15 +914,14 @@ describe('IncomingTransactionsController', function () { describe('when state is populated with prior data for network', function () { it('should use the last fetched block for the current network and increment by 1 in state', async function () { - const incomingTransactionsController = new IncomingTransactionsController( - { + const incomingTransactionsController = + new IncomingTransactionsController({ blockTracker: getMockBlockTracker(), ...getMockNetworkControllerMethods(ROPSTEN_CHAIN_ID), preferencesController: getMockPreferencesController(), initState: getNonEmptyInitState(), getCurrentChainId: () => ROPSTEN_CHAIN_ID, - }, - ); + }); sinon.spy(incomingTransactionsController.store, 'updateState'); incomingTransactionsController._getNewIncomingTransactions = sinon .stub() @@ -1105,11 +1107,12 @@ describe('IncomingTransactionsController', function () { }, ); - const result = await incomingTransactionsController._getNewIncomingTransactions( - ADDRESS_TO_FETCH_FOR, - '789', - ROPSTEN_CHAIN_ID, - ); + const result = + await incomingTransactionsController._getNewIncomingTransactions( + ADDRESS_TO_FETCH_FOR, + '789', + ROPSTEN_CHAIN_ID, + ); assert(mockFetch.calledOnce); assert.deepStrictEqual(result, [ @@ -1137,11 +1140,12 @@ describe('IncomingTransactionsController', function () { }, ); - const result = await incomingTransactionsController._getNewIncomingTransactions( - ADDRESS_TO_FETCH_FOR, - '789', - ROPSTEN_CHAIN_ID, - ); + const result = + await incomingTransactionsController._getNewIncomingTransactions( + ADDRESS_TO_FETCH_FOR, + '789', + ROPSTEN_CHAIN_ID, + ); assert.deepStrictEqual(result, []); window.fetch = tempFetchStatusZero; mockFetchStatusZero.reset(); @@ -1164,11 +1168,12 @@ describe('IncomingTransactionsController', function () { }, ); - const result = await incomingTransactionsController._getNewIncomingTransactions( - ADDRESS_TO_FETCH_FOR, - '789', - ROPSTEN_CHAIN_ID, - ); + const result = + await incomingTransactionsController._getNewIncomingTransactions( + ADDRESS_TO_FETCH_FOR, + '789', + ROPSTEN_CHAIN_ID, + ); assert.deepStrictEqual(result, []); window.fetch = tempFetchEmptyResult; mockFetchEmptyResult.reset(); diff --git a/app/scripts/controllers/metametrics.js b/app/scripts/controllers/metametrics.js index 67c879c94..56d757a7c 100644 --- a/app/scripts/controllers/metametrics.js +++ b/app/scripts/controllers/metametrics.js @@ -19,6 +19,8 @@ import { } from '../../../shared/constants/metametrics'; import { SECOND } from '../../../shared/constants/time'; +const EXTENSION_UNINSTALL_URL = 'https://metamask.io/uninstalled'; + const defaultCaptureException = (err) => { // throw error on clean stack so its captured by platform integrations (eg sentry) // but does not interrupt the call stack @@ -52,6 +54,9 @@ const exceptionsToFilter = { * whether or not events are tracked * @property {{[string]: MetaMetricsEventFragment}} [fragments] - Object keyed * by UUID with stored fragments as values. + * @property {Array} [eventsBeforeMetricsOptIn] - Array of queued events added before + * a user opts into metrics. + * @property {object} [traits] - Traits that are not derived from other state keys. */ export default class MetaMetricsController { @@ -69,6 +74,7 @@ export default class MetaMetricsController { * identifier from the network controller * @param {string} options.version - The version of the extension * @param {string} options.environment - The environment the extension is running in + * @param {string} options.extension - webextension-polyfill * @param {MetaMetricsControllerState} options.initState - State to initialized with * @param options.captureException */ @@ -81,6 +87,7 @@ export default class MetaMetricsController { version, environment, initState, + extension, captureException = defaultCaptureException, }) { this._captureException = (err) => { @@ -96,12 +103,16 @@ export default class MetaMetricsController { this.locale = prefState.currentLocale.replace('_', '-'); this.version = environment === 'production' ? version : `${version}-${environment}`; + this.extension = extension; + this.environment = environment; const abandonedFragments = omitBy(initState?.fragments, 'persist'); this.store = new ObservableStore({ participateInMetaMetrics: null, metaMetricsId: null, + eventsBeforeMetricsOptIn: [], + traits: {}, ...initState, fragments: { ...initState?.fragments, @@ -315,6 +326,26 @@ export default class MetaMetricsController { this._identify(allValidTraits); } + // It sets an uninstall URL ("Sorry to see you go!" page), + // which is opened if a user uninstalls the extension. + updateExtensionUninstallUrl(participateInMetaMetrics, metaMetricsId) { + const query = {}; + if (participateInMetaMetrics) { + // We only want to track these things if a user opted into metrics. + query.mmi = Buffer.from(metaMetricsId).toString('base64'); + query.env = this.environment; + query.av = this.version; + } + const queryString = new URLSearchParams(query); + + // this.extension not currently defined in tests + if (this.extension && this.extension.runtime) { + this.extension.runtime.setUninstallURL( + `${EXTENSION_UNINSTALL_URL}?${queryString}`, + ); + } + } + /** * Setter for the `participateInMetaMetrics` property * @@ -331,6 +362,12 @@ export default class MetaMetricsController { metaMetricsId = null; } this.store.updateState({ participateInMetaMetrics, metaMetricsId }); + if (participateInMetaMetrics) { + this.trackEventsAfterMetricsOptIn(); + this.clearEventsAfterMetricsOptIn(); + } + + this.updateExtensionUninstallUrl(participateInMetaMetrics, metaMetricsId); return metaMetricsId; } @@ -472,6 +509,37 @@ export default class MetaMetricsController { } } + // Track all queued events after a user opted into metrics. + trackEventsAfterMetricsOptIn() { + const { eventsBeforeMetricsOptIn } = this.store.getState(); + eventsBeforeMetricsOptIn.forEach((eventBeforeMetricsOptIn) => { + this.trackEvent(eventBeforeMetricsOptIn); + }); + } + + // Once we track queued events after a user opts into metrics, we want to clear the event queue. + clearEventsAfterMetricsOptIn() { + this.store.updateState({ + eventsBeforeMetricsOptIn: [], + }); + } + + // It adds an event into a queue, which is only tracked if a user opts into metrics. + addEventBeforeMetricsOptIn(event) { + const prevState = this.store.getState().eventsBeforeMetricsOptIn; + this.store.updateState({ + eventsBeforeMetricsOptIn: [...prevState, event], + }); + } + + // Add or update traits for tracking. + updateTraits(newTraits) { + const { traits } = this.store.getState(); + this.store.updateState({ + traits: { ...traits, ...newTraits }, + }); + } + /** PRIVATE METHODS */ /** @@ -549,24 +617,27 @@ export default class MetaMetricsController { * @returns {MetaMetricsTraits | null} traits that have changed since last update */ _buildUserTraitsObject(metamaskState) { + const { traits } = this.store.getState(); /** @type {MetaMetricsTraits} */ const currentTraits = { [TRAITS.ADDRESS_BOOK_ENTRIES]: sum( Object.values(metamaskState.addressBook).map(size), ), + [TRAITS.INSTALL_DATE_EXT]: traits[TRAITS.INSTALL_DATE_EXT] || '', [TRAITS.LEDGER_CONNECTION_TYPE]: metamaskState.ledgerTransportType, [TRAITS.NETWORKS_ADDED]: metamaskState.frequentRpcListDetail.map( (rpc) => rpc.chainId, ), - [TRAITS.NETWORKS_WITHOUT_TICKER]: metamaskState.frequentRpcListDetail.reduce( - (networkList, currentNetwork) => { - if (!currentNetwork.ticker) { - networkList.push(currentNetwork.chainId); - } - return networkList; - }, - [], - ), + [TRAITS.NETWORKS_WITHOUT_TICKER]: + metamaskState.frequentRpcListDetail.reduce( + (networkList, currentNetwork) => { + if (!currentNetwork.ticker) { + networkList.push(currentNetwork.chainId); + } + return networkList; + }, + [], + ), [TRAITS.NFT_AUTODETECTION_ENABLED]: metamaskState.useCollectibleDetection, [TRAITS.NUMBER_OF_ACCOUNTS]: Object.values(metamaskState.identities) .length, diff --git a/app/scripts/controllers/metametrics.test.js b/app/scripts/controllers/metametrics.test.js index 804132295..c5449b90e 100644 --- a/app/scripts/controllers/metametrics.test.js +++ b/app/scripts/controllers/metametrics.test.js @@ -132,12 +132,10 @@ function getMetaMetricsController({ } = {}) { return new MetaMetricsController({ segment, - getNetworkIdentifier: networkController.getNetworkIdentifier.bind( - networkController, - ), - getCurrentChainId: networkController.getCurrentChainId.bind( - networkController, - ), + getNetworkIdentifier: + networkController.getNetworkIdentifier.bind(networkController), + getCurrentChainId: + networkController.getCurrentChainId.bind(networkController), onNetworkDidChange: networkController.on.bind( networkController, NETWORK_EVENTS.NETWORK_DID_CHANGE, @@ -690,6 +688,7 @@ describe('MetaMetricsController', function () { assert.deepEqual(traits, { [TRAITS.ADDRESS_BOOK_ENTRIES]: 3, + [TRAITS.INSTALL_DATE_EXT]: '', [TRAITS.LEDGER_CONNECTION_TYPE]: 'web-hid', [TRAITS.NETWORKS_ADDED]: [MAINNET_CHAIN_ID, ROPSTEN_CHAIN_ID, '0xaf'], [TRAITS.NETWORKS_WITHOUT_TICKER]: ['0xaf'], diff --git a/app/scripts/controllers/network/network-controller.test.js b/app/scripts/controllers/network/network-controller.test.js index 260d30187..0ff8f938f 100644 --- a/app/scripts/controllers/network/network-controller.test.js +++ b/app/scripts/controllers/network/network-controller.test.js @@ -34,8 +34,8 @@ describe('NetworkController', () => { describe('#provider', () => { it('provider should be updatable without reassignment', () => { networkController.initializeProvider(networkControllerProviderConfig); - const providerProxy = networkController.getProviderAndBlockTracker() - .provider; + const providerProxy = + networkController.getProviderAndBlockTracker().provider; expect(providerProxy.test).toBeUndefined(); providerProxy.setTarget({ test: true }); expect(providerProxy.test).toStrictEqual(true); @@ -79,7 +79,8 @@ describe('NetworkController', () => { describe('#getEIP1559Compatibility', () => { it('should return false when baseFeePerGas is not in the block header', async () => { networkController.initializeProvider(networkControllerProviderConfig); - const supportsEIP1559 = await networkController.getEIP1559Compatibility(); + const supportsEIP1559 = + await networkController.getEIP1559Compatibility(); expect(supportsEIP1559).toStrictEqual(false); }); @@ -88,7 +89,8 @@ describe('NetworkController', () => { getLatestBlockStub.callsFake(() => Promise.resolve({ baseFeePerGas: '0xa ' }), ); - const supportsEIP1559 = await networkController.getEIP1559Compatibility(); + const supportsEIP1559 = + await networkController.getEIP1559Compatibility(); expect(supportsEIP1559).toStrictEqual(true); }); @@ -98,7 +100,8 @@ describe('NetworkController', () => { Promise.resolve({ baseFeePerGas: '0xa ' }), ); await networkController.getEIP1559Compatibility(); - const supportsEIP1559 = await networkController.getEIP1559Compatibility(); + const supportsEIP1559 = + await networkController.getEIP1559Compatibility(); expect(getLatestBlockStub.calledOnce).toStrictEqual(true); expect(supportsEIP1559).toStrictEqual(true); }); diff --git a/app/scripts/controllers/network/network.js b/app/scripts/controllers/network/network.js index 9cdad5aed..a079307ab 100644 --- a/app/scripts/controllers/network/network.js +++ b/app/scripts/controllers/network/network.js @@ -20,7 +20,6 @@ import { INFURA_BLOCKED_KEY, TEST_NETWORK_TICKER_MAP, } from '../../../../shared/constants/network'; -import { SECOND } from '../../../../shared/constants/time'; import { isPrefixedFormattedHexString, isSafeChainId, @@ -31,7 +30,7 @@ import createInfuraClient from './createInfuraClient'; import createJsonRpcClient from './createJsonRpcClient'; const env = process.env.METAMASK_ENV; -const fetchWithTimeout = getFetchWithTimeout(SECOND * 30); +const fetchWithTimeout = getFetchWithTimeout(); let defaultProviderConfigOpts; if (process.env.IN_TEST) { diff --git a/app/scripts/controllers/network/pending-middleware.test.js b/app/scripts/controllers/network/pending-middleware.test.js index be0289648..9544dc792 100644 --- a/app/scripts/controllers/network/pending-middleware.test.js +++ b/app/scripts/controllers/network/pending-middleware.test.js @@ -68,8 +68,7 @@ describe('PendingNonceMiddleware', () => { from: '0xf231d46dd78806e1dd93442cf33c7671f8538748', gas: GAS_LIMITS.SIMPLE, gasPrice: '0x1e8480', - hash: - '0x2cc5a25744486f7383edebbf32003e5a66e18135799593d6b5cdd2bb43674f09', + hash: '0x2cc5a25744486f7383edebbf32003e5a66e18135799593d6b5cdd2bb43674f09', input: '0x', nonce: '0x4', type: TRANSACTION_ENVELOPE_TYPES.LEGACY, diff --git a/app/scripts/controllers/network/util.test.js b/app/scripts/controllers/network/util.test.js index 4e650f3db..4ca1768cb 100644 --- a/app/scripts/controllers/network/util.test.js +++ b/app/scripts/controllers/network/util.test.js @@ -25,8 +25,7 @@ describe('network utils', () => { chainId: '0x3', time: 1624408066355, metamaskNetworkId: '3', - hash: - '0x4bcb6cd6b182209585f8ad140260ddb35c81a575dd40f508d9767e652a9f60e7', + hash: '0x4bcb6cd6b182209585f8ad140260ddb35c81a575dd40f508d9767e652a9f60e7', r: '0x4c3111e42ed5eec3dcecba1e234700f387e8693c373c61c3e54a762a26f1570e', s: '0x18bfc4eeb7ebcfacc3bd59ea100a6834ea3265e65945dbec69aa2a06564fafff', v: '0x29', @@ -38,8 +37,7 @@ describe('network utils', () => { from: '0xc684832530fcbddae4b4230a47e991ddcec2831d', gas: '0x7b0d', gasPrice: '0x77359400', - hash: - '0x4bcb6cd6b182209585f8ad140260ddb35c81a575dd40f508d9767e652a9f60e7', + hash: '0x4bcb6cd6b182209585f8ad140260ddb35c81a575dd40f508d9767e652a9f60e7', input: '0x', maxFeePerGas: '0x77359400', maxPriorityFeePerGas: '0x77359400', @@ -72,8 +70,7 @@ describe('network utils', () => { chainId: '0x3', time: 1624408066355, metamaskNetworkId: '3', - hash: - '0x4bcb6cd6b182209585f8ad140260ddb35c81a575dd40f508d9767e652a9f60e7', + hash: '0x4bcb6cd6b182209585f8ad140260ddb35c81a575dd40f508d9767e652a9f60e7', r: '0x4c3111e42ed5eec3dcecba1e234700f387e8693c373c61c3e54a762a26f1570e', s: '0x18bfc4eeb7ebcfacc3bd59ea100a6834ea3265e65945dbec69aa2a06564fafff', v: '0x29', @@ -84,8 +81,7 @@ describe('network utils', () => { blockNumber: null, from: '0xc684832530fcbddae4b4230a47e991ddcec2831d', gas: '0x7b0d', - hash: - '0x4bcb6cd6b182209585f8ad140260ddb35c81a575dd40f508d9767e652a9f60e7', + hash: '0x4bcb6cd6b182209585f8ad140260ddb35c81a575dd40f508d9767e652a9f60e7', input: '0x', gasPrice: '0x77359400', nonce: '0x4b', diff --git a/app/scripts/controllers/permissions/caveat-mutators.test.js b/app/scripts/controllers/permissions/caveat-mutators.test.js index 476b3e1f6..23b140163 100644 --- a/app/scripts/controllers/permissions/caveat-mutators.test.js +++ b/app/scripts/controllers/permissions/caveat-mutators.test.js @@ -4,9 +4,8 @@ import { CaveatMutatorFactories } from './caveat-mutators'; describe('caveat mutators', () => { describe('restrictReturnedAccounts', () => { - const { removeAccount } = CaveatMutatorFactories[ - CaveatTypes.restrictReturnedAccounts - ]; + const { removeAccount } = + CaveatMutatorFactories[CaveatTypes.restrictReturnedAccounts]; describe('removeAccount', () => { it('returns the no-op operation if the target account is not permitted', () => { diff --git a/app/scripts/controllers/permissions/flask/snap-permissions.test.js b/app/scripts/controllers/permissions/flask/snap-permissions.test.js index c1f5dcce6..a6ee60f78 100644 --- a/app/scripts/controllers/permissions/flask/snap-permissions.test.js +++ b/app/scripts/controllers/permissions/flask/snap-permissions.test.js @@ -31,7 +31,6 @@ describe('buildSnapRestrictedMethodSpecifications', () => { expect(specification).toMatchObject({ targetKey: expect.stringMatching(/^(snap_|wallet_)/u), methodImplementation: expect.any(Function), - allowedCaveats: null, }); }); }); diff --git a/app/scripts/controllers/permissions/specifications.js b/app/scripts/controllers/permissions/specifications.js index ac52af06c..de6b1bdad 100644 --- a/app/scripts/controllers/permissions/specifications.js +++ b/app/scripts/controllers/permissions/specifications.js @@ -1,4 +1,7 @@ import { constructPermission, PermissionType } from '@metamask/controllers'; +///: BEGIN:ONLY_INCLUDE_IN(flask) +import { caveatSpecifications as snapsCaveatsSpecifications } from '@metamask/rpc-methods'; +///: END:ONLY_INCLUDE_IN import { CaveatTypes, RestrictedMethods, @@ -63,6 +66,10 @@ export const getCaveatSpecifications = ({ getIdentities }) => { validator: (caveat, _origin, _target) => validateCaveatAccounts(caveat.value, getIdentities), }, + + ///: BEGIN:ONLY_INCLUDE_IN(flask) + ...snapsCaveatsSpecifications, + ///: END:ONLY_INCLUDE_IN }; }; diff --git a/app/scripts/controllers/permissions/specifications.test.js b/app/scripts/controllers/permissions/specifications.test.js index dcbb69c64..3d668b2f4 100644 --- a/app/scripts/controllers/permissions/specifications.test.js +++ b/app/scripts/controllers/permissions/specifications.test.js @@ -15,10 +15,15 @@ describe('PermissionController specifications', () => { describe('caveat specifications', () => { it('getCaveatSpecifications returns the expected specifications object', () => { const caveatSpecifications = getCaveatSpecifications({}); - expect(Object.keys(caveatSpecifications)).toHaveLength(1); + expect(Object.keys(caveatSpecifications)).toHaveLength(2); expect( caveatSpecifications[CaveatTypes.restrictReturnedAccounts].type, ).toStrictEqual(CaveatTypes.restrictReturnedAccounts); + + // TODO: Use `SnapCaveatType` from `rpc-methods` when it's exported. + expect(caveatSpecifications.permittedDerivationPaths.type).toStrictEqual( + 'permittedDerivationPaths', + ); }); describe('restrictReturnedAccounts', () => { diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index c1a1d2c7b..18ac909a7 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -38,7 +38,7 @@ export default class PreferencesController { // set to true means the dynamic list from the API is being used // set to false will be using the static list from contract-metadata - useTokenDetection: Boolean(process.env.TOKEN_DETECTION_V2), + useTokenDetection: false, useCollectibleDetection: false, openSeaEnabled: false, advancedGasFee: null, @@ -79,6 +79,7 @@ export default class PreferencesController { this.store.setMaxListeners(12); this.openPopup = opts.openPopup; this.migrateAddressBookState = opts.migrateAddressBookState; + this.tokenListController = opts.tokenListController; this._subscribeToInfuraAvailability(); @@ -131,6 +132,13 @@ export default class PreferencesController { */ setUseTokenDetection(val) { this.store.updateState({ useTokenDetection: val }); + this.tokenListController.updatePreventPollingOnNetworkRestart(!val); + if (val) { + this.tokenListController.start(); + } else { + this.tokenListController.clearingTokenListData(); + this.tokenListController.stop(); + } } /** diff --git a/app/scripts/controllers/preferences.test.js b/app/scripts/controllers/preferences.test.js index 407b95b0e..8696f7997 100644 --- a/app/scripts/controllers/preferences.test.js +++ b/app/scripts/controllers/preferences.test.js @@ -1,5 +1,9 @@ import { strict as assert } from 'assert'; import sinon from 'sinon'; +import { + ControllerMessenger, + TokenListController, +} from '@metamask/controllers'; import { MAINNET_CHAIN_ID } from '../../../shared/constants/network'; import PreferencesController from './preferences'; import NetworkController from './network'; @@ -9,6 +13,7 @@ describe('preferences controller', function () { let network; let currentChainId; let provider; + let tokenListController; const migrateAddressBookState = sinon.stub(); beforeEach(function () { @@ -21,6 +26,16 @@ describe('preferences controller', function () { network.setInfuraProjectId('foo'); network.initializeProvider(networkControllerProviderConfig); provider = network.getProviderAndBlockTracker().provider; + const tokenListMessenger = new ControllerMessenger().getRestricted({ + name: 'TokenListController', + }); + tokenListController = new TokenListController({ + chainId: '1', + preventPollingOnNetworkRestart: false, + onNetworkStateChange: sinon.spy(), + onPreferencesStateChange: sinon.spy(), + messenger: tokenListMessenger, + }); sandbox .stub(network, 'getLatestBlock') @@ -35,6 +50,7 @@ describe('preferences controller', function () { migrateAddressBookState, network, provider, + tokenListController, }); }); diff --git a/app/scripts/controllers/swaps.js b/app/scripts/controllers/swaps.js index 01ccf0b38..e49eff3c5 100644 --- a/app/scripts/controllers/swaps.js +++ b/app/scripts/controllers/swaps.js @@ -90,7 +90,8 @@ const initialState = { swapsQuoteRefreshTime: FALLBACK_QUOTE_REFRESH_TIME, swapsQuotePrefetchingRefreshTime: FALLBACK_QUOTE_REFRESH_TIME, swapsStxBatchStatusRefreshTime: FALLBACK_SMART_TRANSACTIONS_REFRESH_TIME, - swapsStxGetTransactionsRefreshTime: FALLBACK_SMART_TRANSACTIONS_REFRESH_TIME, + swapsStxGetTransactionsRefreshTime: + FALLBACK_SMART_TRANSACTIONS_REFRESH_TIME, swapsStxMaxFeeMultiplier: FALLBACK_SMART_TRANSACTIONS_MAX_FEE_MULTIPLIER, swapsFeatureFlags: {}, }, @@ -336,10 +337,8 @@ export default class SwapsController { if (Object.values(newQuotes).length === 0) { this.setSwapsErrorKey(QUOTES_NOT_AVAILABLE_ERROR); } else { - const [ - _topAggId, - quotesWithSavingsAndFeeData, - ] = await this._findTopQuoteAndCalculateSavings(newQuotes); + const [_topAggId, quotesWithSavingsAndFeeData] = + await this._findTopQuoteAndCalculateSavings(newQuotes); topAggId = _topAggId; newQuotes = quotesWithSavingsAndFeeData; } @@ -486,10 +485,8 @@ export default class SwapsController { const quoteToUpdate = { ...swapsState.quotes[initialAggId] }; - const { - gasLimit: newGasEstimate, - simulationFails, - } = await this.timedoutGasReturn(quoteToUpdate.trade); + const { gasLimit: newGasEstimate, simulationFails } = + await this.timedoutGasReturn(quoteToUpdate.trade); if (newGasEstimate && !simulationFails) { const gasEstimateWithRefund = calculateGasEstimateWithRefund( @@ -637,9 +634,8 @@ export default class SwapsController { } async _findTopQuoteAndCalculateSavings(quotes = {}) { - const { - contractExchangeRates: tokenConversionRates, - } = this.getTokenRatesState(); + const { contractExchangeRates: tokenConversionRates } = + this.getTokenRatesState(); const { swapsState: { customGasPrice, customMaxPriorityFeePerGas }, } = this.store.getState(); @@ -652,10 +648,8 @@ export default class SwapsController { const newQuotes = cloneDeep(quotes); - const { - gasFeeEstimates, - gasEstimateType, - } = await this._getEIP1559GasFeeEstimates(); + const { gasFeeEstimates, gasEstimateType } = + await this._getEIP1559GasFeeEstimates(); let usedGasPrice = '0x0'; @@ -756,9 +750,8 @@ export default class SwapsController { const tokenPercentageOfPreFeeDestAmount = new BigNumber(100, 10) .minus(metaMaskFee, 10) .div(100); - const destinationAmountBeforeMetaMaskFee = decimalAdjustedDestinationAmount.div( - tokenPercentageOfPreFeeDestAmount, - ); + const destinationAmountBeforeMetaMaskFee = + decimalAdjustedDestinationAmount.div(tokenPercentageOfPreFeeDestAmount); const metaMaskFeeInTokens = destinationAmountBeforeMetaMaskFee.minus( decimalAdjustedDestinationAmount, ); diff --git a/app/scripts/controllers/swaps.test.js b/app/scripts/controllers/swaps.test.js index f8f580c4d..e34dff016 100644 --- a/app/scripts/controllers/swaps.test.js +++ b/app/scripts/controllers/swaps.test.js @@ -42,8 +42,7 @@ const TEST_AGG_ID_APPROVAL = 'TEST_AGG_APPROVAL'; const POLLING_TIMEOUT = SECOND * 1000; const MOCK_APPROVAL_NEEDED = { - data: - '0x095ea7b300000000000000000000000095e6f48254609a6ee006f7d493c8e5fb97094cef0000000000000000000000000000000000000000004a817c7ffffffdabf41c00', + data: '0x095ea7b300000000000000000000000095e6f48254609a6ee006f7d493c8e5fb97094cef0000000000000000000000000000000000000000004a817c7ffffffdabf41c00', to: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', amount: '0', from: '0x2369267687A84ac7B494daE2f1542C40E37f4455', @@ -139,7 +138,8 @@ const EMPTY_INIT_STATE = { swapsQuoteRefreshTime: 60000, swapsQuotePrefetchingRefreshTime: 60000, swapsStxBatchStatusRefreshTime: FALLBACK_SMART_TRANSACTIONS_REFRESH_TIME, - swapsStxGetTransactionsRefreshTime: FALLBACK_SMART_TRANSACTIONS_REFRESH_TIME, + swapsStxGetTransactionsRefreshTime: + FALLBACK_SMART_TRANSACTIONS_REFRESH_TIME, swapsStxMaxFeeMultiplier: FALLBACK_SMART_TRANSACTIONS_MAX_FEE_MULTIPLIER, swapsUserFeeLevel: '', saveFetchedQuotes: false, @@ -370,13 +370,10 @@ describe('SwapsController', function () { baseGasEstimate, ); - const { - gasLimit: bufferedGasLimit, - } = await swapsController.getBufferedGasLimit(); - const { - gasEstimate, - gasEstimateWithRefund, - } = swapsController.store.getState().swapsState.quotes[initialAggId]; + const { gasLimit: bufferedGasLimit } = + await swapsController.getBufferedGasLimit(); + const { gasEstimate, gasEstimateWithRefund } = + swapsController.store.getState().swapsState.quotes[initialAggId]; assert.strictEqual(gasEstimate, bufferedGasLimit); assert.strictEqual( gasEstimateWithRefund, @@ -416,12 +413,10 @@ describe('SwapsController', function () { }); it('returns the top aggId and quotes with savings and fee values if passed necessary data and an even number of quotes', async function () { - const [ - topAggId, - resultQuotes, - ] = await swapsController._findTopQuoteAndCalculateSavings( - getTopQuoteAndSavingsMockQuotes(), - ); + const [topAggId, resultQuotes] = + await swapsController._findTopQuoteAndCalculateSavings( + getTopQuoteAndSavingsMockQuotes(), + ); assert.equal(topAggId, TEST_AGG_ID_1); assert.deepStrictEqual( resultQuotes, @@ -442,10 +437,8 @@ describe('SwapsController', function () { medianMetaMaskFee: '0.0202', }; - const [ - topAggId, - resultQuotes, - ] = await swapsController._findTopQuoteAndCalculateSavings(testInput); + const [topAggId, resultQuotes] = + await swapsController._findTopQuoteAndCalculateSavings(testInput); assert.equal(topAggId, TEST_AGG_ID_1); assert.deepStrictEqual(resultQuotes, expectedResultQuotes); }); @@ -485,10 +478,8 @@ describe('SwapsController', function () { }, }; - const [ - topAggId, - resultQuotes, - ] = await swapsController._findTopQuoteAndCalculateSavings(testInput); + const [topAggId, resultQuotes] = + await swapsController._findTopQuoteAndCalculateSavings(testInput); assert.equal(topAggId, TEST_AGG_ID_1); assert.deepStrictEqual(resultQuotes, expectedResultQuotes); }); @@ -503,7 +494,8 @@ describe('SwapsController', function () { trade: { value: '0x8ac7230489e80000' }, }), ); - const baseExpectedResultQuotes = getTopQuoteAndSavingsBaseExpectedResults(); + const baseExpectedResultQuotes = + getTopQuoteAndSavingsBaseExpectedResults(); const expectedResultQuotes = { [TEST_AGG_ID_1]: { ...baseExpectedResultQuotes[TEST_AGG_ID_1], @@ -549,10 +541,8 @@ describe('SwapsController', function () { }, }; - const [ - topAggId, - resultQuotes, - ] = await swapsController._findTopQuoteAndCalculateSavings(testInput); + const [topAggId, resultQuotes] = + await swapsController._findTopQuoteAndCalculateSavings(testInput); assert.equal(topAggId, TEST_AGG_ID_1); assert.deepStrictEqual(resultQuotes, expectedResultQuotes); }); @@ -569,7 +559,8 @@ describe('SwapsController', function () { ); // 0.04 ETH fee included in trade value testInput[TEST_AGG_ID_1].trade.value = '0x8b553ece48ec0000'; - const baseExpectedResultQuotes = getTopQuoteAndSavingsBaseExpectedResults(); + const baseExpectedResultQuotes = + getTopQuoteAndSavingsBaseExpectedResults(); const expectedResultQuotes = { [TEST_AGG_ID_1]: { ...baseExpectedResultQuotes[TEST_AGG_ID_1], @@ -626,10 +617,8 @@ describe('SwapsController', function () { delete expectedResultQuotes[TEST_AGG_ID_1].isBestQuote; delete expectedResultQuotes[TEST_AGG_ID_1].savings; - const [ - topAggId, - resultQuotes, - ] = await swapsController._findTopQuoteAndCalculateSavings(testInput); + const [topAggId, resultQuotes] = + await swapsController._findTopQuoteAndCalculateSavings(testInput); assert.equal(topAggId, TEST_AGG_ID_2); assert.deepStrictEqual(resultQuotes, expectedResultQuotes); }); @@ -638,7 +627,8 @@ describe('SwapsController', function () { const testInput = getTopQuoteAndSavingsMockQuotes(); // 0.04 ETH fee included in trade value testInput[TEST_AGG_ID_1].trade.value = '0x8e1bc9bf040000'; - const baseExpectedResultQuotes = getTopQuoteAndSavingsBaseExpectedResults(); + const baseExpectedResultQuotes = + getTopQuoteAndSavingsBaseExpectedResults(); const expectedResultQuotes = { ...baseExpectedResultQuotes, [TEST_AGG_ID_1]: { @@ -662,10 +652,8 @@ describe('SwapsController', function () { delete expectedResultQuotes[TEST_AGG_ID_1].isBestQuote; delete expectedResultQuotes[TEST_AGG_ID_1].savings; - const [ - topAggId, - resultQuotes, - ] = await swapsController._findTopQuoteAndCalculateSavings(testInput); + const [topAggId, resultQuotes] = + await swapsController._findTopQuoteAndCalculateSavings(testInput); assert.equal(topAggId, TEST_AGG_ID_2); assert.deepStrictEqual(resultQuotes, expectedResultQuotes); }); diff --git a/app/scripts/controllers/threebox.js b/app/scripts/controllers/threebox.js index fc278d0b2..6af4b9711 100644 --- a/app/scripts/controllers/threebox.js +++ b/app/scripts/controllers/threebox.js @@ -225,9 +225,8 @@ export default class ThreeBoxController { PreferencesController: preferences, AddressBookController: addressBook, }; - const initialMigrationState = migrator.generateInitialState( - formattedStateBackup, - ); + const initialMigrationState = + migrator.generateInitialState(formattedStateBackup); const migratedState = await migrator.migrateData(initialMigrationState); return { preferences: migratedState.data.PreferencesController, diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index a616ce357..8103b0767 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -27,6 +27,8 @@ import { import { TRANSACTION_STATUSES, TRANSACTION_TYPES, + TRANSACTION_APPROVAL_AMOUNT_TYPE, + TOKEN_STANDARDS, TRANSACTION_ENVELOPE_TYPES, TRANSACTION_EVENTS, } from '../../../../shared/constants/transaction'; @@ -174,9 +176,8 @@ export default class TransactionController extends EventEmitter { ); return [...pendingTransactions, ...externalPendingTransactions]; }, - getConfirmedTransactions: this.txStateManager.getConfirmedTransactions.bind( - this.txStateManager, - ), + getConfirmedTransactions: + this.txStateManager.getConfirmedTransactions.bind(this.txStateManager), }); this.pendingTxTracker = new PendingTransactionTracker({ @@ -189,9 +190,8 @@ export default class TransactionController extends EventEmitter { return [...pending, ...approved]; }, approveTransaction: this.approveTransaction.bind(this), - getCompletedTransactions: this.txStateManager.getConfirmedTransactions.bind( - this.txStateManager, - ), + getCompletedTransactions: + this.txStateManager.getConfirmedTransactions.bind(this.txStateManager), }); this.txStateManager.store.subscribe(() => @@ -227,10 +227,10 @@ export default class TransactionController extends EventEmitter { } async getEIP1559Compatibility(fromAddress) { - const currentNetworkIsCompatible = await this._getCurrentNetworkEIP1559Compatibility(); - const fromAccountIsCompatible = await this._getCurrentAccountEIP1559Compatibility( - fromAddress, - ); + const currentNetworkIsCompatible = + await this._getCurrentNetworkEIP1559Compatibility(); + const fromAccountIsCompatible = + await this._getCurrentAccountEIP1559Compatibility(fromAddress); return currentNetworkIsCompatible && fromAccountIsCompatible; } @@ -815,10 +815,8 @@ export default class TransactionController extends EventEmitter { maxFeePerGas: defaultMaxFeePerGas, maxPriorityFeePerGas: defaultMaxPriorityFeePerGas, } = await this._getDefaultGasFees(txMeta, eip1559Compatibility); - const { - gasLimit: defaultGasLimit, - simulationFails, - } = await this._getDefaultGasLimit(txMeta, getCodeResponse); + const { gasLimit: defaultGasLimit, simulationFails } = + await this._getDefaultGasLimit(txMeta, getCodeResponse); // eslint-disable-next-line no-param-reassign txMeta = this.txStateManager.getTransaction(txMeta.id); @@ -960,10 +958,8 @@ export default class TransactionController extends EventEmitter { } try { - const { - gasFeeEstimates, - gasEstimateType, - } = await this._getEIP1559GasFeeEstimates(); + const { gasFeeEstimates, gasEstimateType } = + await this._getEIP1559GasFeeEstimates(); if ( eip1559Compatibility && gasEstimateType === GAS_ESTIMATE_TYPES.FEE_MARKET @@ -1025,11 +1021,8 @@ export default class TransactionController extends EventEmitter { return { gasLimit: GAS_LIMITS.SIMPLE }; } - const { - blockGasLimit, - estimatedGasHex, - simulationFails, - } = await this.txGasUtil.analyzeGasUsage(txMeta); + const { blockGasLimit, estimatedGasHex, simulationFails } = + await this.txGasUtil.analyzeGasUsage(txMeta); // add additional gas buffer to our estimation for safety const gasLimit = this.txGasUtil.addGasBuffer( @@ -1203,6 +1196,7 @@ export default class TransactionController extends EventEmitter { loadingDefaults: false, status: TRANSACTION_STATUSES.APPROVED, type: TRANSACTION_TYPES.RETRY, + originalType: originalTxMeta.type, }); if (estimatedBaseFee) { @@ -1531,9 +1525,8 @@ export default class TransactionController extends EventEmitter { const metricsParams = { gas_used: gasUsed }; if (submittedTime) { - metricsParams.completion_time = this._getTransactionCompletionTime( - submittedTime, - ); + metricsParams.completion_time = + this._getTransactionCompletionTime(submittedTime); } if (txReceipt.status === '0x0') { @@ -1592,9 +1585,8 @@ export default class TransactionController extends EventEmitter { const metricsParams = { gas_used: gasUsed }; if (submittedTime) { - metricsParams.completion_time = this._getTransactionCompletionTime( - submittedTime, - ); + metricsParams.completion_time = + this._getTransactionCompletionTime(submittedTime); } if (txReceipt.status === '0x0') { @@ -1659,10 +1651,8 @@ export default class TransactionController extends EventEmitter { */ async createTransactionEventFragment(transactionId, event) { const txMeta = this.txStateManager.getTransaction(transactionId); - const { - properties, - sensitiveProperties, - } = await this._buildEventFragmentProperties(txMeta); + const { properties, sensitiveProperties } = + await this._buildEventFragmentProperties(txMeta); this._createTransactionEventFragment( txMeta, event, @@ -1840,6 +1830,7 @@ export default class TransactionController extends EventEmitter { return; } otherTxMeta.replacedBy = txMeta.hash; + otherTxMeta.replacedById = txMeta.id; this.txStateManager.updateTransaction( txMeta, 'transactions/pending-tx-tracker#event: tx:confirmed reference to confirmed txHash with same nonce', @@ -1976,8 +1967,64 @@ export default class TransactionController extends EventEmitter { } } + /** + * The allowance amount in relation to the dapp proposed amount for specific token + * + * @param {string} transactionApprovalAmountType - The transaction approval amount type + * @param {string} originalApprovalAmount - The original approval amount is the originally dapp proposed token amount + * @param {string} finalApprovalAmount - The final approval amount is the chosen amount which will be the same as the + * originally dapp proposed token amount if the user does not edit the amount or will be a custom token amount set by the user + */ + _allowanceAmountInRelationToDappProposedValue( + transactionApprovalAmountType, + originalApprovalAmount, + finalApprovalAmount, + ) { + if ( + transactionApprovalAmountType === + TRANSACTION_APPROVAL_AMOUNT_TYPE.CUSTOM && + originalApprovalAmount && + finalApprovalAmount + ) { + return `${new BigNumber(originalApprovalAmount, 10) + .div(finalApprovalAmount, 10) + .times(100) + .round(2)}`; + } + return null; + } + + /** + * The allowance amount in relation to the balance for that specific token + * + * @param {string} transactionApprovalAmountType - The transaction approval amount type + * @param {string} dappProposedTokenAmount - The dapp proposed token amount + * @param {string} currentTokenBalance - The balance of the token that is being send + */ + _allowanceAmountInRelationToTokenBalance( + transactionApprovalAmountType, + dappProposedTokenAmount, + currentTokenBalance, + ) { + if ( + (transactionApprovalAmountType === + TRANSACTION_APPROVAL_AMOUNT_TYPE.CUSTOM || + transactionApprovalAmountType === + TRANSACTION_APPROVAL_AMOUNT_TYPE.DAPP_PROPOSED) && + dappProposedTokenAmount && + currentTokenBalance + ) { + return `${new BigNumber(dappProposedTokenAmount, 16) + .div(currentTokenBalance, 10) + .times(100) + .round(2)}`; + } + return null; + } + async _buildEventFragmentProperties(txMeta, extraParams) { const { + id, type, time, status, @@ -1992,8 +2039,11 @@ export default class TransactionController extends EventEmitter { estimateUsed, }, defaultGasEstimates, + originalType, + replacedById, metamaskNetworkId: network, } = txMeta; + const { transactions } = this.store.getState(); const source = referrer === ORIGIN_METAMASK ? 'user' : 'dapp'; const { assetType, tokenStandard } = await determineTransactionAssetType( @@ -2035,7 +2085,8 @@ export default class TransactionController extends EventEmitter { if (gasFeeEstimates?.[estimateType]?.suggestedMaxPriorityFeePerGas) { defaultMaxPriorityFeePerGas = gasFeeEstimates[estimateType]?.suggestedMaxPriorityFeePerGas; - gasParams.default_max_priority_fee_per_gas = defaultMaxPriorityFeePerGas; + gasParams.default_max_priority_fee_per_gas = + defaultMaxPriorityFeePerGas; } } } @@ -2068,12 +2119,93 @@ export default class TransactionController extends EventEmitter { eip1559Version = eip1559V2Enabled ? '2' : '1'; } - const properties = { + const contractInteractionTypes = [ + TRANSACTION_TYPES.CONTRACT_INTERACTION, + TRANSACTION_TYPES.TOKEN_METHOD_APPROVE, + TRANSACTION_TYPES.TOKEN_METHOD_SAFE_TRANSFER_FROM, + TRANSACTION_TYPES.TOKEN_METHOD_SET_APPROVAL_FOR_ALL, + TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER, + TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM, + TRANSACTION_TYPES.SMART, + TRANSACTION_TYPES.SWAP, + TRANSACTION_TYPES.SWAP_APPROVAL, + ].includes(type); + + const contractMethodNames = { + APPROVE: 'Approve', + }; + + const customTokenAmount = transactions[id]?.customTokenAmount; + const dappProposedTokenAmount = transactions[id]?.dappProposedTokenAmount; + const currentTokenBalance = transactions[id]?.currentTokenBalance; + const originalApprovalAmount = transactions[id]?.originalApprovalAmount; + const finalApprovalAmount = transactions[id]?.finalApprovalAmount; + let transactionApprovalAmountType; + let transactionContractMethod; + let transactionApprovalAmountVsProposedRatio; + let transactionApprovalAmountVsBalanceRatio; + let transactionType = TRANSACTION_TYPES.SIMPLE_SEND; + if (type === TRANSACTION_TYPES.CANCEL) { + transactionType = TRANSACTION_TYPES.CANCEL; + } else if (type === TRANSACTION_TYPES.RETRY) { + transactionType = originalType; + } else if (type === TRANSACTION_TYPES.DEPLOY_CONTRACT) { + transactionType = TRANSACTION_TYPES.DEPLOY_CONTRACT; + } else if (contractInteractionTypes) { + transactionType = TRANSACTION_TYPES.CONTRACT_INTERACTION; + transactionContractMethod = transactions[id]?.contractMethodName; + if ( + transactionContractMethod === contractMethodNames.APPROVE && + tokenStandard === TOKEN_STANDARDS.ERC20 + ) { + if (dappProposedTokenAmount === '0' || customTokenAmount === '0') { + transactionApprovalAmountType = + TRANSACTION_APPROVAL_AMOUNT_TYPE.REVOKE; + } else if (customTokenAmount) { + transactionApprovalAmountType = + TRANSACTION_APPROVAL_AMOUNT_TYPE.CUSTOM; + } else if (dappProposedTokenAmount) { + transactionApprovalAmountType = + TRANSACTION_APPROVAL_AMOUNT_TYPE.DAPP_PROPOSED; + } + transactionApprovalAmountVsProposedRatio = + this._allowanceAmountInRelationToDappProposedValue( + transactionApprovalAmountType, + originalApprovalAmount, + finalApprovalAmount, + ); + transactionApprovalAmountVsBalanceRatio = + this._allowanceAmountInRelationToTokenBalance( + transactionApprovalAmountType, + dappProposedTokenAmount, + currentTokenBalance, + ); + } + } + + const replacedTxMeta = this._getTransaction(replacedById); + + const TRANSACTION_REPLACEMENT_METHODS = { + RETRY: TRANSACTION_TYPES.RETRY, + CANCEL: TRANSACTION_TYPES.CANCEL, + SAME_NONCE: 'other', + }; + + let transactionReplaced; + if (extraParams?.dropped) { + transactionReplaced = TRANSACTION_REPLACEMENT_METHODS.SAME_NONCE; + if (replacedTxMeta?.type === TRANSACTION_TYPES.CANCEL) { + transactionReplaced = TRANSACTION_REPLACEMENT_METHODS.CANCEL; + } else if (replacedTxMeta?.type === TRANSACTION_TYPES.RETRY) { + transactionReplaced = TRANSACTION_REPLACEMENT_METHODS.RETRY; + } + } + + let properties = { chain_id: chainId, referrer, source, network, - type, eip_1559_version: eip1559Version, gas_edit_type: 'none', gas_edit_attempted: 'none', @@ -2081,19 +2213,40 @@ export default class TransactionController extends EventEmitter { device_model: await this.getDeviceModel(this.getSelectedAddress()), asset_type: assetType, token_standard: tokenStandard, + transaction_type: transactionType, + transaction_speed_up: type === TRANSACTION_TYPES.RETRY, }; - const sensitiveProperties = { + if (transactionContractMethod === contractMethodNames.APPROVE) { + properties = { + ...properties, + transaction_approval_amount_type: transactionApprovalAmountType, + }; + } + + let sensitiveProperties = { status, transaction_envelope_type: isEIP1559Transaction(txMeta) ? TRANSACTION_ENVELOPE_TYPE_NAMES.FEE_MARKET : TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, first_seen: time, gas_limit: gasLimit, + transaction_contract_method: transactionContractMethod, + transaction_replaced: transactionReplaced, ...extraParams, ...gasParamsInGwei, }; + if (transactionContractMethod === contractMethodNames.APPROVE) { + sensitiveProperties = { + ...sensitiveProperties, + transaction_approval_amount_vs_balance_ratio: + transactionApprovalAmountVsBalanceRatio, + transaction_approval_amount_vs_proposed_ratio: + transactionApprovalAmountVsProposedRatio, + }; + } + return { properties, sensitiveProperties }; } @@ -2228,10 +2381,8 @@ export default class TransactionController extends EventEmitter { if (!txMeta) { return; } - const { - properties, - sensitiveProperties, - } = await this._buildEventFragmentProperties(txMeta, extraParams); + const { properties, sensitiveProperties } = + await this._buildEventFragmentProperties(txMeta, extraParams); // Create event fragments for event types that spawn fragments, and ensure // existence of fragments for event types that act upon them. @@ -2300,6 +2451,8 @@ export default class TransactionController extends EventEmitter { _dropTransaction(txId) { this.txStateManager.setTxStatusDropped(txId); const txMeta = this.txStateManager.getTransaction(txId); - this._trackTransactionMetricsEvent(txMeta, TRANSACTION_EVENTS.FINALIZED); + this._trackTransactionMetricsEvent(txMeta, TRANSACTION_EVENTS.FINALIZED, { + dropped: true, + }); } } diff --git a/app/scripts/controllers/transactions/index.test.js b/app/scripts/controllers/transactions/index.test.js index c8adf4191..eb386706e 100644 --- a/app/scripts/controllers/transactions/index.test.js +++ b/app/scripts/controllers/transactions/index.test.js @@ -17,6 +17,7 @@ import { TRANSACTION_ENVELOPE_TYPES, TRANSACTION_EVENTS, ASSET_TYPES, + TOKEN_STANDARDS, } from '../../../../shared/constants/transaction'; import { SECOND } from '../../../../shared/constants/time'; @@ -26,7 +27,6 @@ import { } from '../../../../shared/constants/gas'; import { TRANSACTION_ENVELOPE_TYPE_NAMES } from '../../../../ui/helpers/constants/transactions'; import { METAMASK_CONTROLLER_EVENTS } from '../../metamask-controller'; -import { TOKEN_STANDARDS } from '../../../../ui/helpers/constants/common'; import { ORIGIN_METAMASK } from '../../../../shared/constants/app'; import TransactionController from '.'; @@ -1471,17 +1471,20 @@ describe('Transaction Controller', function () { network: '42', referrer: ORIGIN_METAMASK, source: EVENT.SOURCE.TRANSACTION.USER, - type: TRANSACTION_TYPES.SIMPLE_SEND, + transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, account_type: 'MetaMask', asset_type: ASSET_TYPES.NATIVE, token_standard: TOKEN_STANDARDS.NONE, device_model: 'N/A', + transaction_speed_up: false, }, sensitiveProperties: { default_gas: '0.000031501', default_gas_price: '2', gas_price: '2', gas_limit: '0x7b0d', + transaction_contract_method: undefined, + transaction_replaced: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, status: 'unapproved', @@ -1550,17 +1553,20 @@ describe('Transaction Controller', function () { network: '42', referrer: ORIGIN_METAMASK, source: EVENT.SOURCE.TRANSACTION.USER, - type: TRANSACTION_TYPES.SIMPLE_SEND, + transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, account_type: 'MetaMask', asset_type: ASSET_TYPES.NATIVE, token_standard: TOKEN_STANDARDS.NONE, device_model: 'N/A', + transaction_speed_up: false, }, sensitiveProperties: { default_gas: '0.000031501', default_gas_price: '2', gas_price: '2', gas_limit: '0x7b0d', + transaction_contract_method: undefined, + transaction_replaced: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, status: 'unapproved', @@ -1639,17 +1645,20 @@ describe('Transaction Controller', function () { network: '42', referrer: 'other', source: EVENT.SOURCE.TRANSACTION.DAPP, - type: TRANSACTION_TYPES.SIMPLE_SEND, + transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, account_type: 'MetaMask', asset_type: ASSET_TYPES.NATIVE, token_standard: TOKEN_STANDARDS.NONE, device_model: 'N/A', + transaction_speed_up: false, }, sensitiveProperties: { default_gas: '0.000031501', default_gas_price: '2', gas_price: '2', gas_limit: '0x7b0d', + transaction_contract_method: undefined, + transaction_replaced: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, status: 'unapproved', @@ -1720,17 +1729,20 @@ describe('Transaction Controller', function () { network: '42', referrer: 'other', source: EVENT.SOURCE.TRANSACTION.DAPP, - type: TRANSACTION_TYPES.SIMPLE_SEND, + transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, account_type: 'MetaMask', asset_type: ASSET_TYPES.NATIVE, token_standard: TOKEN_STANDARDS.NONE, device_model: 'N/A', + transaction_speed_up: false, }, sensitiveProperties: { default_gas: '0.000031501', default_gas_price: '2', gas_price: '2', gas_limit: '0x7b0d', + transaction_contract_method: undefined, + transaction_replaced: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, status: 'unapproved', @@ -1801,15 +1813,18 @@ describe('Transaction Controller', function () { network: '42', referrer: 'other', source: EVENT.SOURCE.TRANSACTION.DAPP, - type: TRANSACTION_TYPES.SIMPLE_SEND, + transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, account_type: 'MetaMask', asset_type: ASSET_TYPES.NATIVE, token_standard: TOKEN_STANDARDS.NONE, device_model: 'N/A', + transaction_speed_up: false, }, sensitiveProperties: { gas_price: '2', gas_limit: '0x7b0d', + transaction_contract_method: undefined, + transaction_replaced: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, status: 'unapproved', @@ -1860,7 +1875,7 @@ describe('Transaction Controller', function () { network: '42', referrer: 'other', source: EVENT.SOURCE.TRANSACTION.DAPP, - type: TRANSACTION_TYPES.SIMPLE_SEND, + transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, chain_id: '0x2a', eip_1559_version: '0', gas_edit_attempted: 'none', @@ -1869,12 +1884,15 @@ describe('Transaction Controller', function () { asset_type: ASSET_TYPES.NATIVE, token_standard: TOKEN_STANDARDS.NONE, device_model: 'N/A', + transaction_speed_up: false, }, sensitiveProperties: { baz: 3.0, foo: 'bar', gas_price: '2', gas_limit: '0x7b0d', + transaction_contract_method: undefined, + transaction_replaced: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, status: 'unapproved', @@ -1937,11 +1955,12 @@ describe('Transaction Controller', function () { network: '42', referrer: 'other', source: EVENT.SOURCE.TRANSACTION.DAPP, - type: TRANSACTION_TYPES.SIMPLE_SEND, + transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, account_type: 'MetaMask', asset_type: ASSET_TYPES.NATIVE, token_standard: TOKEN_STANDARDS.NONE, device_model: 'N/A', + transaction_speed_up: false, }, sensitiveProperties: { baz: 3.0, @@ -1949,6 +1968,8 @@ describe('Transaction Controller', function () { max_fee_per_gas: '2', max_priority_fee_per_gas: '2', gas_limit: '0x7b0d', + transaction_contract_method: undefined, + transaction_replaced: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.FEE_MARKET, status: 'unapproved', @@ -2277,8 +2298,7 @@ describe('Transaction Controller', function () { providerResultStub.eth_getCode = '0xab'; // test update gasFees await txController.updateEditableParams('1', { - data: - '0xa9059cbb000000000000000000000000e18035bf8712672935fdb4e5e431b1a0183d2dfc0000000000000000000000000000000000000000000000000de0b6b3a7640000', + data: '0xa9059cbb000000000000000000000000e18035bf8712672935fdb4e5e431b1a0183d2dfc0000000000000000000000000000000000000000000000000de0b6b3a7640000', }); const result = txStateManager.getTransaction('1'); assert.equal( @@ -2302,8 +2322,7 @@ describe('Transaction Controller', function () { // maxFeePerGas: '0x004', to: VALID_ADDRESS, from: VALID_ADDRESS, - data: - '0xa9059cbb000000000000000000000000e18035bf8712672935fdb4e5e431b1a0183d2dfc0000000000000000000000000000000000000000000000000de0b6b3a7640000', + data: '0xa9059cbb000000000000000000000000e18035bf8712672935fdb4e5e431b1a0183d2dfc0000000000000000000000000000000000000000000000000de0b6b3a7640000', }, estimateUsed: '0x005', estimatedBaseFee: '0x006', diff --git a/app/scripts/controllers/transactions/pending-tx-tracker.js b/app/scripts/controllers/transactions/pending-tx-tracker.js index 7fbaca8ce..e5a56b8ab 100644 --- a/app/scripts/controllers/transactions/pending-tx-tracker.js +++ b/app/scripts/controllers/transactions/pending-tx-tracker.js @@ -198,13 +198,8 @@ export default class PendingTransactionTracker extends EventEmitter { try { const transactionReceipt = await this.query.getTransactionReceipt(txHash); if (transactionReceipt?.blockNumber) { - const { - baseFeePerGas, - timestamp: blockTimestamp, - } = await this.query.getBlockByHash( - transactionReceipt?.blockHash, - false, - ); + const { baseFeePerGas, timestamp: blockTimestamp } = + await this.query.getBlockByHash(transactionReceipt?.blockHash, false); this.emit( 'tx:confirmed', diff --git a/app/scripts/controllers/transactions/pending-tx-tracker.test.js b/app/scripts/controllers/transactions/pending-tx-tracker.test.js index b359b25f9..572837fe7 100644 --- a/app/scripts/controllers/transactions/pending-tx-tracker.test.js +++ b/app/scripts/controllers/transactions/pending-tx-tracker.test.js @@ -154,8 +154,7 @@ describe('PendingTransactionTracker', function () { it('should call _checkPendingTx for each pending transaction', async function () { const txMeta = { id: 1, - hash: - '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', + hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', status: TRANSACTION_STATUSES.SIGNED, txParams: { from: '0x1678a085c290ebd122dc42cba69373b5953b831d', @@ -212,8 +211,7 @@ describe('PendingTransactionTracker', function () { it('should publish a new transaction', async function () { const txMeta = { id: 1, - hash: - '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', + hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', status: TRANSACTION_STATUSES.SIGNED, txParams: { from: '0x1678a085c290ebd122dc42cba69373b5953b831d', @@ -257,8 +255,7 @@ describe('PendingTransactionTracker', function () { it('should publish the given transaction if more than 2**retryCount blocks have passed', async function () { const txMeta = { id: 1, - hash: - '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', + hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', status: TRANSACTION_STATUSES.SIGNED, txParams: { from: '0x1678a085c290ebd122dc42cba69373b5953b831d', @@ -304,8 +301,7 @@ describe('PendingTransactionTracker', function () { it('should NOT publish the given transaction if fewer than 2**retryCount blocks have passed', async function () { const txMeta = { id: 1, - hash: - '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', + hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', status: TRANSACTION_STATUSES.SIGNED, txParams: { from: '0x1678a085c290ebd122dc42cba69373b5953b831d', @@ -404,8 +400,7 @@ describe('PendingTransactionTracker', function () { assert.ok( await pendingTxTracker._checkIfTxWasDropped({ id: 1, - hash: - '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', + hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', status: TRANSACTION_STATUSES.SUBMITTED, txParams: { from: '0x1678a085c290ebd122dc42cba69373b5953b831d', @@ -437,8 +432,7 @@ describe('PendingTransactionTracker', function () { const dropped = await pendingTxTracker._checkIfTxWasDropped({ id: 1, - hash: - '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', + hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', status: TRANSACTION_STATUSES.SUBMITTED, txParams: { from: '0x1678a085c290ebd122dc42cba69373b5953b831d', @@ -458,8 +452,7 @@ describe('PendingTransactionTracker', function () { const confirmedTxList = [ { id: 1, - hash: - '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', + hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', status: TRANSACTION_STATUSES.CONFIRMED, txParams: { from: '0x1678a085c290ebd122dc42cba69373b5953b831d', @@ -471,8 +464,7 @@ describe('PendingTransactionTracker', function () { }, { id: 2, - hash: - '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', + hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', status: TRANSACTION_STATUSES.CONFIRMED, txParams: { from: '0x1678a085c290ebd122dc42cba69373b5953b831d', @@ -517,8 +509,7 @@ describe('PendingTransactionTracker', function () { const confirmedTxList = [ { id: 1, - hash: - '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', + hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', status: TRANSACTION_STATUSES.CONFIRMED, txParams: { from: '0x1678a085c290ebd122dc42cba69373b5953b831d', @@ -530,8 +521,7 @@ describe('PendingTransactionTracker', function () { }, { id: 2, - hash: - '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', + hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', status: TRANSACTION_STATUSES.CONFIRMED, txParams: { from: '0x1678a085c290ebd122dc42cba69373b5953b831d', @@ -577,8 +567,7 @@ describe('PendingTransactionTracker', function () { it("should emit 'tx:warning' if getTransactionReceipt rejects", async function () { const txMeta = { id: 1, - hash: - '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', + hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', status: TRANSACTION_STATUSES.SUBMITTED, txParams: { from: '0x1678a085c290ebd122dc42cba69373b5953b831d', @@ -730,8 +719,7 @@ describe('PendingTransactionTracker', function () { txParams: { nonce: '0x1' }, id: '123', value: '0x02', - hash: - '0x2a919d2512ec963f524bfd9730fb66b6d5a2e399d1dd957abb5e2b544a12644b', + hash: '0x2a919d2512ec963f524bfd9730fb66b6d5a2e399d1dd957abb5e2b544a12644b', }, ]; const pendingTxTracker = new PendingTransactionTracker({ @@ -774,8 +762,7 @@ describe('PendingTransactionTracker', function () { const nonceBN = new BN(2); const txMeta = { id: 1, - hash: - '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', + hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb', status: TRANSACTION_STATUSES.SUBMITTED, txParams: { from: '0x1678a085c290ebd122dc42cba69373b5953b831d', diff --git a/app/scripts/controllers/transactions/tx-gas-utils.js b/app/scripts/controllers/transactions/tx-gas-utils.js index 350cb1eaa..cddcfc946 100644 --- a/app/scripts/controllers/transactions/tx-gas-utils.js +++ b/app/scripts/controllers/transactions/tx-gas-utils.js @@ -102,11 +102,8 @@ export default class TxGasUtil { } async getBufferedGasLimit(txMeta, multiplier) { - const { - blockGasLimit, - estimatedGasHex, - simulationFails, - } = await this.analyzeGasUsage(txMeta); + const { blockGasLimit, estimatedGasHex, simulationFails } = + await this.analyzeGasUsage(txMeta); // add additional gas buffer to our estimation for safety const gasLimit = this.addGasBuffer( diff --git a/app/scripts/disable-console.js b/app/scripts/disable-console.js index d1ba36d57..ff6fa46ed 100644 --- a/app/scripts/disable-console.js +++ b/app/scripts/disable-console.js @@ -2,7 +2,7 @@ // eslint-disable-next-line import/unambiguous if ( !(typeof process !== 'undefined' && process.env.METAMASK_DEBUG) && - typeof console !== undefined + typeof console !== 'undefined' ) { console.log = noop; console.info = noop; diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js index 9b4952a5e..95fce4fc7 100644 --- a/app/scripts/inpage.js +++ b/app/scripts/inpage.js @@ -34,6 +34,7 @@ cleanContextForImports(); import log from 'loglevel'; import { WindowPostMessageStream } from '@metamask/post-message-stream'; import { initializeProvider } from '@metamask/providers/dist/initializeInpageProvider'; +import shouldInjectProvider from '../../shared/modules/provider-injection'; restoreContextAfterImports(); @@ -43,14 +44,16 @@ log.setDefaultLevel(process.env.METAMASK_DEBUG ? 'debug' : 'warn'); // setup plugin communication // -// setup background connection -const metamaskStream = new WindowPostMessageStream({ - name: 'metamask-inpage', - target: 'metamask-contentscript', -}); - -initializeProvider({ - connectionStream: metamaskStream, - logger: log, - shouldShimWeb3: true, -}); +if (shouldInjectProvider()) { + // setup background connection + const metamaskStream = new WindowPostMessageStream({ + name: 'metamask-inpage', + target: 'metamask-contentscript', + }); + + initializeProvider({ + connectionStream: metamaskStream, + logger: log, + shouldShimWeb3: true, + }); +} diff --git a/app/scripts/lib/ComposableObservableStore.js b/app/scripts/lib/ComposableObservableStore.js index 6d156ab29..cbb346f5c 100644 --- a/app/scripts/lib/ComposableObservableStore.js +++ b/app/scripts/lib/ComposableObservableStore.js @@ -16,7 +16,7 @@ export default class ComposableObservableStore extends ObservableStore { * extends one of the two base controllers in the `@metamask/controllers` * package. * - * @type {Record} + * @type {Record} */ config = {}; @@ -43,7 +43,7 @@ export default class ComposableObservableStore extends ObservableStore { /** * Composes a new internal store subscription structure * - * @param {Record} config - Describes which stores are being + * @param {Record} config - Describes which stores are being * composed. The key is the name of the store, and the value is either an * ObserableStore, or a controller that extends one of the two base * controllers in the `@metamask/controllers` package. diff --git a/app/scripts/lib/account-tracker.js b/app/scripts/lib/account-tracker.js index d8c90588c..8dea01fc9 100644 --- a/app/scripts/lib/account-tracker.js +++ b/app/scripts/lib/account-tracker.js @@ -19,6 +19,13 @@ import { RINKEBY_CHAIN_ID, ROPSTEN_CHAIN_ID, KOVAN_CHAIN_ID, + GOERLI_CHAIN_ID, + BSC_CHAIN_ID, + OPTIMISM_CHAIN_ID, + POLYGON_CHAIN_ID, + AVALANCHE_CHAIN_ID, + FANTOM_CHAIN_ID, + ARBITRUM_CHAIN_ID, } from '../../../shared/constants/network'; import { @@ -26,6 +33,13 @@ import { SINGLE_CALL_BALANCES_ADDRESS_RINKEBY, SINGLE_CALL_BALANCES_ADDRESS_ROPSTEN, SINGLE_CALL_BALANCES_ADDRESS_KOVAN, + SINGLE_CALL_BALANCES_ADDRESS_GOERLI, + SINGLE_CALL_BALANCES_ADDRESS_BSC, + SINGLE_CALL_BALANCES_ADDRESS_OPTIMISM, + SINGLE_CALL_BALANCES_ADDRESS_POLYGON, + SINGLE_CALL_BALANCES_ADDRESS_AVALANCHE, + SINGLE_CALL_BALANCES_ADDRESS_FANTOM, + SINGLE_CALL_BALANCES_ADDRESS_ARBITRUM, } from '../constants/contracts'; import { bnToHex } from './util'; @@ -230,6 +244,55 @@ export default class AccountTracker { ); break; + case GOERLI_CHAIN_ID: + await this._updateAccountsViaBalanceChecker( + addresses, + SINGLE_CALL_BALANCES_ADDRESS_GOERLI, + ); + break; + + case BSC_CHAIN_ID: + await this._updateAccountsViaBalanceChecker( + addresses, + SINGLE_CALL_BALANCES_ADDRESS_BSC, + ); + break; + + case OPTIMISM_CHAIN_ID: + await this._updateAccountsViaBalanceChecker( + addresses, + SINGLE_CALL_BALANCES_ADDRESS_OPTIMISM, + ); + break; + + case POLYGON_CHAIN_ID: + await this._updateAccountsViaBalanceChecker( + addresses, + SINGLE_CALL_BALANCES_ADDRESS_POLYGON, + ); + break; + + case AVALANCHE_CHAIN_ID: + await this._updateAccountsViaBalanceChecker( + addresses, + SINGLE_CALL_BALANCES_ADDRESS_AVALANCHE, + ); + break; + + case FANTOM_CHAIN_ID: + await this._updateAccountsViaBalanceChecker( + addresses, + SINGLE_CALL_BALANCES_ADDRESS_FANTOM, + ); + break; + + case ARBITRUM_CHAIN_ID: + await this._updateAccountsViaBalanceChecker( + addresses, + SINGLE_CALL_BALANCES_ADDRESS_ARBITRUM, + ); + break; + default: await Promise.all(addresses.map(this._updateAccount.bind(this))); } @@ -243,8 +306,17 @@ export default class AccountTracker { * @returns {Promise} after the account balance is updated */ async _updateAccount(address) { + let balance = '0x0'; + // query balance - const balance = await this._query.getBalance(address); + try { + balance = await this._query.getBalance(address); + } catch (error) { + if (error.data?.request?.method !== 'eth_getBalance') { + throw error; + } + } + const result = { address, balance }; // update accounts state const { accounts } = this.store.getState(); diff --git a/app/scripts/lib/buy-url.js b/app/scripts/lib/buy-url.js index 7cd885a66..579e0c51c 100644 --- a/app/scripts/lib/buy-url.js +++ b/app/scripts/lib/buy-url.js @@ -9,7 +9,6 @@ import { ROPSTEN_CHAIN_ID, BUYABLE_CHAINS_MAP, } from '../../../shared/constants/network'; -import { SECOND } from '../../../shared/constants/time'; import getFetchWithTimeout from '../../../shared/modules/fetch-with-timeout'; import { TRANSAK_API_KEY, @@ -17,7 +16,7 @@ import { COINBASEPAY_API_KEY, } from '../constants/on-ramp'; -const fetchWithTimeout = getFetchWithTimeout(SECOND * 30); +const fetchWithTimeout = getFetchWithTimeout(); /** * Create a Wyre purchase URL. @@ -83,9 +82,8 @@ const createTransakUrl = (walletAddress, chainId) => { * @returns String */ const createMoonPayUrl = async (walletAddress, chainId) => { - const { - moonPay: { defaultCurrencyCode, showOnlyCurrencies } = {}, - } = BUYABLE_CHAINS_MAP[chainId]; + const { moonPay: { defaultCurrencyCode, showOnlyCurrencies } = {} } = + BUYABLE_CHAINS_MAP[chainId]; const moonPayQueryParams = new URLSearchParams({ apiKey: MOONPAY_API_KEY, walletAddress, diff --git a/app/scripts/lib/buy-url.test.js b/app/scripts/lib/buy-url.test.js index b582bae19..21c3a3498 100644 --- a/app/scripts/lib/buy-url.test.js +++ b/app/scripts/lib/buy-url.test.js @@ -116,9 +116,8 @@ describe('buy-url', () => { }); it('returns a MoonPay url with a prefilled wallet address for the Ethereum network', async () => { - const { - moonPay: { defaultCurrencyCode, showOnlyCurrencies } = {}, - } = BUYABLE_CHAINS_MAP[MAINNET.chainId]; + const { moonPay: { defaultCurrencyCode, showOnlyCurrencies } = {} } = + BUYABLE_CHAINS_MAP[MAINNET.chainId]; const moonPayQueryParams = new URLSearchParams({ apiKey: MOONPAY_API_KEY, walletAddress: MAINNET.address, diff --git a/app/scripts/lib/ens-ipfs/resolver.js b/app/scripts/lib/ens-ipfs/resolver.js index 95073b908..297b3e555 100644 --- a/app/scripts/lib/ens-ipfs/resolver.js +++ b/app/scripts/lib/ens-ipfs/resolver.js @@ -35,9 +35,8 @@ export default async function resolveEnsToIpfsContentId({ provider, name }) { const type = contentHash.getCodec(rawContentHash); if (type === 'ipfs-ns' || type === 'ipns-ns') { - decodedContentHash = contentHash.helpers.cidV0ToV1Base32( - decodedContentHash, - ); + decodedContentHash = + contentHash.helpers.cidV0ToV1Base32(decodedContentHash); } return { type, hash: decodedContentHash }; diff --git a/app/scripts/lib/ens-ipfs/setup.js b/app/scripts/lib/ens-ipfs/setup.js index 2d19811c3..942b888cc 100644 --- a/app/scripts/lib/ens-ipfs/setup.js +++ b/app/scripts/lib/ens-ipfs/setup.js @@ -2,11 +2,10 @@ import base32Encode from 'base32-encode'; import base64 from 'base64-js'; import browser from 'webextension-polyfill'; -import { SECOND } from '../../../../shared/constants/time'; import getFetchWithTimeout from '../../../../shared/modules/fetch-with-timeout'; import resolveEnsToIpfsContentId from './resolver'; -const fetchWithTimeout = getFetchWithTimeout(SECOND * 30); +const fetchWithTimeout = getFetchWithTimeout(); const supportedTopLevelDomains = ['eth']; diff --git a/app/scripts/lib/metaRPCClientFactory.js b/app/scripts/lib/metaRPCClientFactory.js index 1dfe572d2..c69651c01 100644 --- a/app/scripts/lib/metaRPCClientFactory.js +++ b/app/scripts/lib/metaRPCClientFactory.js @@ -3,6 +3,8 @@ import SafeEventEmitter from 'safe-event-emitter'; import createRandomId from '../../../shared/modules/random-id'; import { TEN_SECONDS_IN_MILLISECONDS } from '../../../ui/helpers/constants/critical-error'; +class DisconnectError extends Error {} + class MetaRPCClient { constructor(connectionStream) { this.connectionStream = connectionStream; @@ -12,6 +14,7 @@ class MetaRPCClient { this.connectionStream.on('data', this.handleResponse.bind(this)); this.connectionStream.on('end', this.close.bind(this)); this.responseHandled = {}; + this.DisconnectError = DisconnectError; } send(id, payload, cb) { @@ -47,6 +50,13 @@ class MetaRPCClient { close() { this.notificationChannel.removeAllListeners(); this.uncaughtErrorChannel.removeAllListeners(); + // fail all unfinished requests + for (const [id, handler] of this.requests) { + if (!this.responseHandled[id]) { + this.responseHandled[id] = true; + handler(new DisconnectError('disconnected')); + } + } } handleResponse(data) { diff --git a/app/scripts/lib/metaRPCClientFactory.test.js b/app/scripts/lib/metaRPCClientFactory.test.js index d8fbf6fe3..ccf547bdd 100644 --- a/app/scripts/lib/metaRPCClientFactory.test.js +++ b/app/scripts/lib/metaRPCClientFactory.test.js @@ -1,3 +1,4 @@ +/* eslint-disable jest/no-done-callback */ import { obj as createThoughStream } from 'through2'; import metaRPCClientFactory from './metaRPCClientFactory'; @@ -9,13 +10,14 @@ describe('metaRPCClientFactory', () => { const metaRPCClient = metaRPCClientFactory(streamTest); metaRPCClient.foo(); }); - it('should be able to make an rpc request/response with the method and params and node-style callback', () => { + it('should be able to make an rpc request/response with the method and params and node-style callback', (done) => { const streamTest = createThoughStream(); const metaRPCClient = metaRPCClientFactory(streamTest); // make a "foo" method call metaRPCClient.foo('bar', (_, result) => { expect(result).toStrictEqual('foobarbaz'); + done(); }); // fake a response @@ -27,7 +29,7 @@ describe('metaRPCClientFactory', () => { }); }); }); - it('should be able to make an rpc request/error with the method and params and node-style callback', () => { + it('should be able to make an rpc request/error with the method and params and node-style callback', (done) => { const streamTest = createThoughStream(); const metaRPCClient = metaRPCClientFactory(streamTest); @@ -35,6 +37,7 @@ describe('metaRPCClientFactory', () => { metaRPCClient.foo('bar', (err) => { expect(err.message).toStrictEqual('foo-message'); expect(err.code).toStrictEqual(1); + done(); }); metaRPCClient.requests.forEach((_, key) => { @@ -49,7 +52,7 @@ describe('metaRPCClientFactory', () => { }); }); - it('should be able to make an rpc request/response with the method and params and node-style callback with multiple instances of metaRPCClientFactory and the same connectionStream', () => { + it('should be able to make an rpc request/response with the method and params and node-style callback with multiple instances of metaRPCClientFactory and the same connectionStream', (done) => { const streamTest = createThoughStream(); const metaRPCClient = metaRPCClientFactory(streamTest); const metaRPCClient2 = metaRPCClientFactory(streamTest); @@ -59,6 +62,7 @@ describe('metaRPCClientFactory', () => { expect(result).toStrictEqual('foobarbaz'); metaRPCClient2.baz('bar', (err) => { expect(err).toBeNull(); + done(); }); }); @@ -81,12 +85,13 @@ describe('metaRPCClientFactory', () => { }); }); - it('should be able to handle notifications', () => { + it('should be able to handle notifications', (done) => { const streamTest = createThoughStream(); const metaRPCClient = metaRPCClientFactory(streamTest); metaRPCClient.onNotification((notification) => { expect(notification.method).toStrictEqual('foobarbaz'); + done(); }); // send a notification @@ -97,12 +102,13 @@ describe('metaRPCClientFactory', () => { }); }); - it('should be able to handle errors with no id', () => { + it('should be able to handle errors with no id', (done) => { const streamTest = createThoughStream(); const metaRPCClient = metaRPCClientFactory(streamTest); metaRPCClient.onUncaughtError((error) => { expect(error.code).toStrictEqual(1); + done(); }); streamTest.write({ @@ -114,12 +120,13 @@ describe('metaRPCClientFactory', () => { }); }); - it('should be able to handle errors with null id', () => { + it('should be able to handle errors with null id', (done) => { const streamTest = createThoughStream(); const metaRPCClient = metaRPCClientFactory(streamTest); metaRPCClient.onUncaughtError((error) => { expect(error.code).toStrictEqual(1); + done(); }); streamTest.write({ @@ -132,7 +139,7 @@ describe('metaRPCClientFactory', () => { }); }); - it('should be able to handle no message within TIMEOUT secs', async () => { + it('should be able to handle no message within TIMEOUT secs for getState', async () => { jest.useFakeTimers(); const streamTest = createThoughStream(); const metaRPCClient = metaRPCClientFactory(streamTest); @@ -148,4 +155,17 @@ describe('metaRPCClientFactory', () => { jest.useRealTimers(); }); + + it('should fail all pending actions with a DisconnectError when the stream ends', (done) => { + const streamTest = createThoughStream(); + const metaRPCClient = metaRPCClientFactory(streamTest); + + metaRPCClient.foo('bar', (err) => { + expect(err).toBeInstanceOf(metaRPCClient.DisconnectError); + expect(err.message).toStrictEqual('disconnected'); + done(); + }); + + streamTest.emit('end'); + }); }); diff --git a/app/scripts/lib/network-store.js b/app/scripts/lib/network-store.js index 75f7796a0..abee778c1 100644 --- a/app/scripts/lib/network-store.js +++ b/app/scripts/lib/network-store.js @@ -1,8 +1,7 @@ import log from 'loglevel'; -import { SECOND } from '../../../shared/constants/time'; import getFetchWithTimeout from '../../../shared/modules/fetch-with-timeout'; -const fetchWithTimeout = getFetchWithTimeout(SECOND * 30); +const fetchWithTimeout = getFetchWithTimeout(); const FIXTURE_SERVER_HOST = 'localhost'; const FIXTURE_SERVER_PORT = 12345; diff --git a/app/scripts/lib/personal-message-manager.js b/app/scripts/lib/personal-message-manager.js index 00017bc37..ffc45575b 100644 --- a/app/scripts/lib/personal-message-manager.js +++ b/app/scripts/lib/personal-message-manager.js @@ -7,6 +7,7 @@ import { MESSAGE_TYPE } from '../../../shared/constants/app'; import { METAMASK_CONTROLLER_EVENTS } from '../metamask-controller'; import createId from '../../../shared/modules/random-id'; import { EVENT } from '../../../shared/constants/metametrics'; +import { detectSIWE } from '../../../shared/modules/siwe'; import { addHexPrefix } from './util'; const hexRe = /^[0-9A-Fa-f]+$/gu; @@ -135,6 +136,11 @@ export default class PersonalMessageManager extends EventEmitter { msgParams.origin = req.origin; } msgParams.data = this.normalizeMsgData(msgParams.data); + + // check for SIWE message + const siwe = detectSIWE(msgParams); + msgParams.siwe = siwe; + // create txData obj with parameters and meta data const time = new Date().getTime(); const msgId = createId(); @@ -314,8 +320,9 @@ export default class PersonalMessageManager extends EventEmitter { */ _saveMsgList() { const unapprovedPersonalMsgs = this.getUnapprovedMsgs(); - const unapprovedPersonalMsgCount = Object.keys(unapprovedPersonalMsgs) - .length; + const unapprovedPersonalMsgCount = Object.keys( + unapprovedPersonalMsgs, + ).length; this.memStore.updateState({ unapprovedPersonalMsgs, unapprovedPersonalMsgCount, diff --git a/app/scripts/lib/rpc-method-middleware/createMethodMiddleware.js b/app/scripts/lib/rpc-method-middleware/createMethodMiddleware.js index 642fdb1ce..dfae4b8d9 100644 --- a/app/scripts/lib/rpc-method-middleware/createMethodMiddleware.js +++ b/app/scripts/lib/rpc-method-middleware/createMethodMiddleware.js @@ -2,7 +2,7 @@ import { handlers as permittedSnapMethods } from '@metamask/rpc-methods/dist/permitted'; ///: END:ONLY_INCLUDE_IN import { permissionRpcMethods } from '@metamask/controllers'; -import { selectHooks } from '@metamask/rpc-methods'; +import { selectHooks } from '@metamask/rpc-methods/dist/utils'; import { ethErrors } from 'eth-rpc-errors'; import { flatten } from 'lodash'; import { UNSUPPORTED_RPC_METHODS } from '../../../../shared/constants/network'; @@ -31,7 +31,7 @@ const expectedHookNames = Array.from( * * @param {Record} hooks - Required "hooks" into our * controllers. - * @returns {(req: Object, res: Object, next: Function, end: Function) => void} + * @returns {(req: object, res: object, next: Function, end: Function) => void} */ export function createMethodMiddleware(hooks) { // Fail immediately if we forgot to provide any expected hooks. diff --git a/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js b/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js index 223743a92..d31302966 100644 --- a/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js +++ b/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js @@ -289,25 +289,34 @@ async function addEthereumChainHandler( }), ); + let rpcUrlOrigin; + try { + rpcUrlOrigin = new URL(firstValidRPCUrl).origin; + } catch { + // ignore + } + sendMetrics({ event: 'Custom Network Added', category: EVENT.CATEGORIES.NETWORK, referrer: { url: origin, }, - sensitiveProperties: { + properties: { chain_id: _chainId, - rpc_url: firstValidRPCUrl, network_name: _chainName, // Including network to override the default network // property included in all events. For RPC type networks // the MetaMetrics controller uses the rpcUrl for the network // property. - network: firstValidRPCUrl, + network: rpcUrlOrigin, symbol: ticker, block_explorer_url: firstValidBlockExplorerUrl, source: EVENT.SOURCE.TRANSACTION.DAPP, }, + sensitiveProperties: { + rpc_url: rpcUrlOrigin, + }, }); // Once the network has been added, the requested is considered successful diff --git a/app/scripts/lib/typed-message-manager.js b/app/scripts/lib/typed-message-manager.js index 8d5562c47..60356ba8a 100644 --- a/app/scripts/lib/typed-message-manager.js +++ b/app/scripts/lib/typed-message-manager.js @@ -391,8 +391,9 @@ export default class TypedMessageManager extends EventEmitter { */ _saveMsgList() { const unapprovedTypedMessages = this.getUnapprovedMsgs(); - const unapprovedTypedMessagesCount = Object.keys(unapprovedTypedMessages) - .length; + const unapprovedTypedMessagesCount = Object.keys( + unapprovedTypedMessages, + ).length; this.memStore.updateState({ unapprovedTypedMessages, unapprovedTypedMessagesCount, diff --git a/app/scripts/metamask-controller.actions.test.js b/app/scripts/metamask-controller.actions.test.js new file mode 100644 index 000000000..62902e5cb --- /dev/null +++ b/app/scripts/metamask-controller.actions.test.js @@ -0,0 +1,212 @@ +import { strict as assert } from 'assert'; +import sinon from 'sinon'; +import proxyquire from 'proxyquire'; + +const Ganache = require('../../test/e2e/ganache'); + +const ganacheServer = new Ganache(); + +const browserPolyfillMock = { + runtime: { + id: 'fake-extension-id', + onInstalled: { + addListener: () => undefined, + }, + onMessageExternal: { + addListener: () => undefined, + }, + getPlatformInfo: async () => 'mac', + }, +}; + +let loggerMiddlewareMock; +const createLoggerMiddlewareMock = () => (req, res, next) => { + if (loggerMiddlewareMock) { + loggerMiddlewareMock.requests.push(req); + next((cb) => { + loggerMiddlewareMock.responses.push(res); + cb(); + }); + return; + } + next(); +}; + +const TEST_SEED = + 'debris dizzy just program just float decrease vacant alarm reduce speak stadium'; + +const MetaMaskController = proxyquire('./metamask-controller', { + './lib/createLoggerMiddleware': { default: createLoggerMiddlewareMock }, +}).default; + +describe('MetaMaskController', function () { + let metamaskController; + const sandbox = sinon.createSandbox(); + const noop = () => undefined; + + before(async function () { + await ganacheServer.start(); + }); + + beforeEach(function () { + metamaskController = new MetaMaskController({ + showUserConfirmation: noop, + encryptor: { + encrypt(_, object) { + this.object = object; + return Promise.resolve('mock-encrypted'); + }, + decrypt() { + return Promise.resolve(this.object); + }, + }, + initLangCode: 'en_US', + platform: { + showTransactionNotification: () => undefined, + getVersion: () => 'foo', + }, + browser: browserPolyfillMock, + infuraProjectId: 'foo', + }); + }); + + afterEach(function () { + sandbox.restore(); + }); + + after(async function () { + await ganacheServer.quit(); + }); + + describe('#addNewAccount', function () { + it('two parallel calls with same accountCount give same result', async function () { + await metamaskController.createNewVaultAndKeychain('test@123'); + const [addNewAccountResult1, addNewAccountResult2] = await Promise.all([ + metamaskController.addNewAccount(1), + metamaskController.addNewAccount(1), + ]); + assert.deepEqual( + Object.keys(addNewAccountResult1.identities), + Object.keys(addNewAccountResult2.identities), + ); + }); + + it('two successive calls with same accountCount give same result', async function () { + await metamaskController.createNewVaultAndKeychain('test@123'); + const addNewAccountResult1 = await metamaskController.addNewAccount(1); + const addNewAccountResult2 = await metamaskController.addNewAccount(1); + assert.deepEqual( + Object.keys(addNewAccountResult1.identities), + Object.keys(addNewAccountResult2.identities), + ); + }); + + it('two successive calls with different accountCount give different results', async function () { + await metamaskController.createNewVaultAndKeychain('test@123'); + const addNewAccountResult1 = await metamaskController.addNewAccount(1); + const addNewAccountResult2 = await metamaskController.addNewAccount(2); + assert.notDeepEqual(addNewAccountResult1, addNewAccountResult2); + }); + }); + + describe('#importAccountWithStrategy', function () { + it('two sequential calls with same strategy give same result', async function () { + let keyringControllerState1; + let keyringControllerState2; + const importPrivkey = + '4cfd3e90fc78b0f86bf7524722150bb8da9c60cd532564d7ff43f5716514f553'; + + await metamaskController.createNewVaultAndKeychain('test@123'); + await Promise.all([ + metamaskController.importAccountWithStrategy('Private Key', [ + importPrivkey, + ]), + Promise.resolve(1).then(() => { + keyringControllerState1 = JSON.stringify( + metamaskController.keyringController.memStore.getState(), + ); + metamaskController.importAccountWithStrategy('Private Key', [ + importPrivkey, + ]); + }), + Promise.resolve(2).then(() => { + keyringControllerState2 = JSON.stringify( + metamaskController.keyringController.memStore.getState(), + ); + }), + ]); + assert.deepEqual(keyringControllerState1, keyringControllerState2); + }); + }); + + describe('#createNewVaultAndRestore', function () { + it('two successive calls with same inputs give same result', async function () { + const result1 = await metamaskController.createNewVaultAndRestore( + 'test@123', + TEST_SEED, + ); + const result2 = await metamaskController.createNewVaultAndRestore( + 'test@123', + TEST_SEED, + ); + assert.deepEqual(result1, result2); + }); + }); + + describe('#createNewVaultAndKeychain', function () { + it('two successive calls with same inputs give same result', async function () { + const result1 = await metamaskController.createNewVaultAndKeychain( + 'test@123', + ); + const result2 = await metamaskController.createNewVaultAndKeychain( + 'test@123', + ); + assert.notEqual(result1, undefined); + assert.deepEqual(result1, result2); + }); + }); + + describe('#addToken', function () { + const address = '0x514910771af9ca656af840dff83e8264ecf986ca'; + const symbol = 'LINK'; + const decimals = 18; + + it('two parallel calls with same token details give same result', async function () { + const supportsInterfaceStub = sinon + .stub() + .returns(Promise.resolve(false)); + sinon + .stub(metamaskController.tokensController, '_createEthersContract') + .callsFake(() => + Promise.resolve({ supportsInterface: supportsInterfaceStub }), + ); + + const [token1, token2] = await Promise.all([ + metamaskController.getApi().addToken(address, symbol, decimals), + metamaskController.getApi().addToken(address, symbol, decimals), + ]); + assert.deepEqual(token1, token2); + }); + }); + + describe('#addCustomNetwork', function () { + const customRpc = { + chainId: '0x1', + chainName: 'DUMMY_CHAIN_NAME', + rpcUrl: 'DUMMY_RPCURL', + ticker: 'DUMMY_TICKER', + blockExplorerUrl: 'DUMMY_EXPLORER', + }; + it('two successive calls with custom RPC details give same result', async function () { + await metamaskController.addCustomNetwork(customRpc); + const rpcList1Length = + metamaskController.preferencesController.store.getState() + .frequentRpcListDetail.length; + await metamaskController.addCustomNetwork(customRpc); + const rpcList2Length = + metamaskController.preferencesController.store.getState() + .frequentRpcListDetail.length; + assert.equal(rpcList1Length, rpcList2Length); + }); + }); +}); diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index d7159d2f2..1a915ac78 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -51,12 +51,15 @@ import { SnapController, IframeExecutionService, } from '@metamask/snap-controllers'; +import { satisfies as satisfiesSemver } from 'semver'; ///: END:ONLY_INCLUDE_IN import { + ASSET_TYPES, TRANSACTION_STATUSES, TRANSACTION_TYPES, } from '../../shared/constants/transaction'; +import { PHISHING_NEW_ISSUE_URLS } from '../../shared/constants/phishing'; import { GAS_API_BASE_URL, GAS_DEV_API_BASE_URL, @@ -85,7 +88,7 @@ import { POLLING_TOKEN_ENVIRONMENT_TYPES, SUBJECT_TYPES, } from '../../shared/constants/app'; -import { EVENT } from '../../shared/constants/metametrics'; +import { EVENT, EVENT_NAMES } from '../../shared/constants/metametrics'; import { hexToDecimal } from '../../ui/helpers/utils/conversions.util'; import { @@ -94,6 +97,7 @@ import { } from '../../ui/helpers/utils/token-util'; import { isEqualCaseInsensitive } from '../../shared/modules/string-utils'; import { parseStandardTokenTransactionData } from '../../shared/modules/transaction.utils'; +import { STATIC_MAINNET_TOKEN_LIST } from '../../shared/constants/tokens'; import { onMessageReceived, checkForMultipleVersionsRunning, @@ -119,6 +123,7 @@ import CachedBalancesController from './controllers/cached-balances'; import AlertController from './controllers/alert'; import OnboardingController from './controllers/onboarding'; import ThreeBoxController from './controllers/threebox'; +import BackupController from './controllers/backup'; import IncomingTransactionsController from './controllers/incoming-transactions'; import MessageManager, { normalizeMsgData } from './lib/message-manager'; import DecryptMessageManager from './lib/decrypt-message-manager'; @@ -226,14 +231,40 @@ export default class MetamaskController extends EventEmitter { // now we can initialize the RPC provider, which other controllers require this.initializeProvider(); - this.provider = this.networkController.getProviderAndBlockTracker().provider; - this.blockTracker = this.networkController.getProviderAndBlockTracker().blockTracker; + this.provider = + this.networkController.getProviderAndBlockTracker().provider; + this.blockTracker = + this.networkController.getProviderAndBlockTracker().blockTracker; + + const tokenListMessenger = this.controllerMessenger.getRestricted({ + name: 'TokenListController', + }); + + this.tokenListController = new TokenListController({ + chainId: hexToDecimal(this.networkController.getCurrentChainId()), + preventPollingOnNetworkRestart: true, + onNetworkStateChange: (cb) => { + this.networkController.store.subscribe((networkState) => { + const modifiedNetworkState = { + ...networkState, + provider: { + ...networkState.provider, + chainId: hexToDecimal(networkState.provider.chainId), + }, + }; + return cb(modifiedNetworkState); + }); + }, + messenger: tokenListMessenger, + state: initState.TokenListController, + }); this.preferencesController = new PreferencesController({ initState: initState.PreferencesController, initLangCode: opts.initLangCode, openPopup: opts.openPopup, network: this.networkController, + tokenListController: this.tokenListController, provider: this.provider, migrateAddressBookState: this.migrateAddressBookState.bind(this), }); @@ -248,62 +279,75 @@ export default class MetamaskController extends EventEmitter { config: { provider: this.provider }, state: initState.TokensController, }); - process.env.TOKEN_DETECTION_V2 - ? (this.assetsContractController = new AssetsContractController({ - onPreferencesStateChange: (listener) => - this.preferencesController.store.subscribe(listener), - onNetworkStateChange: (cb) => - this.networkController.store.subscribe((networkState) => { - const modifiedNetworkState = { - ...networkState, - provider: { - ...networkState.provider, - chainId: hexToDecimal(networkState.provider.chainId), - }, - }; - return cb(modifiedNetworkState); - }), - config: { - provider: this.provider, - }, - state: initState.AssetsContractController, - })) - : (this.assetsContractController = new AssetsContractController( - { - onPreferencesStateChange: (listener) => - this.preferencesController.store.subscribe(listener), - }, - { - provider: this.provider, - }, - )); + + this.assetsContractController = new AssetsContractController( + { + onPreferencesStateChange: (listener) => + this.preferencesController.store.subscribe(listener), + onNetworkStateChange: (cb) => + this.networkController.store.subscribe((networkState) => { + const modifiedNetworkState = { + ...networkState, + provider: { + ...networkState.provider, + chainId: hexToDecimal(networkState.provider.chainId), + }, + }; + return cb(modifiedNetworkState); + }), + }, + { + provider: this.provider, + }, + initState.AssetsContractController, + ); this.collectiblesController = new CollectiblesController( { - onPreferencesStateChange: this.preferencesController.store.subscribe.bind( - this.preferencesController.store, - ), + onPreferencesStateChange: + this.preferencesController.store.subscribe.bind( + this.preferencesController.store, + ), onNetworkStateChange: this.networkController.store.subscribe.bind( this.networkController.store, ), - getERC721AssetName: this.assetsContractController.getERC721AssetName.bind( - this.assetsContractController, - ), - getERC721AssetSymbol: this.assetsContractController.getERC721AssetSymbol.bind( - this.assetsContractController, - ), + getERC721AssetName: + this.assetsContractController.getERC721AssetName.bind( + this.assetsContractController, + ), + getERC721AssetSymbol: + this.assetsContractController.getERC721AssetSymbol.bind( + this.assetsContractController, + ), getERC721TokenURI: this.assetsContractController.getERC721TokenURI.bind( this.assetsContractController, ), getERC721OwnerOf: this.assetsContractController.getERC721OwnerOf.bind( this.assetsContractController, ), - getERC1155BalanceOf: this.assetsContractController.getERC1155BalanceOf.bind( - this.assetsContractController, - ), - getERC1155TokenURI: this.assetsContractController.getERC1155TokenURI.bind( - this.assetsContractController, - ), + getERC1155BalanceOf: + this.assetsContractController.getERC1155BalanceOf.bind( + this.assetsContractController, + ), + getERC1155TokenURI: + this.assetsContractController.getERC1155TokenURI.bind( + this.assetsContractController, + ), + onCollectibleAdded: ({ address, symbol, tokenId, standard, source }) => + this.metaMetricsController.trackEvent({ + event: EVENT_NAMES.NFT_ADDED, + category: EVENT.CATEGORIES.WALLET, + properties: { + token_contract_address: address, + token_symbol: symbol, + asset_type: ASSET_TYPES.COLLECTIBLE, + token_standard: standard, + source, + }, + sensitiveProperties: { + tokenId, + }, + }), }, {}, initState.CollectiblesController, @@ -316,16 +360,18 @@ export default class MetamaskController extends EventEmitter { { onCollectiblesStateChange: (listener) => this.collectiblesController.subscribe(listener), - onPreferencesStateChange: this.preferencesController.store.subscribe.bind( - this.preferencesController.store, - ), + onPreferencesStateChange: + this.preferencesController.store.subscribe.bind( + this.preferencesController.store, + ), onNetworkStateChange: this.networkController.store.subscribe.bind( this.networkController.store, ), getOpenSeaApiKey: () => this.collectiblesController.openSeaApiKey, - getBalancesInSingleCall: this.assetsContractController.getBalancesInSingleCall.bind( - this.assetsContractController, - ), + getBalancesInSingleCall: + this.assetsContractController.getBalancesInSingleCall.bind( + this.assetsContractController, + ), addCollectible: this.collectiblesController.addCollectible.bind( this.collectiblesController, ), @@ -348,6 +394,7 @@ export default class MetamaskController extends EventEmitter { ), version: this.platform.getVersion(), environment: process.env.METAMASK_ENVIRONMENT, + extension: this.extension, initState: initState.MetaMetricsController, captureException, }); @@ -374,12 +421,12 @@ export default class MetamaskController extends EventEmitter { this.networkController, NETWORK_EVENTS.NETWORK_DID_CHANGE, ), - getCurrentNetworkEIP1559Compatibility: this.networkController.getEIP1559Compatibility.bind( - this.networkController, - ), - getCurrentAccountEIP1559Compatibility: this.getCurrentAccountEIP1559Compatibility.bind( - this, - ), + getCurrentNetworkEIP1559Compatibility: + this.networkController.getEIP1559Compatibility.bind( + this.networkController, + ), + getCurrentAccountEIP1559Compatibility: + this.getCurrentAccountEIP1559Compatibility.bind(this), legacyAPIEndpoint: `${gasApiBaseUrl}/networks//gasPrices`, EIP1559APIEndpoint: `${gasApiBaseUrl}/networks//suggestedGasFees`, getCurrentNetworkLegacyGasAPICompatibility: () => { @@ -417,54 +464,6 @@ export default class MetamaskController extends EventEmitter { }, }); - const tokenListMessenger = this.controllerMessenger.getRestricted({ - name: 'TokenListController', - }); - process.env.TOKEN_DETECTION_V2 - ? (this.tokenListController = new TokenListController({ - chainId: hexToDecimal(this.networkController.getCurrentChainId()), - onNetworkStateChange: (cb) => - this.networkController.store.subscribe((networkState) => { - const modifiedNetworkState = { - ...networkState, - provider: { - ...networkState.provider, - chainId: hexToDecimal(networkState.provider.chainId), - }, - }; - return cb(modifiedNetworkState); - }), - messenger: tokenListMessenger, - state: initState.TokenListController, - })) - : (this.tokenListController = new TokenListController({ - chainId: hexToDecimal(this.networkController.getCurrentChainId()), - useStaticTokenList: !this.preferencesController.store.getState() - .useTokenDetection, - onNetworkStateChange: (cb) => - this.networkController.store.subscribe((networkState) => { - const modifiedNetworkState = { - ...networkState, - provider: { - ...networkState.provider, - chainId: hexToDecimal(networkState.provider.chainId), - }, - }; - return cb(modifiedNetworkState); - }), - onPreferencesStateChange: (cb) => - this.preferencesController.store.subscribe((preferencesState) => { - const modifiedPreferencesState = { - ...preferencesState, - useStaticTokenList: !this.preferencesController.store.getState() - .useTokenDetection, - }; - return cb(modifiedPreferencesState); - }), - messenger: tokenListMessenger, - state: initState.TokenListController, - })); - this.phishingController = new PhishingController(); this.announcementController = new AnnouncementController( @@ -533,12 +532,16 @@ export default class MetamaskController extends EventEmitter { this.accountTracker.start(); this.incomingTransactionsController.start(); this.currencyRateController.start(); - this.tokenListController.start(); + if (this.preferencesController.store.getState().useTokenDetection) { + this.tokenListController.start(); + } } else { this.accountTracker.stop(); this.incomingTransactionsController.stop(); this.currencyRateController.stop(); - this.tokenListController.stop(); + if (this.preferencesController.store.getState().useTokenDetection) { + this.tokenListController.stop(); + } } }); @@ -603,10 +606,11 @@ export default class MetamaskController extends EventEmitter { const accountsMissingIdentities = accounts.filter( (address) => !identities[address], ); - const keyringTypesWithMissingIdentities = accountsMissingIdentities.map( - (address) => - this.keyringController.getKeyringForAccount(address)?.type, - ); + const keyringTypesWithMissingIdentities = + accountsMissingIdentities.map( + (address) => + this.keyringController.getKeyringForAccount(address)?.type, + ); const identitiesCount = Object.keys(identities || {}).length; @@ -645,7 +649,7 @@ export default class MetamaskController extends EventEmitter { ///: BEGIN:ONLY_INCLUDE_IN(flask) this.snapExecutionService = new IframeExecutionService({ iframeUrl: new URL( - 'https://metamask.github.io/iframe-execution-environment/0.5.0', + 'https://metamask.github.io/iframe-execution-environment/0.6.0', ), messenger: this.controllerMessenger.getRestricted({ name: 'ExecutionService', @@ -657,7 +661,8 @@ export default class MetamaskController extends EventEmitter { name: 'SnapController', allowedEvents: [ 'ExecutionService:unhandledError', - 'ExecutionService:unresponsive', + 'ExecutionService:outboundRequest', + 'ExecutionService:outboundResponse', ], allowedActions: [ `${this.permissionController.name}:getEndowments`, @@ -666,32 +671,59 @@ export default class MetamaskController extends EventEmitter { `${this.permissionController.name}:hasPermissions`, `${this.permissionController.name}:requestPermissions`, `${this.permissionController.name}:revokeAllPermissions`, + `${this.permissionController.name}:revokePermissions`, `${this.permissionController.name}:revokePermissionForAllSubjects`, + `${this.approvalController.name}:addRequest`, + `${this.permissionController.name}:grantPermissions`, + 'ExecutionService:executeSnap', + 'ExecutionService:getRpcRequestHandler', + 'ExecutionService:terminateSnap', + 'ExecutionService:terminateAllSnaps', + 'ExecutionService:handleRpcRequest', ], }); + const SNAP_BLOCKLIST = [ + { + id: 'npm:@consensys/starknet-snap', + versionRange: '<0.1.11', + }, + ]; + this.snapController = new SnapController({ environmentEndowmentPermissions: Object.values(EndowmentPermissions), - terminateAllSnaps: this.snapExecutionService.terminateAllSnaps.bind( - this.snapExecutionService, - ), - terminateSnap: this.snapExecutionService.terminateSnap.bind( - this.snapExecutionService, - ), - executeSnap: this.snapExecutionService.executeSnap.bind( - this.snapExecutionService, - ), - getRpcMessageHandler: this.snapExecutionService.getRpcMessageHandler.bind( - this.snapExecutionService, - ), closeAllConnections: this.removeAllConnections.bind(this), // Prefix subject with appKeyType to generate separate keys for separate uses getAppKey: async (subject, appKeyType) => { await this.appStateController.getUnlockPromise(true); return this.getAppKeyForSubject(`${appKeyType}:${subject}`); }, + checkBlockList: async (snapsToCheck) => { + return Object.entries(snapsToCheck).reduce( + (acc, [snapId, snapVersion]) => { + const blockInfo = SNAP_BLOCKLIST.find( + (blocked) => + blocked.id === snapId && + satisfiesSemver(snapVersion, blocked.versionRange, { + includePrerelease: true, + }), + ); + + const cur = blockInfo + ? { + blocked: true, + reason: blockInfo.reason, + infoUrl: blockInfo.infoUrl, + } + : { blocked: false }; + return { ...acc, [snapId]: cur }; + }, + {}, + ); + }, state: initState.SnapController, messenger: snapControllerMessenger, + featureFlags: { dappsCanUpdateSnaps: true }, }); this.notificationController = new NotificationController({ @@ -731,26 +763,17 @@ export default class MetamaskController extends EventEmitter { }, }); ///: END:ONLY_INCLUDE_IN - - process.env.TOKEN_DETECTION_V2 - ? (this.detectTokensController = new DetectTokensController({ - preferences: this.preferencesController, - tokensController: this.tokensController, - assetsContractController: this.assetsContractController, - network: this.networkController, - keyringMemStore: this.keyringController.memStore, - tokenList: this.tokenListController, - trackMetaMetricsEvent: this.metaMetricsController.trackEvent.bind( - this.metaMetricsController, - ), - })) - : (this.detectTokensController = new DetectTokensController({ - preferences: this.preferencesController, - tokensController: this.tokensController, - network: this.networkController, - keyringMemStore: this.keyringController.memStore, - tokenList: this.tokenListController, - })); + this.detectTokensController = new DetectTokensController({ + preferences: this.preferencesController, + tokensController: this.tokensController, + assetsContractController: this.assetsContractController, + network: this.networkController, + keyringMemStore: this.keyringController.memStore, + tokenList: this.tokenListController, + trackMetaMetricsEvent: this.metaMetricsController.trackEvent.bind( + this.metaMetricsController, + ), + }); this.addressBookController = new AddressBookController( undefined, @@ -776,6 +799,14 @@ export default class MetamaskController extends EventEmitter { ), }); + this.backupController = new BackupController({ + preferencesController: this.preferencesController, + addressBookController: this.addressBookController, + trackMetaMetricsEvent: this.metaMetricsController.trackEvent.bind( + this.metaMetricsController, + ), + }); + this.txController = new TransactionController({ initState: initState.TransactionController || initState.TransactionManager, @@ -783,12 +814,12 @@ export default class MetamaskController extends EventEmitter { getProviderConfig: this.networkController.getProviderConfig.bind( this.networkController, ), - getCurrentNetworkEIP1559Compatibility: this.networkController.getEIP1559Compatibility.bind( - this.networkController, - ), - getCurrentAccountEIP1559Compatibility: this.getCurrentAccountEIP1559Compatibility.bind( - this, - ), + getCurrentNetworkEIP1559Compatibility: + this.networkController.getEIP1559Compatibility.bind( + this.networkController, + ), + getCurrentAccountEIP1559Compatibility: + this.getCurrentAccountEIP1559Compatibility.bind(this), networkStore: this.networkController.networkStore, getCurrentChainId: this.networkController.getCurrentChainId.bind( this.networkController, @@ -806,28 +837,29 @@ export default class MetamaskController extends EventEmitter { updateEventFragment: this.metaMetricsController.updateEventFragment.bind( this.metaMetricsController, ), - finalizeEventFragment: this.metaMetricsController.finalizeEventFragment.bind( - this.metaMetricsController, - ), - getEventFragmentById: this.metaMetricsController.getEventFragmentById.bind( - this.metaMetricsController, - ), + finalizeEventFragment: + this.metaMetricsController.finalizeEventFragment.bind( + this.metaMetricsController, + ), + getEventFragmentById: + this.metaMetricsController.getEventFragmentById.bind( + this.metaMetricsController, + ), trackMetaMetricsEvent: this.metaMetricsController.trackEvent.bind( this.metaMetricsController, ), getParticipateInMetrics: () => this.metaMetricsController.state.participateInMetaMetrics, - getEIP1559GasFeeEstimates: this.gasFeeController.fetchGasFeeEstimates.bind( - this.gasFeeController, - ), - getExternalPendingTransactions: this.getExternalPendingTransactions.bind( - this, - ), + getEIP1559GasFeeEstimates: + this.gasFeeController.fetchGasFeeEstimates.bind(this.gasFeeController), + getExternalPendingTransactions: + this.getExternalPendingTransactions.bind(this), getAccountType: this.getAccountType.bind(this), getDeviceModel: this.getDeviceModel.bind(this), - getTokenStandardAndDetails: this.assetsContractController.getTokenStandardAndDetails.bind( - this.assetsContractController, - ), + getTokenStandardAndDetails: + this.assetsContractController.getTokenStandardAndDetails.bind( + this.assetsContractController, + ), }); this.txController.on('newUnapprovedTx', () => opts.showUserConfirmation()); @@ -837,7 +869,8 @@ export default class MetamaskController extends EventEmitter { status === TRANSACTION_STATUSES.FAILED ) { const txMeta = this.txController.txStateManager.getTransaction(txId); - const frequentRpcListDetail = this.preferencesController.getFrequentRpcListDetail(); + const frequentRpcListDetail = + this.preferencesController.getFrequentRpcListDetail(); let rpcPrefs = {}; if (txMeta.chainId) { const rpcSettings = frequentRpcListDetail.find( @@ -964,9 +997,8 @@ export default class MetamaskController extends EventEmitter { getCurrentChainId: this.networkController.getCurrentChainId.bind( this.networkController, ), - getEIP1559GasFeeEstimates: this.gasFeeController.fetchGasFeeEstimates.bind( - this.gasFeeController, - ), + getEIP1559GasFeeEstimates: + this.gasFeeController.fetchGasFeeEstimates.bind(this.gasFeeController), }); this.smartTransactionsController = new SmartTransactionsController( { @@ -979,9 +1011,8 @@ export default class MetamaskController extends EventEmitter { getNonceLock: this.txController.nonceTracker.getNonceLock.bind( this.txController.nonceTracker, ), - confirmExternalTransaction: this.txController.confirmExternalTransaction.bind( - this.txController, - ), + confirmExternalTransaction: + this.txController.confirmExternalTransaction.bind(this.txController), provider: this.provider, trackMetaMetricsEvent: this.metaMetricsController.trackEvent.bind( this.metaMetricsController, @@ -1026,6 +1057,7 @@ export default class MetamaskController extends EventEmitter { PermissionLogController: this.permissionLogController.store, SubjectMetadataController: this.subjectMetadataController, ThreeBoxController: this.threeBoxController.store, + BackupController: this.backupController, AnnouncementController: this.announcementController, GasFeeController: this.gasFeeController, TokenListController: this.tokenListController, @@ -1058,12 +1090,13 @@ export default class MetamaskController extends EventEmitter { CurrencyController: this.currencyRateController, AlertController: this.alertController.store, OnboardingController: this.onboardingController.store, - IncomingTransactionsController: this.incomingTransactionsController - .store, + IncomingTransactionsController: + this.incomingTransactionsController.store, PermissionController: this.permissionController, PermissionLogController: this.permissionLogController.store, SubjectMetadataController: this.subjectMetadataController, ThreeBoxController: this.threeBoxController.store, + BackupController: this.backupController, SwapsController: this.swapsController.store, EnsController: this.ensController.store, ApprovalController: this.approvalController, @@ -1104,6 +1137,8 @@ export default class MetamaskController extends EventEmitter { this.setupControllerEventSubscriptions(); + // For more information about these legacy streams, see here: + // https://github.com/MetaMask/metamask-extension/issues/15491 // TODO:LegacyProvider: Delete this.publicConfigStore = this.createPublicConfigStore(); @@ -1137,9 +1172,9 @@ export default class MetamaskController extends EventEmitter { this.controllerMessenger, 'SnapController:get', ), - getSnapRpcHandler: this.controllerMessenger.call.bind( + handleSnapRpcRequest: this.controllerMessenger.call.bind( this.controllerMessenger, - 'SnapController:getRpcMessageHandler', + 'SnapController:handleRpcRequest', ), getSnapState: this.controllerMessenger.call.bind( this.controllerMessenger, @@ -1263,7 +1298,7 @@ export default class MetamaskController extends EventEmitter { // Record Snap metadata whenever a Snap is added to state. this.controllerMessenger.subscribe( `${this.snapController.name}:snapAdded`, - (snapId, snap, svgIcon = null) => { + (snap, svgIcon = null) => { const { manifest: { proposedName }, version, @@ -1271,7 +1306,7 @@ export default class MetamaskController extends EventEmitter { this.subjectMetadataController.addSubjectMetadata({ subjectType: SUBJECT_TYPES.SNAP, name: proposedName, - origin: snapId, + origin: snap.id, version, svgIcon, }); @@ -1280,12 +1315,28 @@ export default class MetamaskController extends EventEmitter { this.controllerMessenger.subscribe( `${this.snapController.name}:snapInstalled`, - (snapId) => { + (truncatedSnap) => { this.metaMetricsController.trackEvent({ event: 'Snap Installed', category: EVENT.CATEGORIES.SNAPS, properties: { - snap_id: snapId, + snap_id: truncatedSnap.id, + version: truncatedSnap.version, + }, + }); + }, + ); + + this.controllerMessenger.subscribe( + `${this.snapController.name}:snapUpdated`, + (newSnap, oldVersion) => { + this.metaMetricsController.trackEvent({ + event: 'Snap Updated', + category: EVENT.CATEGORIES.SNAPS, + properties: { + snap_id: newSnap.id, + old_version: oldVersion, + new_version: newSnap.version, }, }); }, @@ -1293,12 +1344,12 @@ export default class MetamaskController extends EventEmitter { this.controllerMessenger.subscribe( `${this.snapController.name}:snapTerminated`, - (snapId) => { + (truncatedSnap) => { const approvals = Object.values( this.approvalController.state.pendingApprovals, ).filter( (approval) => - approval.origin === snapId && + approval.origin === truncatedSnap.id && approval.type === MESSAGE_TYPE.SNAP_CONFIRM, ); for (const approval of approvals) { @@ -1330,7 +1381,8 @@ export default class MetamaskController extends EventEmitter { { suppressUnauthorizedError = true } = {}, ) => { if (origin === ORIGIN_METAMASK) { - const selectedAddress = this.preferencesController.getSelectedAddress(); + const selectedAddress = + this.preferencesController.getSelectedAddress(); return selectedAddress ? [selectedAddress] : []; } else if (this.isUnlocked()) { return await this.getPermittedAccounts(origin, { @@ -1358,9 +1410,8 @@ export default class MetamaskController extends EventEmitter { }, })[0], }; - const providerProxy = this.networkController.initializeProvider( - providerOpts, - ); + const providerProxy = + this.networkController.initializeProvider(providerOpts); return providerProxy; } @@ -1482,6 +1533,7 @@ export default class MetamaskController extends EventEmitter { smartTransactionsController, txController, assetsContractController, + backupController, } = this; return { @@ -1502,18 +1554,20 @@ export default class MetamaskController extends EventEmitter { setUseTokenDetection: preferencesController.setUseTokenDetection.bind( preferencesController, ), - setUseCollectibleDetection: preferencesController.setUseCollectibleDetection.bind( - preferencesController, - ), + setUseCollectibleDetection: + preferencesController.setUseCollectibleDetection.bind( + preferencesController, + ), setOpenSeaEnabled: preferencesController.setOpenSeaEnabled.bind( preferencesController, ), setIpfsGateway: preferencesController.setIpfsGateway.bind( preferencesController, ), - setParticipateInMetaMetrics: metaMetricsController.setParticipateInMetaMetrics.bind( - metaMetricsController, - ), + setParticipateInMetaMetrics: + metaMetricsController.setParticipateInMetaMetrics.bind( + metaMetricsController, + ), setCurrentLocale: preferencesController.setCurrentLocale.bind( preferencesController, ), @@ -1536,32 +1590,24 @@ export default class MetamaskController extends EventEmitter { forgetDevice: this.forgetDevice.bind(this), checkHardwareStatus: this.checkHardwareStatus.bind(this), unlockHardwareWalletAccount: this.unlockHardwareWalletAccount.bind(this), - setLedgerTransportPreference: this.setLedgerTransportPreference.bind( - this, - ), - attemptLedgerTransportCreation: this.attemptLedgerTransportCreation.bind( - this, - ), - establishLedgerTransportPreference: this.establishLedgerTransportPreference.bind( - this, - ), + setLedgerTransportPreference: + this.setLedgerTransportPreference.bind(this), + attemptLedgerTransportCreation: + this.attemptLedgerTransportCreation.bind(this), + establishLedgerTransportPreference: + this.establishLedgerTransportPreference.bind(this), // qr hardware devices - submitQRHardwareCryptoHDKey: qrHardwareKeyring.submitCryptoHDKey.bind( - qrHardwareKeyring, - ), - submitQRHardwareCryptoAccount: qrHardwareKeyring.submitCryptoAccount.bind( - qrHardwareKeyring, - ), - cancelSyncQRHardware: qrHardwareKeyring.cancelSync.bind( - qrHardwareKeyring, - ), - submitQRHardwareSignature: qrHardwareKeyring.submitSignature.bind( - qrHardwareKeyring, - ), - cancelQRHardwareSignRequest: qrHardwareKeyring.cancelSignRequest.bind( - qrHardwareKeyring, - ), + submitQRHardwareCryptoHDKey: + qrHardwareKeyring.submitCryptoHDKey.bind(qrHardwareKeyring), + submitQRHardwareCryptoAccount: + qrHardwareKeyring.submitCryptoAccount.bind(qrHardwareKeyring), + cancelSyncQRHardware: + qrHardwareKeyring.cancelSync.bind(qrHardwareKeyring), + submitQRHardwareSignature: + qrHardwareKeyring.submitSignature.bind(qrHardwareKeyring), + cancelQRHardwareSignRequest: + qrHardwareKeyring.cancelSignRequest.bind(qrHardwareKeyring), // mobile fetchInfoToSync: this.fetchInfoToSync.bind(this), @@ -1571,30 +1617,25 @@ export default class MetamaskController extends EventEmitter { verifyPassword: this.verifyPassword.bind(this), // network management - setProviderType: networkController.setProviderType.bind( - networkController, - ), - rollbackToPreviousProvider: networkController.rollbackToPreviousProvider.bind( - networkController, - ), + setProviderType: + networkController.setProviderType.bind(networkController), + rollbackToPreviousProvider: + networkController.rollbackToPreviousProvider.bind(networkController), setCustomRpc: this.setCustomRpc.bind(this), updateAndSetCustomRpc: this.updateAndSetCustomRpc.bind(this), delCustomRpc: this.delCustomRpc.bind(this), addCustomNetwork: this.addCustomNetwork.bind(this), - requestUserApproval: this.requestUserApproval.bind(this), + requestAddNetworkApproval: this.requestAddNetworkApproval.bind(this), // PreferencesController setSelectedAddress: preferencesController.setSelectedAddress.bind( preferencesController, ), addToken: tokensController.addToken.bind(tokensController), - rejectWatchAsset: tokensController.rejectWatchAsset.bind( - tokensController, - ), - acceptWatchAsset: tokensController.acceptWatchAsset.bind( - tokensController, - ), + rejectWatchAsset: + tokensController.rejectWatchAsset.bind(tokensController), + acceptWatchAsset: + tokensController.acceptWatchAsset.bind(tokensController), updateTokenType: tokensController.updateTokenType.bind(tokensController), - removeToken: tokensController.removeAndIgnoreToken.bind(tokensController), setAccountLabel: preferencesController.setAccountLabel.bind( preferencesController, ), @@ -1608,9 +1649,10 @@ export default class MetamaskController extends EventEmitter { addKnownMethodData: preferencesController.addKnownMethodData.bind( preferencesController, ), - setDismissSeedBackUpReminder: preferencesController.setDismissSeedBackUpReminder.bind( - preferencesController, - ), + setDismissSeedBackUpReminder: + preferencesController.setDismissSeedBackUpReminder.bind( + preferencesController, + ), setAdvancedGasFee: preferencesController.setAdvancedGasFee.bind( preferencesController, ), @@ -1618,9 +1660,10 @@ export default class MetamaskController extends EventEmitter { preferencesController, ), setTheme: preferencesController.setTheme.bind(preferencesController), - setCustomNetworkListEnabled: preferencesController.setCustomNetworkListEnabled.bind( - preferencesController, - ), + setCustomNetworkListEnabled: + preferencesController.setCustomNetworkListEnabled.bind( + preferencesController, + ), // AssetsContractController getTokenStandardAndDetails: this.getTokenStandardAndDetails.bind(this), @@ -1629,25 +1672,29 @@ export default class MetamaskController extends EventEmitter { collectiblesController, ), - addCollectibleVerifyOwnership: collectiblesController.addCollectibleVerifyOwnership.bind( - collectiblesController, - ), + addCollectibleVerifyOwnership: + collectiblesController.addCollectibleVerifyOwnership.bind( + collectiblesController, + ), - removeAndIgnoreCollectible: collectiblesController.removeAndIgnoreCollectible.bind( - collectiblesController, - ), + removeAndIgnoreCollectible: + collectiblesController.removeAndIgnoreCollectible.bind( + collectiblesController, + ), removeCollectible: collectiblesController.removeCollectible.bind( collectiblesController, ), - checkAndUpdateAllCollectiblesOwnershipStatus: collectiblesController.checkAndUpdateAllCollectiblesOwnershipStatus.bind( - collectiblesController, - ), + checkAndUpdateAllCollectiblesOwnershipStatus: + collectiblesController.checkAndUpdateAllCollectiblesOwnershipStatus.bind( + collectiblesController, + ), - checkAndUpdateSingleCollectibleOwnershipStatus: collectiblesController.checkAndUpdateSingleCollectibleOwnershipStatus.bind( - collectiblesController, - ), + checkAndUpdateSingleCollectibleOwnershipStatus: + collectiblesController.checkAndUpdateSingleCollectibleOwnershipStatus.bind( + collectiblesController, + ), isCollectibleOwner: collectiblesController.isCollectibleOwner.bind( collectiblesController, @@ -1660,37 +1707,43 @@ export default class MetamaskController extends EventEmitter { ), // AppStateController - setLastActiveTime: appStateController.setLastActiveTime.bind( - appStateController, - ), - setDefaultHomeActiveTabName: appStateController.setDefaultHomeActiveTabName.bind( - appStateController, - ), - setConnectedStatusPopoverHasBeenShown: appStateController.setConnectedStatusPopoverHasBeenShown.bind( - appStateController, - ), - setRecoveryPhraseReminderHasBeenShown: appStateController.setRecoveryPhraseReminderHasBeenShown.bind( - appStateController, - ), - setRecoveryPhraseReminderLastShown: appStateController.setRecoveryPhraseReminderLastShown.bind( - appStateController, - ), - setShowTestnetMessageInDropdown: appStateController.setShowTestnetMessageInDropdown.bind( - appStateController, - ), - setCollectiblesDetectionNoticeDismissed: appStateController.setCollectiblesDetectionNoticeDismissed.bind( - appStateController, - ), - setEnableEIP1559V2NoticeDismissed: appStateController.setEnableEIP1559V2NoticeDismissed.bind( - appStateController, - ), - updateCollectibleDropDownState: appStateController.updateCollectibleDropDownState.bind( - appStateController, - ), + setLastActiveTime: + appStateController.setLastActiveTime.bind(appStateController), + setDefaultHomeActiveTabName: + appStateController.setDefaultHomeActiveTabName.bind(appStateController), + setConnectedStatusPopoverHasBeenShown: + appStateController.setConnectedStatusPopoverHasBeenShown.bind( + appStateController, + ), + setRecoveryPhraseReminderHasBeenShown: + appStateController.setRecoveryPhraseReminderHasBeenShown.bind( + appStateController, + ), + setRecoveryPhraseReminderLastShown: + appStateController.setRecoveryPhraseReminderLastShown.bind( + appStateController, + ), + setShowTestnetMessageInDropdown: + appStateController.setShowTestnetMessageInDropdown.bind( + appStateController, + ), + setCollectiblesDetectionNoticeDismissed: + appStateController.setCollectiblesDetectionNoticeDismissed.bind( + appStateController, + ), + setEnableEIP1559V2NoticeDismissed: + appStateController.setEnableEIP1559V2NoticeDismissed.bind( + appStateController, + ), + updateCollectibleDropDownState: + appStateController.updateCollectibleDropDownState.bind( + appStateController, + ), + setFirstTimeUsedNetwork: + appStateController.setFirstTimeUsedNetwork.bind(appStateController), // EnsController - tryReverseResolveAddress: ensController.reverseResolveAddress.bind( - ensController, - ), + tryReverseResolveAddress: + ensController.reverseResolveAddress.bind(ensController), // KeyringController setLocked: this.setLocked.bind(this), @@ -1701,44 +1754,34 @@ export default class MetamaskController extends EventEmitter { // txController cancelTransaction: txController.cancelTransaction.bind(txController), updateTransaction: txController.updateTransaction.bind(txController), - updateAndApproveTransaction: txController.updateAndApproveTransaction.bind( - txController, - ), - approveTransactionsWithSameNonce: txController.approveTransactionsWithSameNonce.bind( - txController, - ), + updateAndApproveTransaction: + txController.updateAndApproveTransaction.bind(txController), + approveTransactionsWithSameNonce: + txController.approveTransactionsWithSameNonce.bind(txController), createCancelTransaction: this.createCancelTransaction.bind(this), createSpeedUpTransaction: this.createSpeedUpTransaction.bind(this), estimateGas: this.estimateGas.bind(this), getNextNonce: this.getNextNonce.bind(this), - addUnapprovedTransaction: txController.addUnapprovedTransaction.bind( - txController, - ), - createTransactionEventFragment: txController.createTransactionEventFragment.bind( - txController, - ), + addUnapprovedTransaction: + txController.addUnapprovedTransaction.bind(txController), + createTransactionEventFragment: + txController.createTransactionEventFragment.bind(txController), getTransactions: txController.getTransactions.bind(txController), - updateEditableParams: txController.updateEditableParams.bind( - txController, - ), - updateTransactionGasFees: txController.updateTransactionGasFees.bind( - txController, - ), - updateTransactionSendFlowHistory: txController.updateTransactionSendFlowHistory.bind( - txController, - ), + updateEditableParams: + txController.updateEditableParams.bind(txController), + updateTransactionGasFees: + txController.updateTransactionGasFees.bind(txController), + updateTransactionSendFlowHistory: + txController.updateTransactionSendFlowHistory.bind(txController), - updateSwapApprovalTransaction: txController.updateSwapApprovalTransaction.bind( - txController, - ), - updateSwapTransaction: txController.updateSwapTransaction.bind( - txController, - ), + updateSwapApprovalTransaction: + txController.updateSwapApprovalTransaction.bind(txController), + updateSwapTransaction: + txController.updateSwapTransaction.bind(txController), - updatePreviousGasParams: txController.updatePreviousGasParams.bind( - txController, - ), + updatePreviousGasParams: + txController.updatePreviousGasParams.bind(txController), // messageManager signMessage: this.signMessage.bind(this), cancelMessage: this.cancelMessage.bind(this), @@ -1761,55 +1804,47 @@ export default class MetamaskController extends EventEmitter { cancelEncryptionPublicKey: this.cancelEncryptionPublicKey.bind(this), // onboarding controller - setSeedPhraseBackedUp: onboardingController.setSeedPhraseBackedUp.bind( - onboardingController, - ), - completeOnboarding: onboardingController.completeOnboarding.bind( - onboardingController, - ), - setFirstTimeFlowType: onboardingController.setFirstTimeFlowType.bind( - onboardingController, - ), + setSeedPhraseBackedUp: + onboardingController.setSeedPhraseBackedUp.bind(onboardingController), + completeOnboarding: + onboardingController.completeOnboarding.bind(onboardingController), + setFirstTimeFlowType: + onboardingController.setFirstTimeFlowType.bind(onboardingController), // alert controller - setAlertEnabledness: alertController.setAlertEnabledness.bind( - alertController, - ), - setUnconnectedAccountAlertShown: alertController.setUnconnectedAccountAlertShown.bind( - alertController, - ), - setWeb3ShimUsageAlertDismissed: alertController.setWeb3ShimUsageAlertDismissed.bind( - alertController, - ), + setAlertEnabledness: + alertController.setAlertEnabledness.bind(alertController), + setUnconnectedAccountAlertShown: + alertController.setUnconnectedAccountAlertShown.bind(alertController), + setWeb3ShimUsageAlertDismissed: + alertController.setWeb3ShimUsageAlertDismissed.bind(alertController), // 3Box - setThreeBoxSyncingPermission: threeBoxController.setThreeBoxSyncingPermission.bind( - threeBoxController, - ), - restoreFromThreeBox: threeBoxController.restoreFromThreeBox.bind( - threeBoxController, - ), - setShowRestorePromptToFalse: threeBoxController.setShowRestorePromptToFalse.bind( - threeBoxController, - ), - getThreeBoxLastUpdated: threeBoxController.getLastUpdated.bind( - threeBoxController, - ), - turnThreeBoxSyncingOn: threeBoxController.turnThreeBoxSyncingOn.bind( - threeBoxController, - ), + setThreeBoxSyncingPermission: + threeBoxController.setThreeBoxSyncingPermission.bind( + threeBoxController, + ), + restoreFromThreeBox: + threeBoxController.restoreFromThreeBox.bind(threeBoxController), + setShowRestorePromptToFalse: + threeBoxController.setShowRestorePromptToFalse.bind(threeBoxController), + getThreeBoxLastUpdated: + threeBoxController.getLastUpdated.bind(threeBoxController), + turnThreeBoxSyncingOn: + threeBoxController.turnThreeBoxSyncingOn.bind(threeBoxController), initializeThreeBox: this.initializeThreeBox.bind(this), // permissions - removePermissionsFor: permissionController.revokePermissions.bind( - permissionController, - ), - approvePermissionsRequest: permissionController.acceptPermissionsRequest.bind( - permissionController, - ), - rejectPermissionsRequest: permissionController.rejectPermissionsRequest.bind( - permissionController, - ), + removePermissionsFor: + permissionController.revokePermissions.bind(permissionController), + approvePermissionsRequest: + permissionController.acceptPermissionsRequest.bind( + permissionController, + ), + rejectPermissionsRequest: + permissionController.rejectPermissionsRequest.bind( + permissionController, + ), ...getPermissionBackgroundApiMethods(permissionController), ///: BEGIN:ONLY_INCLUDE_IN(flask) @@ -1825,81 +1860,75 @@ export default class MetamaskController extends EventEmitter { ///: END:ONLY_INCLUDE_IN // swaps - fetchAndSetQuotes: swapsController.fetchAndSetQuotes.bind( - swapsController, - ), - setSelectedQuoteAggId: swapsController.setSelectedQuoteAggId.bind( - swapsController, - ), + fetchAndSetQuotes: + swapsController.fetchAndSetQuotes.bind(swapsController), + setSelectedQuoteAggId: + swapsController.setSelectedQuoteAggId.bind(swapsController), resetSwapsState: swapsController.resetSwapsState.bind(swapsController), setSwapsTokens: swapsController.setSwapsTokens.bind(swapsController), clearSwapsQuotes: swapsController.clearSwapsQuotes.bind(swapsController), setApproveTxId: swapsController.setApproveTxId.bind(swapsController), setTradeTxId: swapsController.setTradeTxId.bind(swapsController), - setSwapsTxGasPrice: swapsController.setSwapsTxGasPrice.bind( - swapsController, - ), - setSwapsTxGasLimit: swapsController.setSwapsTxGasLimit.bind( - swapsController, - ), - setSwapsTxMaxFeePerGas: swapsController.setSwapsTxMaxFeePerGas.bind( - swapsController, - ), - setSwapsTxMaxFeePriorityPerGas: swapsController.setSwapsTxMaxFeePriorityPerGas.bind( - swapsController, - ), - safeRefetchQuotes: swapsController.safeRefetchQuotes.bind( - swapsController, - ), - stopPollingForQuotes: swapsController.stopPollingForQuotes.bind( - swapsController, - ), - setBackgroundSwapRouteState: swapsController.setBackgroundSwapRouteState.bind( - swapsController, - ), - resetPostFetchState: swapsController.resetPostFetchState.bind( - swapsController, - ), + setSwapsTxGasPrice: + swapsController.setSwapsTxGasPrice.bind(swapsController), + setSwapsTxGasLimit: + swapsController.setSwapsTxGasLimit.bind(swapsController), + setSwapsTxMaxFeePerGas: + swapsController.setSwapsTxMaxFeePerGas.bind(swapsController), + setSwapsTxMaxFeePriorityPerGas: + swapsController.setSwapsTxMaxFeePriorityPerGas.bind(swapsController), + safeRefetchQuotes: + swapsController.safeRefetchQuotes.bind(swapsController), + stopPollingForQuotes: + swapsController.stopPollingForQuotes.bind(swapsController), + setBackgroundSwapRouteState: + swapsController.setBackgroundSwapRouteState.bind(swapsController), + resetPostFetchState: + swapsController.resetPostFetchState.bind(swapsController), setSwapsErrorKey: swapsController.setSwapsErrorKey.bind(swapsController), - setInitialGasEstimate: swapsController.setInitialGasEstimate.bind( - swapsController, - ), - setCustomApproveTxData: swapsController.setCustomApproveTxData.bind( - swapsController, - ), + setInitialGasEstimate: + swapsController.setInitialGasEstimate.bind(swapsController), + setCustomApproveTxData: + swapsController.setCustomApproveTxData.bind(swapsController), setSwapsLiveness: swapsController.setSwapsLiveness.bind(swapsController), - setSwapsFeatureFlags: swapsController.setSwapsFeatureFlags.bind( - swapsController, - ), - setSwapsUserFeeLevel: swapsController.setSwapsUserFeeLevel.bind( - swapsController, - ), - setSwapsQuotesPollingLimitEnabled: swapsController.setSwapsQuotesPollingLimitEnabled.bind( - swapsController, - ), + setSwapsFeatureFlags: + swapsController.setSwapsFeatureFlags.bind(swapsController), + setSwapsUserFeeLevel: + swapsController.setSwapsUserFeeLevel.bind(swapsController), + setSwapsQuotesPollingLimitEnabled: + swapsController.setSwapsQuotesPollingLimitEnabled.bind(swapsController), // Smart Transactions - setSmartTransactionsOptInStatus: smartTransactionsController.setOptInState.bind( - smartTransactionsController, - ), + setSmartTransactionsOptInStatus: + smartTransactionsController.setOptInState.bind( + smartTransactionsController, + ), fetchSmartTransactionFees: smartTransactionsController.getFees.bind( smartTransactionsController, ), - submitSignedTransactions: smartTransactionsController.submitSignedTransactions.bind( - smartTransactionsController, - ), - cancelSmartTransaction: smartTransactionsController.cancelSmartTransaction.bind( - smartTransactionsController, - ), - fetchSmartTransactionsLiveness: smartTransactionsController.fetchLiveness.bind( - smartTransactionsController, - ), - updateSmartTransaction: smartTransactionsController.updateSmartTransaction.bind( - smartTransactionsController, - ), - setStatusRefreshInterval: smartTransactionsController.setStatusRefreshInterval.bind( + clearSmartTransactionFees: smartTransactionsController.clearFees.bind( smartTransactionsController, ), + submitSignedTransactions: + smartTransactionsController.submitSignedTransactions.bind( + smartTransactionsController, + ), + cancelSmartTransaction: + smartTransactionsController.cancelSmartTransaction.bind( + smartTransactionsController, + ), + fetchSmartTransactionsLiveness: + smartTransactionsController.fetchLiveness.bind( + smartTransactionsController, + ), + updateSmartTransaction: + smartTransactionsController.updateSmartTransaction.bind( + smartTransactionsController, + ), + setStatusRefreshInterval: + smartTransactionsController.setStatusRefreshInterval.bind( + smartTransactionsController, + ), // MetaMetrics trackMetaMetricsEvent: metaMetricsController.trackEvent.bind( @@ -1919,9 +1948,8 @@ export default class MetamaskController extends EventEmitter { ), // approval controller - resolvePendingApproval: approvalController.accept.bind( - approvalController, - ), + resolvePendingApproval: + approvalController.accept.bind(approvalController), rejectPendingApproval: async (id, error) => { approvalController.reject( id, @@ -1935,25 +1963,26 @@ export default class MetamaskController extends EventEmitter { ), // GasFeeController - getGasFeeEstimatesAndStartPolling: gasFeeController.getGasFeeEstimatesAndStartPolling.bind( - gasFeeController, - ), + getGasFeeEstimatesAndStartPolling: + gasFeeController.getGasFeeEstimatesAndStartPolling.bind( + gasFeeController, + ), - disconnectGasFeeEstimatePoller: gasFeeController.disconnectPoller.bind( - gasFeeController, - ), + disconnectGasFeeEstimatePoller: + gasFeeController.disconnectPoller.bind(gasFeeController), - getGasFeeTimeEstimate: gasFeeController.getTimeEstimate.bind( - gasFeeController, - ), + getGasFeeTimeEstimate: + gasFeeController.getTimeEstimate.bind(gasFeeController), - addPollingTokenToAppState: appStateController.addPollingToken.bind( - appStateController, - ), + addPollingTokenToAppState: + appStateController.addPollingToken.bind(appStateController), - removePollingTokenFromAppState: appStateController.removePollingToken.bind( - appStateController, - ), + removePollingTokenFromAppState: + appStateController.removePollingToken.bind(appStateController), + + // BackupController + backupUserData: backupController.backupUserData.bind(backupController), + restoreUserData: backupController.restoreUserData.bind(backupController), // DetectTokenController detectNewTokens: detectTokensController.detectNewTokens.bind( @@ -1968,29 +1997,24 @@ export default class MetamaskController extends EventEmitter { : null, /** Token Detection V2 */ - addDetectedTokens: process.env.TOKEN_DETECTION_V2 - ? tokensController.addDetectedTokens.bind(tokensController) - : null, - importTokens: process.env.TOKEN_DETECTION_V2 - ? tokensController.importTokens.bind(tokensController) - : null, - ignoreTokens: process.env.TOKEN_DETECTION_V2 - ? tokensController.ignoreTokens.bind(tokensController) - : null, - getBalancesInSingleCall: process.env.TOKEN_DETECTION_V2 - ? assetsContractController.getBalancesInSingleCall.bind( - assetsContractController, - ) - : null, + addDetectedTokens: + tokensController.addDetectedTokens.bind(tokensController), + addImportedTokens: tokensController.addTokens.bind(tokensController), + ignoreTokens: tokensController.ignoreTokens.bind(tokensController), + getBalancesInSingleCall: + assetsContractController.getBalancesInSingleCall.bind( + assetsContractController, + ), }; } async getTokenStandardAndDetails(address, userAddress, tokenId) { - const details = await this.assetsContractController.getTokenStandardAndDetails( - address, - userAddress, - tokenId, - ); + const details = + await this.assetsContractController.getTokenStandardAndDetails( + address, + userAddress, + tokenId, + ); return { ...details, decimals: details?.decimals?.toString(10), @@ -2037,7 +2061,7 @@ export default class MetamaskController extends EventEmitter { } } - async requestUserApproval(customRpc, originIsMetaMask) { + async requestAddNetworkApproval(customRpc, originIsMetaMask) { try { await this.approvalController.addAndShowApprovalRequest({ origin: 'metamask', @@ -2072,6 +2096,31 @@ export default class MetamaskController extends EventEmitter { blockExplorerUrl, }, ); + + let rpcUrlOrigin; + try { + rpcUrlOrigin = new URL(rpcUrl).origin; + } catch { + // ignore + } + this.metaMetricsController.trackEvent({ + event: 'Custom Network Added', + category: EVENT.CATEGORIES.NETWORK, + referrer: { + url: rpcUrlOrigin, + }, + properties: { + chain_id: chainId, + network_name: chainName, + network: rpcUrlOrigin, + symbol: ticker, + block_explorer_url: blockExplorerUrl, + source: EVENT.SOURCE.NETWORK.POPULAR_NETWORK_LIST, + }, + sensitiveProperties: { + rpc_url: rpcUrlOrigin, + }, + }); } /** @@ -2118,9 +2167,8 @@ export default class MetamaskController extends EventEmitter { ethQuery, ); - const primaryKeyring = keyringController.getKeyringsByType( - 'HD Key Tree', - )[0]; + const primaryKeyring = + keyringController.getKeyringsByType('HD Key Tree')[0]; if (!primaryKeyring) { throw new Error('MetamaskController - No HD Key Tree found'); } @@ -2145,7 +2193,8 @@ export default class MetamaskController extends EventEmitter { // keyring's iframe and have the setting initialized properly // Optimistically called to not block MetaMask login due to // Ledger Keyring GitHub downtime - const transportPreference = this.preferencesController.getLedgerTransportPreference(); + const transportPreference = + this.preferencesController.getLedgerTransportPreference(); this.setLedgerTransportPreference(transportPreference); // set new identities @@ -2198,7 +2247,14 @@ export default class MetamaskController extends EventEmitter { useTokenDetection, } = this.preferencesController.store.getState(); + const isTokenDetectionInactiveInMainnet = + !useTokenDetection && + this.networkController.store.getState().provider.chainId === + MAINNET_CHAIN_ID; const { tokenList } = this.tokenListController.state; + const caseInSensitiveTokenList = isTokenDetectionInactiveInMainnet + ? STATIC_MAINNET_TOKEN_LIST + : tokenList; const preferences = { currentLocale, @@ -2221,13 +2277,11 @@ export default class MetamaskController extends EventEmitter { checksummedAccountAddress ].filter((asset) => { if (asset.isERC721 === undefined) { - // since the token.address from allTokens is checksumaddress - // asset.address have to be changed to lowercase when we are using dynamic list - const address = useTokenDetection - ? asset.address.toLowerCase() - : asset.address; // the tokenList will be holding only erc20 tokens - if (tokenList[address] !== undefined) { + if ( + caseInSensitiveTokenList[asset.address?.toLowerCase()] !== + undefined + ) { return true; } } else if (asset.isERC721 === false) { @@ -2239,12 +2293,10 @@ export default class MetamaskController extends EventEmitter { }); // Accounts - const hdKeyring = this.keyringController.getKeyringsByType( - 'HD Key Tree', - )[0]; - const simpleKeyPairKeyrings = this.keyringController.getKeyringsByType( - 'Simple Key Pair', - ); + const hdKeyring = + this.keyringController.getKeyringsByType('HD Key Tree')[0]; + const simpleKeyPairKeyrings = + this.keyringController.getKeyringsByType('Simple Key Pair'); const hdAccounts = await hdKeyring.getAccounts(); const simpleKeyPairKeyringAccounts = await Promise.all( simpleKeyPairKeyrings.map((keyring) => keyring.getAccounts()), @@ -2301,7 +2353,8 @@ export default class MetamaskController extends EventEmitter { } try { - const threeBoxSyncingAllowed = this.threeBoxController.getThreeBoxSyncingState(); + const threeBoxSyncingAllowed = + this.threeBoxController.getThreeBoxSyncingState(); if (threeBoxSyncingAllowed && !this.threeBoxController.box) { // 'await' intentionally omitted to avoid waiting for initialization this.threeBoxController.init(); @@ -2317,7 +2370,8 @@ export default class MetamaskController extends EventEmitter { // keyring's iframe and have the setting initialized properly // Optimistically called to not block MetaMask login due to // Ledger Keyring GitHub downtime - const transportPreference = this.preferencesController.getLedgerTransportPreference(); + const transportPreference = + this.preferencesController.getLedgerTransportPreference(); this.setLedgerTransportPreference(transportPreference); @@ -2413,7 +2467,8 @@ export default class MetamaskController extends EventEmitter { } async establishLedgerTransportPreference() { - const transportPreference = this.preferencesController.getLedgerTransportPreference(); + const transportPreference = + this.preferencesController.getLedgerTransportPreference(); return await this.setLedgerTransportPreference(transportPreference); } @@ -2582,31 +2637,41 @@ export default class MetamaskController extends EventEmitter { /** * Adds a new account to the default (first) HD seed phrase Keyring. * + * @param accountCount * @returns {} keyState */ - async addNewAccount() { - const primaryKeyring = this.keyringController.getKeyringsByType( - 'HD Key Tree', - )[0]; + async addNewAccount(accountCount) { + const primaryKeyring = + this.keyringController.getKeyringsByType('HD Key Tree')[0]; if (!primaryKeyring) { throw new Error('MetamaskController - No HD Key Tree found'); } const { keyringController } = this; - const oldAccounts = await keyringController.getAccounts(); - const keyState = await keyringController.addNewAccount(primaryKeyring); - const newAccounts = await keyringController.getAccounts(); + const { identities: oldIdentities } = + this.preferencesController.store.getState(); - await this.verifySeedPhrase(); + if (Object.keys(oldIdentities).length === accountCount) { + const oldAccounts = await keyringController.getAccounts(); + const keyState = await keyringController.addNewAccount(primaryKeyring); + const newAccounts = await keyringController.getAccounts(); - this.preferencesController.setAddresses(newAccounts); - newAccounts.forEach((address) => { - if (!oldAccounts.includes(address)) { - this.preferencesController.setSelectedAddress(address); - } - }); + await this.verifySeedPhrase(); - const { identities } = this.preferencesController.store.getState(); - return { ...keyState, identities }; + this.preferencesController.setAddresses(newAccounts); + newAccounts.forEach((address) => { + if (!oldAccounts.includes(address)) { + this.preferencesController.setSelectedAddress(address); + } + }); + + const { identities } = this.preferencesController.store.getState(); + return { ...keyState, identities }; + } + + return { + ...keyringController.memStore.getState(), + identities: oldIdentities, + }; } /** @@ -2620,9 +2685,8 @@ export default class MetamaskController extends EventEmitter { * encoded as an array of UTF-8 bytes. */ async verifySeedPhrase() { - const primaryKeyring = this.keyringController.getKeyringsByType( - 'HD Key Tree', - )[0]; + const primaryKeyring = + this.keyringController.getKeyringsByType('HD Key Tree')[0]; if (!primaryKeyring) { throw new Error('MetamaskController - No HD Key Tree found'); } @@ -3057,10 +3121,11 @@ export default class MetamaskController extends EventEmitter { } default: { - const promise = this.encryptionPublicKeyManager.addUnapprovedMessageAsync( - msgParams, - req, - ); + const promise = + this.encryptionPublicKeyManager.addUnapprovedMessageAsync( + msgParams, + req, + ); this.sendUpdate(); this.opts.showUserConfirmation(); return promise; @@ -3325,9 +3390,13 @@ export default class MetamaskController extends EventEmitter { if (sender.url) { const { hostname } = new URL(sender.url); // Check if new connection is blocked if phishing detection is on - if (usePhishDetect && this.phishingController.test(hostname)) { - log.debug('MetaMask - sending phishing warning for', hostname); - this.sendPhishingWarning(connectionStream, hostname); + const phishingTestResponse = this.phishingController.test(hostname); + if (usePhishDetect && phishingTestResponse?.result) { + this.sendPhishingWarning( + connectionStream, + hostname, + phishingTestResponse, + ); return; } } @@ -3405,11 +3474,15 @@ export default class MetamaskController extends EventEmitter { * @param {*} connectionStream - The duplex stream to the per-page script, * for sending the reload attempt to. * @param {string} hostname - The hostname that triggered the suspicion. + * @param {object} phishingTestResponse - Result of calling `phishingController.test`, + * which is the result of calling eth-phishing-detects detector.check method https://github.com/MetaMask/eth-phishing-detect/blob/master/src/detector.js#L55-L112 */ - sendPhishingWarning(connectionStream, hostname) { + sendPhishingWarning(connectionStream, hostname, phishingTestResponse) { + const newIssueUrl = PHISHING_NEW_ISSUE_URLS[phishingTestResponse?.name]; + const mux = setupMultiplex(connectionStream); const phishingStream = mux.createStream('phishing'); - phishingStream.write({ hostname }); + phishingStream.write({ hostname, newIssueUrl }); } /** @@ -3591,9 +3664,10 @@ export default class MetamaskController extends EventEmitter { subjectType, // Miscellaneous - addSubjectMetadata: this.subjectMetadataController.addSubjectMetadata.bind( - this.subjectMetadataController, - ), + addSubjectMetadata: + this.subjectMetadataController.addSubjectMetadata.bind( + this.subjectMetadataController, + ), getProviderState: this.getProviderState.bind(this), getUnlockPromise: this.appStateController.getUnlockPromise.bind( this.appStateController, @@ -3601,9 +3675,10 @@ export default class MetamaskController extends EventEmitter { handleWatchAssetRequest: this.tokensController.watchAsset.bind( this.tokensController, ), - requestUserApproval: this.approvalController.addAndShowApprovalRequest.bind( - this.approvalController, - ), + requestUserApproval: + this.approvalController.addAndShowApprovalRequest.bind( + this.approvalController, + ), sendMetrics: this.metaMetricsController.trackEvent.bind( this.metaMetricsController, ), @@ -3618,15 +3693,17 @@ export default class MetamaskController extends EventEmitter { this.permissionController, origin, ), - requestAccountsPermission: this.permissionController.requestPermissions.bind( - this.permissionController, - { origin }, - { eth_accounts: {} }, - ), - requestPermissionsForOrigin: this.permissionController.requestPermissions.bind( - this.permissionController, - { origin }, - ), + requestAccountsPermission: + this.permissionController.requestPermissions.bind( + this.permissionController, + { origin }, + { eth_accounts: {} }, + ), + requestPermissionsForOrigin: + this.permissionController.requestPermissions.bind( + this.permissionController, + { origin }, + ), // Custom RPC-related addCustomRpc: async ({ @@ -3669,9 +3746,10 @@ export default class MetamaskController extends EventEmitter { getWeb3ShimUsageState: this.alertController.getWeb3ShimUsageState.bind( this.alertController, ), - setWeb3ShimUsageRecorded: this.alertController.setWeb3ShimUsageRecorded.bind( - this.alertController, - ), + setWeb3ShimUsageRecorded: + this.alertController.setWeb3ShimUsageRecorded.bind( + this.alertController, + ), }), ); @@ -3679,17 +3757,19 @@ export default class MetamaskController extends EventEmitter { engine.push( createSnapMethodMiddleware(subjectType === SUBJECT_TYPES.SNAP, { getAppKey: this.getAppKeyForSubject.bind(this, origin), + getUnlockPromise: this.appStateController.getUnlockPromise.bind( + this.appStateController, + ), getSnaps: this.snapController.getPermittedSnaps.bind( this.snapController, origin, ), requestPermissions: async (requestedPermissions) => { - const [ - approvedPermissions, - ] = await this.permissionController.requestPermissions( - { origin }, - requestedPermissions, - ); + const [approvedPermissions] = + await this.permissionController.requestPermissions( + { origin }, + requestedPermissions, + ); return Object.values(approvedPermissions); }, @@ -3979,10 +4059,8 @@ export default class MetamaskController extends EventEmitter { * @returns {Promise} */ async getPendingNonce(address) { - const { - nonceDetails, - releaseLock, - } = await this.txController.nonceTracker.getNonceLock(address); + const { nonceDetails, releaseLock } = + await this.txController.nonceTracker.getNonceLock(address); const pendingNonce = nonceDetails.params.highestSuggested; releaseLock(); @@ -4098,7 +4176,8 @@ export default class MetamaskController extends EventEmitter { nickname = '', rpcPrefs = {}, ) { - const frequentRpcListDetail = this.preferencesController.getFrequentRpcListDetail(); + const frequentRpcListDetail = + this.preferencesController.getFrequentRpcListDetail(); const rpcSettings = frequentRpcListDetail.find( (rpc) => rpcUrl === rpc.rpcUrl, ); @@ -4147,7 +4226,8 @@ export default class MetamaskController extends EventEmitter { * @returns {object} rpcInfo found in the frequentRpcList */ findCustomRpcBy(rpcInfo) { - const frequentRpcListDetail = this.preferencesController.getFrequentRpcListDetail(); + const frequentRpcListDetail = + this.preferencesController.getFrequentRpcListDetail(); for (const existingRpcInfo of frequentRpcListDetail) { for (const key of Object.keys(rpcInfo)) { if (existingRpcInfo[key] === rpcInfo[key]) { @@ -4168,10 +4248,10 @@ export default class MetamaskController extends EventEmitter { * @param {string} transportType - The Ledger transport type. */ async setLedgerTransportPreference(transportType) { - const currentValue = this.preferencesController.getLedgerTransportPreference(); - const newValue = this.preferencesController.setLedgerTransportPreference( - transportType, - ); + const currentValue = + this.preferencesController.getLedgerTransportPreference(); + const newValue = + this.preferencesController.setLedgerTransportPreference(transportType); const keyring = await this.getKeyringForDevice(DEVICE_NAMES.LEDGER); if (keyring?.updateTransportMethod) { @@ -4237,9 +4317,8 @@ export default class MetamaskController extends EventEmitter { onEnvironmentTypeClosed(environmentType) { const appStatePollingTokenType = POLLING_TOKEN_ENVIRONMENT_TYPES[environmentType]; - const pollingTokensToDisconnect = this.appStateController.store.getState()[ - appStatePollingTokenType - ]; + const pollingTokensToDisconnect = + this.appStateController.store.getState()[appStatePollingTokenType]; pollingTokensToDisconnect.forEach((pollingToken) => { this.gasFeeController.disconnectPoller(pollingToken); this.appStateController.removePollingToken( diff --git a/app/scripts/metamask-controller.test.js b/app/scripts/metamask-controller.test.js index c0e1a08b9..21b697fd2 100644 --- a/app/scripts/metamask-controller.test.js +++ b/app/scripts/metamask-controller.test.js @@ -221,9 +221,10 @@ describe('MetaMaskController', function () { }); it('adds private key to keyrings in KeyringController', async function () { - const simpleKeyrings = metamaskController.keyringController.getKeyringsByType( - 'Simple Key Pair', - ); + const simpleKeyrings = + metamaskController.keyringController.getKeyringsByType( + 'Simple Key Pair', + ); const privKeyBuffer = simpleKeyrings[0].wallets[0].privateKey; const pubKeyBuffer = simpleKeyrings[0].wallets[0].publicKey; const addressBuffer = pubToAddress(pubKeyBuffer); @@ -234,7 +235,8 @@ describe('MetaMaskController', function () { }); it('adds 1 account', async function () { - const keyringAccounts = await metamaskController.keyringController.getAccounts(); + const keyringAccounts = + await metamaskController.keyringController.getAccounts(); assert.equal( keyringAccounts[keyringAccounts.length - 1], '0xe18035bf8712672935fdb4e5e431b1a0183d2dfc', @@ -259,7 +261,8 @@ describe('MetaMaskController', function () { const identities = Object.keys( metamaskController.preferencesController.store.getState().identities, ); - const addresses = await metamaskController.keyringController.getAccounts(); + const addresses = + await metamaskController.keyringController.getAccounts(); identities.forEach((identity) => { assert.ok( @@ -486,7 +489,8 @@ describe('MetaMaskController', function () { }); it('changes preferences controller select address', function () { - const preferenceControllerState = metamaskController.preferencesController.store.getState(); + const preferenceControllerState = + metamaskController.preferencesController.store.getState(); assert.equal(preferenceControllerState.selectedAddress, address); }); @@ -517,9 +521,10 @@ describe('MetaMaskController', function () { await metamaskController .connectHardware(DEVICE_NAMES.TREZOR, 0) .catch(() => null); - const keyrings = await metamaskController.keyringController.getKeyringsByType( - KEYRING_TYPES.TREZOR, - ); + const keyrings = + await metamaskController.keyringController.getKeyringsByType( + KEYRING_TYPES.TREZOR, + ); assert.deepEqual( metamaskController.keyringController.addNewKeyring.getCall(0).args, [KEYRING_TYPES.TREZOR], @@ -532,9 +537,10 @@ describe('MetaMaskController', function () { await metamaskController .connectHardware(DEVICE_NAMES.LEDGER, 0) .catch(() => null); - const keyrings = await metamaskController.keyringController.getKeyringsByType( - KEYRING_TYPES.LEDGER, - ); + const keyrings = + await metamaskController.keyringController.getKeyringsByType( + KEYRING_TYPES.LEDGER, + ); assert.deepEqual( metamaskController.keyringController.addNewKeyring.getCall(0).args, [KEYRING_TYPES.LEDGER], @@ -586,9 +592,10 @@ describe('MetaMaskController', function () { .connectHardware(DEVICE_NAMES.TREZOR, 0) .catch(() => null); await metamaskController.forgetDevice(DEVICE_NAMES.TREZOR); - const keyrings = await metamaskController.keyringController.getKeyringsByType( - KEYRING_TYPES.TREZOR, - ); + const keyrings = + await metamaskController.keyringController.getKeyringsByType( + KEYRING_TYPES.TREZOR, + ); assert.deepEqual(keyrings[0].accounts, []); assert.deepEqual(keyrings[0].page, 0); @@ -645,9 +652,10 @@ describe('MetaMaskController', function () { }); it('should set unlockedAccount in the keyring', async function () { - const keyrings = await metamaskController.keyringController.getKeyringsByType( - KEYRING_TYPES.TREZOR, - ); + const keyrings = + await metamaskController.keyringController.getKeyringsByType( + KEYRING_TYPES.TREZOR, + ); assert.equal(keyrings[0].unlockedAccount, accountToUnlock); }); @@ -690,7 +698,8 @@ describe('MetaMaskController', function () { CUSTOM_RPC_URL, CUSTOM_RPC_CHAIN_ID, ); - const networkControllerState = metamaskController.networkController.store.getState(); + const networkControllerState = + metamaskController.networkController.store.getState(); assert.equal(networkControllerState.provider.rpcUrl, CUSTOM_RPC_URL); }); }); @@ -725,8 +734,9 @@ describe('MetaMaskController', function () { }); it('#addNewAccount', async function () { - await metamaskController.addNewAccount(); - const getAccounts = await metamaskController.keyringController.getAccounts(); + await metamaskController.addNewAccount(1); + const getAccounts = + await metamaskController.keyringController.getAccounts(); assert.equal(getAccounts.length, 2); }); }); @@ -959,7 +969,8 @@ describe('MetaMaskController', function () { // handle the promise so it doesn't throw an unhandledRejection promise.then(noop).catch(noop); - metamaskPersonalMsgs = metamaskController.personalMessageManager.getUnapprovedMsgs(); + metamaskPersonalMsgs = + metamaskController.personalMessageManager.getUnapprovedMsgs(); personalMessages = metamaskController.personalMessageManager.messages; msgId = Object.keys(metamaskPersonalMsgs)[0]; personalMessages[0].msgParams.metamaskId = parseInt(msgId, 10); @@ -1250,9 +1261,8 @@ describe('MetaMaskController', function () { describe('markNotificationsAsRead', function () { it('marks the notification as read', function () { metamaskController.markNotificationsAsRead([NOTIFICATION_ID]); - const readNotification = metamaskController.getState().notifications[ - NOTIFICATION_ID - ]; + const readNotification = + metamaskController.getState().notifications[NOTIFICATION_ID]; assert.notEqual(readNotification.readDate, null); }); }); diff --git a/app/scripts/migrations/022.test.js b/app/scripts/migrations/022.test.js index c4e91aac5..c2950b0ac 100644 --- a/app/scripts/migrations/022.test.js +++ b/app/scripts/migrations/022.test.js @@ -18,11 +18,8 @@ const storage = { describe('storage is migrated successfully where transactions that are submitted have submittedTimes', () => { it('should add submittedTime key on the txMeta if appropriate', async () => { const migratedData = await migration22.migrate(storage); - const [ - txMeta1, - txMeta2, - txMeta3, - ] = migratedData.data.TransactionController.transactions; + const [txMeta1, txMeta2, txMeta3] = + migratedData.data.TransactionController.transactions; expect(migratedData.meta.version).toStrictEqual(22); // should have written a submitted time diff --git a/app/scripts/migrations/030.js b/app/scripts/migrations/030.js index 31dc1cf6e..41f00bf66 100644 --- a/app/scripts/migrations/030.js +++ b/app/scripts/migrations/030.js @@ -33,7 +33,8 @@ function transformState(state) { delete frequentRpcListDetail[index].chainId; } }); - newState.PreferencesController.frequentRpcListDetail = frequentRpcListDetail; + newState.PreferencesController.frequentRpcListDetail = + frequentRpcListDetail; } } if (state.NetworkController) { diff --git a/app/scripts/migrations/047.js b/app/scripts/migrations/047.js index b3d2a6fd7..a08da313a 100644 --- a/app/scripts/migrations/047.js +++ b/app/scripts/migrations/047.js @@ -21,7 +21,8 @@ function transformState(state) { if (Array.isArray(transactions)) { transactions.forEach((transaction) => { if (typeof transaction.metamaskNetworkId === 'number') { - transaction.metamaskNetworkId = transaction.metamaskNetworkId.toString(); + transaction.metamaskNetworkId = + transaction.metamaskNetworkId.toString(); } }); } diff --git a/app/scripts/migrations/049.js b/app/scripts/migrations/049.js index 6b3013d82..a420886e0 100644 --- a/app/scripts/migrations/049.js +++ b/app/scripts/migrations/049.js @@ -18,11 +18,8 @@ export default { function transformState(state = {}) { if (state.PreferencesController) { - const { - metaMetricsId, - participateInMetaMetrics, - metaMetricsSendCount, - } = state.PreferencesController; + const { metaMetricsId, participateInMetaMetrics, metaMetricsSendCount } = + state.PreferencesController; state.MetaMetricsController = state.MetaMetricsController ?? {}; if (metaMetricsId !== undefined) { @@ -31,7 +28,8 @@ function transformState(state = {}) { } if (participateInMetaMetrics !== undefined) { - state.MetaMetricsController.participateInMetaMetrics = participateInMetaMetrics; + state.MetaMetricsController.participateInMetaMetrics = + participateInMetaMetrics; delete state.PreferencesController.participateInMetaMetrics; } diff --git a/app/scripts/migrations/052.js b/app/scripts/migrations/052.js index 4b5de7d22..f2469106e 100644 --- a/app/scripts/migrations/052.js +++ b/app/scripts/migrations/052.js @@ -34,11 +34,8 @@ export default { function transformState(state = {}) { if (state.PreferencesController) { - const { - accountTokens, - accountHiddenTokens, - frequentRpcListDetail, - } = state.PreferencesController; + const { accountTokens, accountHiddenTokens, frequentRpcListDetail } = + state.PreferencesController; const newAccountTokens = {}; const newAccountHiddenTokens = {}; diff --git a/app/scripts/migrations/055.js b/app/scripts/migrations/055.js index 98676bc63..b0ab2a844 100644 --- a/app/scripts/migrations/055.js +++ b/app/scripts/migrations/055.js @@ -23,13 +23,16 @@ function transformState(state) { if ( state?.IncomingTransactionsController?.incomingTxLastFetchedBlocksByNetwork ) { - state.IncomingTransactionsController.incomingTxLastFetchedBlockByChainId = mapKeys( - state.IncomingTransactionsController.incomingTxLastFetchedBlocksByNetwork, - // using optional chaining in case user's state has fetched blocks for - // RPC network types (which don't map to a single chainId). This should - // not be possible, but it's safer - (_, key) => NETWORK_TYPE_TO_ID_MAP[key]?.chainId ?? UNKNOWN_CHAIN_ID_KEY, - ); + state.IncomingTransactionsController.incomingTxLastFetchedBlockByChainId = + mapKeys( + state.IncomingTransactionsController + .incomingTxLastFetchedBlocksByNetwork, + // using optional chaining in case user's state has fetched blocks for + // RPC network types (which don't map to a single chainId). This should + // not be possible, but it's safer + (_, key) => + NETWORK_TYPE_TO_ID_MAP[key]?.chainId ?? UNKNOWN_CHAIN_ID_KEY, + ); // Now that mainnet and test net last fetched blocks are keyed by their // respective chainIds, we can safely delete anything we had for custom // networks. Any custom network that shares a chainId with one of the diff --git a/app/scripts/migrations/056.js b/app/scripts/migrations/056.js index 70300f363..48e75eaa4 100644 --- a/app/scripts/migrations/056.js +++ b/app/scripts/migrations/056.js @@ -30,11 +30,10 @@ export default { PreferencesController.accountTokens[account], ); chains.forEach((chain) => { - PreferencesController.accountTokens[account][ - chain - ] = PreferencesController.accountTokens[account][chain].filter( - ({ address }) => address, - ); + PreferencesController.accountTokens[account][chain] = + PreferencesController.accountTokens[account][chain].filter( + ({ address }) => address, + ); }); }); } diff --git a/app/scripts/migrations/064.test.js b/app/scripts/migrations/064.test.js index 94228ad9b..227d4d11d 100644 --- a/app/scripts/migrations/064.test.js +++ b/app/scripts/migrations/064.test.js @@ -95,8 +95,7 @@ describe('migration #64', () => { s: '0x49f74084dd8c517b305a2e60b39ae9002176a5244cb06de8f9ea3757811f5ec6', status: 'confirmed', estimatedBaseFee: 'b', - hash: - '0x4d8543f12afd3795b94d723dcd0e20bfc3740e1af668e5e90a0c5ec49f36ba12', + hash: '0x4d8543f12afd3795b94d723dcd0e20bfc3740e1af668e5e90a0c5ec49f36ba12', }, 1: { type: SENT_ETHER, @@ -118,8 +117,7 @@ describe('migration #64', () => { status: 'unapproved', time: 1631118004776, txParams: { - data: - '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', + data: '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', from: '0x0f002c95c041f003be01c3e4f52cae1f6ab3ba6e', gas: '0x31413', value: '0x0', @@ -159,8 +157,7 @@ describe('migration #64', () => { gas: '0xa9fe', }, estimatedBaseFee: 'b', - hash: - '0x19ffab8a9467df9afbef82d8907f9e39f0696c7a774ed5473ecf7337adcc674b', + hash: '0x19ffab8a9467df9afbef82d8907f9e39f0696c7a774ed5473ecf7337adcc674b', origin: 'https://metamask.github.io', r: '0xc2b2901f3593536d21e9b136c469b9b8f91a944f18a29a3cdf3a2eaadf660e71', rawTx: @@ -277,8 +274,7 @@ describe('migration #64', () => { s: '0x49f74084dd8c517b305a2e60b39ae9002176a5244cb06de8f9ea3757811f5ec6', status: 'confirmed', estimatedBaseFee: 'b', - hash: - '0x4d8543f12afd3795b94d723dcd0e20bfc3740e1af668e5e90a0c5ec49f36ba12', + hash: '0x4d8543f12afd3795b94d723dcd0e20bfc3740e1af668e5e90a0c5ec49f36ba12', }, 1: { type: TRANSACTION_TYPES.SIMPLE_SEND, @@ -300,8 +296,7 @@ describe('migration #64', () => { status: 'unapproved', time: 1631118004776, txParams: { - data: - '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', + data: '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', from: '0x0f002c95c041f003be01c3e4f52cae1f6ab3ba6e', gas: '0x31413', value: '0x0', @@ -341,8 +336,7 @@ describe('migration #64', () => { gas: '0xa9fe', }, estimatedBaseFee: 'b', - hash: - '0x19ffab8a9467df9afbef82d8907f9e39f0696c7a774ed5473ecf7337adcc674b', + hash: '0x19ffab8a9467df9afbef82d8907f9e39f0696c7a774ed5473ecf7337adcc674b', origin: 'https://metamask.github.io', r: '0xc2b2901f3593536d21e9b136c469b9b8f91a944f18a29a3cdf3a2eaadf660e71', rawTx: diff --git a/app/scripts/migrations/065.js b/app/scripts/migrations/065.js index 96e9820e1..c1422d8ae 100644 --- a/app/scripts/migrations/065.js +++ b/app/scripts/migrations/065.js @@ -19,10 +19,8 @@ export default { function transformState(state) { if (state.PreferencesController) { - const { - completedOnboarding, - firstTimeFlowType, - } = state.PreferencesController; + const { completedOnboarding, firstTimeFlowType } = + state.PreferencesController; state.OnboardingController = state.OnboardingController ?? {}; if (completedOnboarding !== undefined) { diff --git a/app/scripts/migrations/067.js b/app/scripts/migrations/067.js index 98150edf7..b635a0643 100644 --- a/app/scripts/migrations/067.js +++ b/app/scripts/migrations/067.js @@ -36,14 +36,13 @@ function transformState(state) { const cachedBalances = state.CachedBalancesController?.cachedBalances || {}; const userIsCurrentlyOnATestNet = TEST_CHAINS.includes(provider?.chainId); - const userHasMadeATestNetTransaction = Object.values( - transactions, - ).some(({ chainId }) => TEST_CHAINS.includes(chainId)); + const userHasMadeATestNetTransaction = Object.values(transactions).some( + ({ chainId }) => TEST_CHAINS.includes(chainId), + ); const userHasACachedBalanceOnATestnet = TEST_CHAINS.some((chainId) => { const cachedBalancesForChain = Object.values(cachedBalances[chainId] || {}); - const userHasABalanceGreaterThanZeroOnThisChain = cachedBalancesForChain.some( - hexNumberIsGreaterThanZero, - ); + const userHasABalanceGreaterThanZeroOnThisChain = + cachedBalancesForChain.some(hexNumberIsGreaterThanZero); return userHasABalanceGreaterThanZeroOnThisChain; }); const userHasUsedATestnet = diff --git a/app/scripts/migrations/068.js b/app/scripts/migrations/068.js index c2abbef76..a08dbcaea 100644 --- a/app/scripts/migrations/068.js +++ b/app/scripts/migrations/068.js @@ -38,9 +38,8 @@ function transformState(state) { permissionActivityLog: permissionsLog, permissionHistory: permissionsHistory, }, - SubjectMetadataController: getSubjectMetadataControllerState( - domainMetadata, - ), + SubjectMetadataController: + getSubjectMetadataControllerState(domainMetadata), }; } diff --git a/app/scripts/migrations/068.test.js b/app/scripts/migrations/068.test.js index 0540c5b48..b5aad374a 100644 --- a/app/scripts/migrations/068.test.js +++ b/app/scripts/migrations/068.test.js @@ -119,10 +119,8 @@ describe('migration #68', () => { }; const newStorage = await migration68.migrate(oldStorage); - const { - PermissionLogController, - SubjectMetadataController, - } = newStorage.data; + const { PermissionLogController, SubjectMetadataController } = + newStorage.data; const expected = getOldState().PermissionsMetadata; expect(PermissionLogController.permissionHistory).toStrictEqual( diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js index 8f1d49600..7381fab9d 100644 --- a/app/scripts/platforms/extension.js +++ b/app/scripts/platforms/extension.js @@ -80,10 +80,8 @@ export default class ExtensionPlatform { } getVersion() { - const { - version, - version_name: versionName, - } = browser.runtime.getManifest(); + const { version, version_name: versionName } = + browser.runtime.getManifest(); const versionParts = version.split('.'); if (versionName) { diff --git a/app/scripts/ui.js b/app/scripts/ui.js index 93f06143d..5d7a0c181 100644 --- a/app/scripts/ui.js +++ b/app/scripts/ui.js @@ -11,7 +11,7 @@ import Eth from 'ethjs'; import EthQuery from 'eth-query'; import StreamProvider from 'web3-stream-provider'; import log from 'loglevel'; -import launchMetaMaskUi from '../../ui'; +import launchMetaMaskUi, { updateBackgroundConnection } from '../../ui'; import { ENVIRONMENT_TYPE_FULLSCREEN, ENVIRONMENT_TYPE_POPUP, @@ -24,34 +24,37 @@ import { setupMultiplex } from './lib/stream-utils'; import { getEnvironmentType } from './lib/util'; import metaRPCClientFactory from './lib/metaRPCClientFactory'; -start().catch(log.error); - -async function start() { - async function displayCriticalError(container, err, metamaskState) { - const html = await getErrorHtml(SUPPORT_LINK, metamaskState); - - container.innerHTML = html; +const container = document.getElementById('app-content'); - const button = document.getElementById('critical-error-button'); +const WORKER_KEEP_ALIVE_INTERVAL = 1000; +const WORKER_KEEP_ALIVE_MESSAGE = 'WORKER_KEEP_ALIVE_MESSAGE'; - button.addEventListener('click', (_) => { - browser.runtime.reload(); - }); +/* + * As long as UI is open it will keep sending messages to service worker + * In service worker as this message is received + * if service worker is inactive it is reactivated and script re-loaded + * Time has been kept to 1000ms but can be reduced for even faster re-activation of service worker + */ +if (isManifestV3) { + setInterval(() => { + browser.runtime.sendMessage({ name: WORKER_KEEP_ALIVE_MESSAGE }); + }, WORKER_KEEP_ALIVE_INTERVAL); +} - log.error(err.stack); - throw err; - } +start().catch(log.error); +async function start() { // create platform global global.platform = new ExtensionPlatform(); // identify window type (popup, notification) const windowType = getEnvironmentType(); - // setup stream to background - const extensionPort = browser.runtime.connect({ name: windowType }); + let isUIInitialised = false; - const connectionStream = new PortStream(extensionPort); + // setup stream to background + let extensionPort = browser.runtime.connect({ name: windowType }); + let connectionStream = new PortStream(extensionPort); const activeTab = await queryCurrentActiveTab(windowType); @@ -59,24 +62,53 @@ async function start() { * In case of MV3 the issue of blank screen was very frequent, it is caused by UI initialising before background is ready to send state. * Code below ensures that UI is rendered only after background is ready. */ - if (isManifestV3()) { - extensionPort.onMessage.addListener((message) => { + if (isManifestV3) { + /* + * In case of MV3 the issue of blank screen was very frequent, it is caused by UI initialising before background is ready to send state. + * Code below ensures that UI is rendered only after CONNECTION_READY message is received thus background is ready. + * In case the UI is already rendered, only update the streams. + */ + const messageListener = (message) => { if (message?.name === 'CONNECTION_READY') { - initializeUiWithTab(activeTab); + if (isUIInitialised) { + updateUiStreams(); + } else { + initializeUiWithTab(activeTab); + } } - }); + }; + + // resetExtensionStreamAndListeners takes care to remove listeners from closed streams + // it also creates new streams and attach event listeners to them + const resetExtensionStreamAndListeners = () => { + extensionPort.onMessage.removeListener(messageListener); + extensionPort.onDisconnect.removeListener( + resetExtensionStreamAndListeners, + ); + // message below will try to activate service worker + // in MV3 is likely that reason of stream closing is service worker going in-active + browser.runtime.sendMessage({ name: WORKER_KEEP_ALIVE_MESSAGE }); + + extensionPort = browser.runtime.connect({ name: windowType }); + connectionStream = new PortStream(extensionPort); + extensionPort.onMessage.addListener(messageListener); + extensionPort.onDisconnect.addListener(resetExtensionStreamAndListeners); + }; + + extensionPort.onMessage.addListener(messageListener); + extensionPort.onDisconnect.addListener(resetExtensionStreamAndListeners); } else { initializeUiWithTab(activeTab); } function initializeUiWithTab(tab) { - const container = document.getElementById('app-content'); - initializeUi(tab, container, connectionStream, (err, store) => { + initializeUi(tab, connectionStream, (err, store) => { if (err) { // if there's an error, store will be = metamaskState - displayCriticalError(container, err, store); + displayCriticalError(err, store); return; } + isUIInitialised = true; const state = store.getState(); const { metamask: { completedOnboarding } = {} } = state; @@ -86,6 +118,18 @@ async function start() { } }); } + + // Function to update new backgroundConnection in the UI + function updateUiStreams() { + connectToAccountManager(connectionStream, (err, backgroundConnection) => { + if (err) { + displayCriticalError(err); + return; + } + + updateBackgroundConnection(backgroundConnection); + }); + } } async function queryCurrentActiveTab(windowType) { @@ -112,7 +156,7 @@ async function queryCurrentActiveTab(windowType) { }); } -function initializeUi(activeTab, container, connectionStream, cb) { +function initializeUi(activeTab, connectionStream, cb) { connectToAccountManager(connectionStream, (err, backgroundConnection) => { if (err) { cb(err, null); @@ -130,6 +174,21 @@ function initializeUi(activeTab, container, connectionStream, cb) { }); } +async function displayCriticalError(err, metamaskState) { + const html = await getErrorHtml(SUPPORT_LINK, metamaskState); + + container.innerHTML = html; + + const button = document.getElementById('critical-error-button'); + + button.addEventListener('click', (_) => { + browser.runtime.reload(); + }); + + log.error(err.stack); + throw err; +} + /** * Establishes a connection to the background and a Web3 provider * @@ -138,7 +197,8 @@ function initializeUi(activeTab, container, connectionStream, cb) { */ function connectToAccountManager(connectionStream, cb) { const mx = setupMultiplex(connectionStream); - setupControllerConnection(mx.createStream('controller'), cb); + const controllerConnectionStream = mx.createStream('controller'); + setupControllerConnection(controllerConnectionStream, cb); setupWeb3Connection(mx.createStream('provider')); } @@ -160,10 +220,10 @@ function setupWeb3Connection(connectionStream) { /** * Establishes a streamed connection to the background account manager * - * @param {PortDuplexStream} connectionStream - PortStream instance establishing a background connection + * @param {PortDuplexStream} controllerConnectionStream - PortStream instance establishing a background connection * @param {Function} cb - Called when the remote account manager connection is established */ -function setupControllerConnection(connectionStream, cb) { - const backgroundRPC = metaRPCClientFactory(connectionStream); +function setupControllerConnection(controllerConnectionStream, cb) { + const backgroundRPC = metaRPCClientFactory(controllerConnectionStream); cb(null, backgroundRPC); } diff --git a/app/trezor-usb-permissions.html b/app/trezor-usb-permissions.html index 16f28e5e1..8e35d19ca 100644 --- a/app/trezor-usb-permissions.html +++ b/app/trezor-usb-permissions.html @@ -30,4 +30,4 @@ - \ No newline at end of file + diff --git a/babel.config.js b/babel.config.js index 31e829dec..c7bbde0ba 100644 --- a/babel.config.js +++ b/babel.config.js @@ -4,24 +4,13 @@ module.exports = function (api) { parserOpts: { strictMode: true, }, + targets: { + browsers: ['chrome >= 66', 'firefox >= 68'], + }, presets: [ '@babel/preset-typescript', - [ - '@babel/preset-env', - { - targets: { - browsers: ['chrome >= 66', 'firefox >= 68'], - }, - }, - ], + '@babel/preset-env', '@babel/preset-react', ], - plugins: [ - '@babel/plugin-transform-runtime', - '@babel/plugin-proposal-class-properties', - '@babel/plugin-proposal-object-rest-spread', - '@babel/plugin-proposal-optional-chaining', - '@babel/plugin-proposal-nullish-coalescing-operator', - ], }; }; diff --git a/development/README.md b/development/README.md index d0c890813..c53c91fc0 100644 --- a/development/README.md +++ b/development/README.md @@ -46,7 +46,7 @@ Events triggered whilst using the extension will be displayed in Segment's Debug To opt in to MetaMetrics; - Unlock the extension -- Open the Account menu +- Open the Account menu - Click the `Settings` menu item - Click the `Security & Privacy` menu item - Toggle the `Participate in MetaMetrics` menu option to the `ON` position diff --git a/development/announcer.js b/development/announcer.js old mode 100644 new mode 100755 index a3fc459a9..2c23cf9f8 --- a/development/announcer.js +++ b/development/announcer.js @@ -1,3 +1,4 @@ +#!/usr/bin/env node const fs = require('fs'); const path = require('path'); const { version } = require('../package.json'); diff --git a/development/build/config.js b/development/build/config.js new file mode 100644 index 000000000..a907b64f5 --- /dev/null +++ b/development/build/config.js @@ -0,0 +1,101 @@ +const path = require('path'); +const { readFile } = require('fs/promises'); +const ini = require('ini'); +const { BuildType } = require('../lib/build-type'); + +/** + * Get configuration for non-production builds. + * + * @returns {object} The production configuration. + */ +async function getConfig() { + const configPath = path.resolve(__dirname, '..', '..', '.metamaskrc'); + let configContents = ''; + try { + configContents = await readFile(configPath, { + encoding: 'utf8', + }); + } catch (error) { + if (error.code !== 'ENOENT') { + throw error; + } + } + return { + COLLECTIBLES_V1: process.env.COLLECTIBLES_V1, + INFURA_PROJECT_ID: process.env.INFURA_PROJECT_ID, + ONBOARDING_V2: process.env.ONBOARDING_V2, + PHISHING_WARNING_PAGE_URL: process.env.PHISHING_WARNING_PAGE_URL, + PUBNUB_PUB_KEY: process.env.PUBNUB_PUB_KEY, + PUBNUB_SUB_KEY: process.env.PUBNUB_SUB_KEY, + SEGMENT_HOST: process.env.SEGMENT_HOST, + SEGMENT_WRITE_KEY: process.env.SEGMENT_WRITE_KEY, + SENTRY_DSN_DEV: + process.env.SENTRY_DSN_DEV ?? + 'https://f59f3dd640d2429d9d0e2445a87ea8e1@sentry.io/273496', + SIWE_V1: process.env.SIWE_V1, + SWAPS_USE_DEV_APIS: process.env.SWAPS_USE_DEV_APIS, + ...ini.parse(configContents), + }; +} + +/** + * Get configuration for production builds and perform validation. + * + * This function validates that all required variables are present, and that + * the production configuration file doesn't include any extraneous entries. + * + * @param {BuildType} buildType - The current build type (e.g. "main", "flask", + * etc.). + * @returns {object} The production configuration. + */ +async function getProductionConfig(buildType) { + const prodConfigPath = path.resolve(__dirname, '..', '..', '.metamaskprodrc'); + let prodConfigContents = ''; + try { + prodConfigContents = await readFile(prodConfigPath, { + encoding: 'utf8', + }); + } catch (error) { + if (error.code !== 'ENOENT') { + throw error; + } + } + const prodConfig = { + INFURA_BETA_PROJECT_ID: process.env.INFURA_BETA_PROJECT_ID, + INFURA_FLASK_PROJECT_ID: process.env.INFURA_FLASK_PROJECT_ID, + INFURA_PROD_PROJECT_ID: process.env.INFURA_PROD_PROJECT_ID, + PUBNUB_PUB_KEY: process.env.PUBNUB_PUB_KEY, + PUBNUB_SUB_KEY: process.env.PUBNUB_SUB_KEY, + SEGMENT_BETA_WRITE_KEY: process.env.SEGMENT_BETA_WRITE_KEY, + SEGMENT_FLASK_WRITE_KEY: process.env.SEGMENT_FLASK_WRITE_KEY, + SEGMENT_PROD_WRITE_KEY: process.env.SEGMENT_PROD_WRITE_KEY, + SENTRY_DSN: process.env.SENTRY_DSN, + ...ini.parse(prodConfigContents), + }; + + const requiredEnvironmentVariables = { + all: ['PUBNUB_PUB_KEY', 'PUBNUB_SUB_KEY', 'SENTRY_DSN'], + [BuildType.beta]: ['INFURA_BETA_PROJECT_ID', 'SEGMENT_BETA_WRITE_KEY'], + [BuildType.flask]: ['INFURA_FLASK_PROJECT_ID', 'SEGMENT_FLASK_WRITE_KEY'], + [BuildType.main]: ['INFURA_PROD_PROJECT_ID', 'SEGMENT_PROD_WRITE_KEY'], + }; + + for (const required of [ + ...requiredEnvironmentVariables.all, + ...requiredEnvironmentVariables[buildType], + ]) { + if (!prodConfig[required]) { + throw new Error(`Missing '${required}' environment variable`); + } + } + + const allValid = Object.values(requiredEnvironmentVariables).flat(); + for (const environmentVariable of Object.keys(prodConfig)) { + if (!allValid.includes(environmentVariable)) { + throw new Error(`Invalid environment variable: '${environmentVariable}'`); + } + } + return prodConfig; +} + +module.exports = { getConfig, getProductionConfig }; diff --git a/development/build/constants.js b/development/build/constants.js index 15b87e984..c91ce0a93 100644 --- a/development/build/constants.js +++ b/development/build/constants.js @@ -1,20 +1,51 @@ +/** + * The build target. This descrbes the overall purpose of the build. + * + * These constants also act as the high-level tasks for the build system (i.e. + * the usual tasks invoked directly via the CLI rather than internally). + */ +const BUILD_TARGETS = { + DEV: 'dev', + DIST: 'dist', + PROD: 'prod', + TEST: 'test', + TEST_DEV: 'testDev', +}; + +/** + * The build environment. This describes the environment this build was produced in. + */ +const ENVIRONMENT = { + DEVELOPMENT: 'development', + PRODUCTION: 'production', + OTHER: 'other', + PULL_REQUEST: 'pull-request', + RELEASE_CANDIDATE: 'release-candidate', + STAGING: 'staging', + TESTING: 'testing', +}; + const TASKS = { + ...BUILD_TARGETS, CLEAN: 'clean', - DEV: 'dev', LINT_SCSS: 'lint-scss', MANIFEST_DEV: 'manifest:dev', MANIFEST_PROD: 'manifest:prod', MANIFEST_TEST: 'manifest:test', MANIFEST_TEST_DEV: 'manifest:testDev', - PROD: 'prod', RELOAD: 'reload', - SCRIPTS_PROD: 'scripts:prod', SCRIPTS_CORE_DEV_STANDARD_ENTRY_POINTS: 'scripts:core:dev:standardEntryPoints', SCRIPTS_CORE_DEV_CONTENTSCRIPT: 'scripts:core:dev:contentscript', SCRIPTS_CORE_DEV_DISABLE_CONSOLE: 'scripts:core:dev:disable-console', SCRIPTS_CORE_DEV_SENTRY: 'scripts:core:dev:sentry', SCRIPTS_CORE_DEV_PHISHING_DETECT: 'scripts:core:dev:phishing-detect', + SCRIPTS_CORE_DIST_STANDARD_ENTRY_POINTS: + 'scripts:core:dist:standardEntryPoints', + SCRIPTS_CORE_DIST_CONTENTSCRIPT: 'scripts:core:dist:contentscript', + SCRIPTS_CORE_DIST_DISABLE_CONSOLE: 'scripts:core:dist:disable-console', + SCRIPTS_CORE_DIST_SENTRY: 'scripts:core:dist:sentry', + SCRIPTS_CORE_DIST_PHISHING_DETECT: 'scripts:core:dist:phishing-detect', SCRIPTS_CORE_PROD_STANDARD_ENTRY_POINTS: 'scripts:core:prod:standardEntryPoints', SCRIPTS_CORE_PROD_CONTENTSCRIPT: 'scripts:core:prod:contentscript', @@ -35,14 +66,13 @@ const TASKS = { SCRIPTS_CORE_TEST_DISABLE_CONSOLE: 'scripts:core:test:disable-console', SCRIPTS_CORE_TEST_SENTRY: 'scripts:core:test:sentry', SCRIPTS_CORE_TEST_PHISHING_DETECT: 'scripts:core:test:phishing-detect', + SCRIPTS_DIST: 'scripts:dist', STATIC_DEV: 'static:dev', STATIC_PROD: 'static:prod', STYLES: 'styles', STYLES_DEV: 'styles:dev', STYLES_PROD: 'styles:prod', - TEST: 'test', - TEST_DEV: 'testDev', ZIP: 'zip', }; -module.exports = { TASKS }; +module.exports = { BUILD_TARGETS, ENVIRONMENT, TASKS }; diff --git a/development/build/etc.js b/development/build/etc.js index a75cd650f..3da86409f 100644 --- a/development/build/etc.js +++ b/development/build/etc.js @@ -49,7 +49,10 @@ function createZipTask(platform, buildType, version) { gulp.src(`dist/${platform}/**`), // sort files and set `mtime` to epoch to ensure zip build is deterministic sort(), - gulpZip(`${path}.zip`, { modifiedTime: new Date(0) }), + // Modified time set to an arbitrary static date to ensure build the is reproducible. + // The date chosen is MetaMask's birthday. Originally we chose the Unix epoch, but this + // resulted in invalid dates on certain timezones/operating systems. + gulpZip(`${path}.zip`, { modifiedTime: new Date('2016-07-14T00:00:00') }), gulp.dest('builds'), ); }; diff --git a/development/build/index.js b/development/build/index.js index d9924f86b..628cbbbac 100755 --- a/development/build/index.js +++ b/development/build/index.js @@ -1,3 +1,4 @@ +#!/usr/bin/env node // // build task definitions // @@ -10,7 +11,7 @@ const { hideBin } = require('yargs/helpers'); const { sync: globby } = require('globby'); const { getVersion } = require('../lib/get-version'); const { BuildType } = require('../lib/build-type'); -const { TASKS } = require('./constants'); +const { TASKS, ENVIRONMENT } = require('./constants'); const { createTask, composeSeries, @@ -22,17 +23,14 @@ const createScriptTasks = require('./scripts'); const createStyleTasks = require('./styles'); const createStaticAssetTasks = require('./static'); const createEtcTasks = require('./etc'); -const { getBrowserVersionMap } = require('./utils'); +const { getBrowserVersionMap, getEnvironment } = require('./utils'); +const { getConfig, getProductionConfig } = require('./config'); +const { BUILD_TARGETS } = require('./constants'); // Packages required dynamically via browserify configuration in dependencies // Required for LavaMoat policy generation require('loose-envify'); require('globalthis'); -require('@babel/plugin-proposal-object-rest-spread'); -require('@babel/plugin-transform-runtime'); -require('@babel/plugin-proposal-class-properties'); -require('@babel/plugin-proposal-optional-chaining'); -require('@babel/plugin-proposal-nullish-coalescing-operator'); require('@babel/preset-env'); require('@babel/preset-react'); require('@babel/preset-typescript'); @@ -55,9 +53,12 @@ require('eslint-plugin-react'); require('eslint-plugin-react-hooks'); require('eslint-plugin-jest'); -defineAndRunBuildTasks(); +defineAndRunBuildTasks().catch((error) => { + console.error(error.stack || error); + process.exitCode = 1; +}); -function defineAndRunBuildTasks() { +async function defineAndRunBuildTasks() { const { applyLavaMoat, buildType, @@ -68,7 +69,7 @@ function defineAndRunBuildTasks() { shouldLintFenceFiles, skipStats, version, - } = parseArgv(); + } = await parseArgv(); const browserPlatforms = ['firefox', 'chrome', 'brave', 'opera']; @@ -140,6 +141,17 @@ function defineAndRunBuildTasks() { ), ); + // build production-like distributable build + createTask( + TASKS.DIST, + composeSeries( + clean, + styleTasks.prod, + composeParallel(scriptTasks.dist, staticTasks.prod, manifestTasks.prod), + zip, + ), + ); + // build for prod release createTask( TASKS.PROD, @@ -152,7 +164,7 @@ function defineAndRunBuildTasks() { ); // build just production scripts, for LavaMoat policy generation purposes - createTask(TASKS.SCRIPTS_PROD, scriptTasks.prod); + createTask(TASKS.SCRIPTS_DIST, scriptTasks.dist); // build for CI testing createTask( @@ -169,20 +181,22 @@ function defineAndRunBuildTasks() { createTask(TASKS.styles, styleTasks.prod); // Finally, start the build process by running the entry task. - runTask(entryTask, { skipStats }); + await runTask(entryTask, { skipStats }); } -function parseArgv() { +async function parseArgv() { const { argv } = yargs(hideBin(process.argv)) .usage('$0 [options]', 'Build the MetaMask extension.', (_yargs) => _yargs .positional('task', { description: `The task to run. There are a number of main tasks, each of which calls other tasks internally. The main tasks are: -prod: Create an optimized build for a production environment. - dev: Create an unoptimized, live-reloading build for local development. +dist: Create an optimized production-like for a non-production environment. + +prod: Create an optimized build for a production environment. + test: Create an optimized build for running e2e tests. testDev: Create an unoptimized, live-reloading build for debugging e2e tests.`, @@ -259,6 +273,18 @@ testDev: Create an unoptimized, live-reloading build for debugging e2e tests.`, const version = getVersion(buildType, buildVersion); + const highLevelTasks = Object.values(BUILD_TARGETS); + if (highLevelTasks.includes(task)) { + const environment = getEnvironment({ buildTarget: task }); + if (environment === ENVIRONMENT.PRODUCTION) { + // Output ignored, this is only called to ensure config is validated + await getProductionConfig(buildType); + } else { + // Output ignored, this is only called to ensure config is validated + await getConfig(); + } + } + return { applyLavaMoat, buildType, diff --git a/development/build/scripts.js b/development/build/scripts.js index 95833b6ed..86a324ad4 100644 --- a/development/build/scripts.js +++ b/development/build/scripts.js @@ -27,28 +27,16 @@ const terser = require('terser'); const bifyModuleGroups = require('bify-module-groups'); -const metamaskrc = require('rc')('metamask', { - INFURA_PROJECT_ID: process.env.INFURA_PROJECT_ID, - INFURA_BETA_PROJECT_ID: process.env.INFURA_BETA_PROJECT_ID, - INFURA_FLASK_PROJECT_ID: process.env.INFURA_FLASK_PROJECT_ID, - INFURA_PROD_PROJECT_ID: process.env.INFURA_PROD_PROJECT_ID, - ONBOARDING_V2: process.env.ONBOARDING_V2, - COLLECTIBLES_V1: process.env.COLLECTIBLES_V1, - PHISHING_WARNING_PAGE_URL: process.env.PHISHING_WARNING_PAGE_URL, - TOKEN_DETECTION_V2: process.env.TOKEN_DETECTION_V2, - ADD_POPULAR_NETWORKS: process.env.ADD_POPULAR_NETWORKS, - SEGMENT_HOST: process.env.SEGMENT_HOST, - SEGMENT_WRITE_KEY: process.env.SEGMENT_WRITE_KEY, - SEGMENT_BETA_WRITE_KEY: process.env.SEGMENT_BETA_WRITE_KEY, - SEGMENT_FLASK_WRITE_KEY: process.env.SEGMENT_FLASK_WRITE_KEY, - SEGMENT_PROD_WRITE_KEY: process.env.SEGMENT_PROD_WRITE_KEY, - SENTRY_DSN_DEV: - process.env.SENTRY_DSN_DEV || - 'https://f59f3dd640d2429d9d0e2445a87ea8e1@sentry.io/273496', -}); - -const { streamFlatMap } = require('../stream-flat-map.js'); +const { streamFlatMap } = require('../stream-flat-map'); const { BuildType } = require('../lib/build-type'); +const { BUILD_TARGETS, ENVIRONMENT } = require('./constants'); +const { getConfig, getProductionConfig } = require('./config'); +const { + isDevBuild, + isTestBuild, + getEnvironment, + logError, +} = require('./utils'); const { createTask, @@ -60,55 +48,28 @@ const { createRemoveFencedCodeTransform, } = require('./transforms/remove-fenced-code'); -/** - * The build environment. This describes the environment this build was produced in. - */ -const ENVIRONMENT = { - DEVELOPMENT: 'development', - PRODUCTION: 'production', - OTHER: 'other', - PULL_REQUEST: 'pull-request', - RELEASE_CANDIDATE: 'release-candidate', - STAGING: 'staging', - TESTING: 'testing', -}; - -/** - * Get a value from the configuration, and confirm that it is set. - * - * @param {string} key - The configuration key to retrieve. - * @returns {string} The config entry requested. - * @throws {Error} Throws if the requested key is missing. - */ -function getConfigValue(key) { - const value = metamaskrc[key]; - if (!value) { - throw new Error(`Missing config entry for '${key}'`); - } - return value; -} - /** * Get the appropriate Infura project ID. * * @param {object} options - The Infura project ID options. * @param {BuildType} options.buildType - The current build type. + * @param {object} options.config - The environment variable configuration. * @param {ENVIRONMENT[keyof ENVIRONMENT]} options.environment - The build environment. - * @param {boolean} options.testing - Whether the current build is a test build or not. + * @param {boolean} options.testing - Whether this is a test build or not. * @returns {string} The Infura project ID. */ -function getInfuraProjectId({ buildType, environment, testing }) { +function getInfuraProjectId({ buildType, config, environment, testing }) { if (testing) { return '00000000000000000000000000000000'; } else if (environment !== ENVIRONMENT.PRODUCTION) { // Skip validation because this is unset on PRs from forks. - return metamaskrc.INFURA_PROJECT_ID; + return config.INFURA_PROJECT_ID; } else if (buildType === BuildType.main) { - return getConfigValue('INFURA_PROD_PROJECT_ID'); + return config.INFURA_PROD_PROJECT_ID; } else if (buildType === BuildType.beta) { - return getConfigValue('INFURA_BETA_PROJECT_ID'); + return config.INFURA_BETA_PROJECT_ID; } else if (buildType === BuildType.flask) { - return getConfigValue('INFURA_FLASK_PROJECT_ID'); + return config.INFURA_FLASK_PROJECT_ID; } throw new Error(`Invalid build type: '${buildType}'`); } @@ -118,19 +79,20 @@ function getInfuraProjectId({ buildType, environment, testing }) { * * @param {object} options - The Segment write key options. * @param {BuildType} options.buildType - The current build type. + * @param {object} options.config - The environment variable configuration. * @param {keyof ENVIRONMENT} options.environment - The current build environment. * @returns {string} The Segment write key. */ -function getSegmentWriteKey({ buildType, environment }) { +function getSegmentWriteKey({ buildType, config, environment }) { if (environment !== ENVIRONMENT.PRODUCTION) { // Skip validation because this is unset on PRs from forks, and isn't necessary for development builds. - return metamaskrc.SEGMENT_WRITE_KEY; + return config.SEGMENT_WRITE_KEY; } else if (buildType === BuildType.main) { - return getConfigValue('SEGMENT_PROD_WRITE_KEY'); + return config.SEGMENT_PROD_WRITE_KEY; } else if (buildType === BuildType.beta) { - return getConfigValue('SEGMENT_BETA_WRITE_KEY'); + return config.SEGMENT_BETA_WRITE_KEY; } else if (buildType === BuildType.flask) { - return getConfigValue('SEGMENT_FLASK_WRITE_KEY'); + return config.SEGMENT_FLASK_WRITE_KEY; } throw new Error(`Invalid build type: '${buildType}'`); } @@ -139,11 +101,12 @@ function getSegmentWriteKey({ buildType, environment }) { * Get the URL for the phishing warning page, if it has been set. * * @param {object} options - The phishing warning page options. + * @param {object} options.config - The environment variable configuration. * @param {boolean} options.testing - Whether this is a test build or not. * @returns {string} The URL for the phishing warning page, or `undefined` if no URL is set. */ -function getPhishingWarningPageUrl({ testing }) { - let phishingWarningPageUrl = metamaskrc.PHISHING_WARNING_PAGE_URL; +function getPhishingWarningPageUrl({ config, testing }) { + let phishingWarningPageUrl = config.PHISHING_WARNING_PAGE_URL; if (!phishingWarningPageUrl) { phishingWarningPageUrl = testing @@ -183,6 +146,31 @@ const noopWriteStream = through.obj((_file, _fileEncoding, callback) => module.exports = createScriptTasks; +/** + * Create tasks for building JavaScript bundles and templates. One + * task is returned for each build target. These build target tasks are + * each composed of smaller tasks. + * + * @param {object} options - Build options. + * @param {boolean} options.applyLavaMoat - Whether the build should use + * LavaMoat at runtime or not. + * @param {string[]} options.browserPlatforms - A list of browser platforms to + * build bundles for. + * @param {BuildType} options.buildType - The current build type (e.g. "main", + * "flask", etc.). + * @param {string[] | null} options.ignoredFiles - A list of files to exclude + * from the current build. + * @param {boolean} options.isLavaMoat - Whether this build script is being run + * using LavaMoat or not. + * @param {object} options.livereload - The "gulp-livereload" server instance. + * @param {boolean} options.policyOnly - Whether to stop the build after + * generating the LavaMoat policy, skipping any writes to disk other than the + * LavaMoat policy itself. + * @param {boolean} options.shouldLintFenceFiles - Whether files with code + * fences should be linted after fences have been removed. + * @param {string} options.version - The current version of the extension. + * @returns {object} A set of tasks, one for each build target. + */ function createScriptTasks({ applyLavaMoat, browserPlatforms, @@ -190,45 +178,59 @@ function createScriptTasks({ ignoredFiles, isLavaMoat, livereload, - shouldLintFenceFiles, policyOnly, + shouldLintFenceFiles, version, }) { - // internal tasks - const core = { + // high level tasks + return { // dev tasks (live reload) - dev: createTasksForBuildJsExtension({ + dev: createTasksForScriptBundles({ + buildTarget: BUILD_TARGETS.DEV, taskPrefix: 'scripts:core:dev', - devMode: true, }), - testDev: createTasksForBuildJsExtension({ - taskPrefix: 'scripts:core:test-live', - devMode: true, - testing: true, + // production-like distributable build + dist: createTasksForScriptBundles({ + buildTarget: BUILD_TARGETS.DIST, + taskPrefix: 'scripts:core:dist', + }), + // production + prod: createTasksForScriptBundles({ + buildTarget: BUILD_TARGETS.PROD, + taskPrefix: 'scripts:core:prod', }), // built for CI tests - test: createTasksForBuildJsExtension({ + test: createTasksForScriptBundles({ + buildTarget: BUILD_TARGETS.TEST, taskPrefix: 'scripts:core:test', - testing: true, }), - // production - prod: createTasksForBuildJsExtension({ taskPrefix: 'scripts:core:prod' }), + // built for CI test debugging + testDev: createTasksForScriptBundles({ + buildTarget: BUILD_TARGETS.TEST_DEV, + taskPrefix: 'scripts:core:test-live', + }), }; - // high level tasks - - const { dev, test, testDev, prod } = core; - return { dev, test, testDev, prod }; - - function createTasksForBuildJsExtension({ taskPrefix, devMode, testing }) { + /** + * Define tasks for building the JavaScript modules used by the extension. + * This function returns a single task that builds JavaScript modules in + * parallel for a single type of build (e.g. dev, testing, production). + * + * @param {object} options - The build options. + * @param {BUILD_TARGETS} options.buildTarget - The build target that these + * JavaScript modules are intended for. + * @param {string} options.taskPrefix - The prefix to use for the name of + * each defined task. + */ + function createTasksForScriptBundles({ buildTarget, taskPrefix }) { const standardEntryPoints = ['background', 'ui', 'content-script']; const standardSubtask = createTask( `${taskPrefix}:standardEntryPoints`, createFactoredBuild({ applyLavaMoat, browserPlatforms, + buildTarget, buildType, - devMode, entryFiles: standardEntryPoints.map((label) => { if (label === 'content-script') { return './app/vendor/trezor/content-script.js'; @@ -238,7 +240,6 @@ function createScriptTasks({ ignoredFiles, policyOnly, shouldLintFenceFiles, - testing, version, }), ); @@ -247,24 +248,24 @@ function createScriptTasks({ // because inpage bundle result is included inside contentscript const contentscriptSubtask = createTask( `${taskPrefix}:contentscript`, - createTaskForBundleContentscript({ devMode, testing }), + createContentscriptBundle({ buildTarget }), ); // this can run whenever const disableConsoleSubtask = createTask( `${taskPrefix}:disable-console`, - createTaskForBundleDisableConsole({ devMode, testing }), + createDisableConsoleBundle({ buildTarget }), ); // this can run whenever const installSentrySubtask = createTask( `${taskPrefix}:sentry`, - createTaskForBundleSentry({ devMode, testing }), + createSentryBundle({ buildTarget }), ); // task for initiating browser livereload const initiateLiveReload = async () => { - if (devMode) { + if (isDevBuild(buildTarget)) { // trigger live reload when the bundles are updated // this is not ideal, but overcomes the limitations: // - run from the main process (not child process tasks) @@ -297,153 +298,214 @@ function createScriptTasks({ return composeParallel(initiateLiveReload, ...allSubtasks); } - function createTaskForBundleDisableConsole({ devMode, testing }) { + /** + * Create a bundle for the "disable-console" module. + * + * @param {object} options - The build options. + * @param {BUILD_TARGETS} options.buildTarget - The current build target. + * @returns {Function} A function that creates the bundle. + */ + function createDisableConsoleBundle({ buildTarget }) { const label = 'disable-console'; return createNormalBundle({ browserPlatforms, + buildTarget, buildType, destFilepath: `${label}.js`, - devMode, entryFilepath: `./app/scripts/${label}.js`, ignoredFiles, label, - testing, policyOnly, shouldLintFenceFiles, version, }); } - function createTaskForBundleSentry({ devMode, testing }) { + /** + * Create a bundle for the "sentry-install" module. + * + * @param {object} options - The build options. + * @param {BUILD_TARGETS} options.buildTarget - The current build target. + * @returns {Function} A function that creates the bundle. + */ + function createSentryBundle({ buildTarget }) { const label = 'sentry-install'; return createNormalBundle({ browserPlatforms, + buildTarget, buildType, destFilepath: `${label}.js`, - devMode, entryFilepath: `./app/scripts/${label}.js`, ignoredFiles, label, - testing, policyOnly, shouldLintFenceFiles, version, }); } - // the "contentscript" bundle contains the "inpage" bundle - function createTaskForBundleContentscript({ devMode, testing }) { + /** + * Create bundles for the "contentscript" and "inpage" modules. The inpage + * module is created first because it gets embedded in the contentscript + * module. + * + * @param {object} options - The build options. + * @param {BUILD_TARGETS} options.buildTarget - The current build target. + * @returns {Function} A function that creates the bundles. + */ + function createContentscriptBundle({ buildTarget }) { const inpage = 'inpage'; const contentscript = 'contentscript'; return composeSeries( createNormalBundle({ + buildTarget, buildType, browserPlatforms, destFilepath: `${inpage}.js`, - devMode, entryFilepath: `./app/scripts/${inpage}.js`, label: inpage, ignoredFiles, policyOnly, shouldLintFenceFiles, - testing, version, }), createNormalBundle({ + buildTarget, buildType, browserPlatforms, destFilepath: `${contentscript}.js`, - devMode, entryFilepath: `./app/scripts/${contentscript}.js`, label: contentscript, ignoredFiles, policyOnly, shouldLintFenceFiles, - testing, version, }), ); } } -const postProcessServiceWorker = ( - mv3BrowserPlatforms, - fileList, +/** + * Create the bundle for the app initialization module used in manifest v3 + * builds. + * + * This must be called after the "background" bundles have been created, so + * that the list of all background bundles can be injected into this bundle. + * + * @param {object} options - Build options. + * @param {boolean} options.applyLavaMoat - Whether the build should use + * LavaMoat at runtime or not. + * @param {string[]} options.browserPlatforms - A list of browser platforms to + * build bundles for. + * @param {BUILD_TARGETS} options.buildTarget - The current build target. + * @param {BuildType} options.buildType - The current build type (e.g. "main", + * "flask", etc.). + * @param {string[] | null} options.ignoredFiles - A list of files to exclude + * from the current build. + * @param {string[]} options.jsBundles - A list of JavaScript bundles to be + * injected into this bundle. + * @param {boolean} options.policyOnly - Whether to stop the build after + * generating the LavaMoat policy, skipping any writes to disk other than the + * LavaMoat policy itself. + * @param {boolean} options.shouldLintFenceFiles - Whether files with code + * fences should be linted after fences have been removed. + * @param {string} options.version - The current version of the extension. + * @returns {Function} A function that creates the set of bundles. + */ +async function createManifestV3AppInitializationBundle({ applyLavaMoat, -) => { - mv3BrowserPlatforms.forEach((browser) => { - const appInitFile = `./dist/${browser}/app-init.js`; - const fileContent = readFileSync('./app/scripts/app-init.js', 'utf8'); - const fileOutput = fileContent - .replace('/** FILE NAMES */', fileList) - .replace( - 'const applyLavaMoat = true;', - `const applyLavaMoat = ${applyLavaMoat};`, - ); - writeFileSync(appInitFile, fileOutput); - }); -}; - -// Function generates app-init.js for browsers chrome, brave and opera. -// It dynamically injects list of files generated in the build. -async function bundleMV3AppInitialiser({ - jsBundles, browserPlatforms, + buildTarget, buildType, - devMode, ignoredFiles, - testing, + jsBundles, policyOnly, shouldLintFenceFiles, - applyLavaMoat, + version, }) { const label = 'app-init'; // TODO: remove this filter for firefox once MV3 is supported in it const mv3BrowserPlatforms = browserPlatforms.filter( (platform) => platform !== 'firefox', ); - const fileList = jsBundles.reduce( - (result, file) => `${result}'${file}',\n `, - '', - ); + + for (const filename of jsBundles) { + if (filename.includes(',')) { + throw new Error( + `Invalid filename "${filename}", not allowed to contain comma.`, + ); + } + } + + const extraEnvironmentVariables = { + APPLY_LAVAMOAT: applyLavaMoat, + FILE_NAMES: jsBundles.join(','), + }; await createNormalBundle({ browserPlatforms: mv3BrowserPlatforms, + buildTarget, buildType, destFilepath: 'app-init.js', - devMode, entryFilepath: './app/scripts/app-init.js', + extraEnvironmentVariables, ignoredFiles, label, - testing, policyOnly, shouldLintFenceFiles, + version, })(); - postProcessServiceWorker(mv3BrowserPlatforms, fileList, applyLavaMoat); - - let prevChromeFileContent; - watch('./dist/chrome/app-init.js', () => { - const chromeFileContent = readFileSync('./dist/chrome/app-init.js', 'utf8'); - if (chromeFileContent !== prevChromeFileContent) { - prevChromeFileContent = chromeFileContent; - postProcessServiceWorker(mv3BrowserPlatforms, fileList, applyLavaMoat); - } - }); + // Code below is used to set statsMode to true when testing in MV3 + // This is used to capture module initialisation stats using lavamoat. + if (isTestBuild(buildTarget)) { + const content = readFileSync('./dist/chrome/runtime-lavamoat.js', 'utf8'); + const fileOutput = content.replace('statsMode = false', 'statsMode = true'); + writeFileSync('./dist/chrome/runtime-lavamoat.js', fileOutput); + } console.log(`Bundle end: service worker app-init.js`); } +/** + * Return a function that creates a set of factored bundles. + * + * For each entry point, a series of one or more bundles is created. These are + * split up roughly by size, to ensure no single bundle exceeds the maximum + * JavaScript file size imposed by Firefox. + * + * Modules that are common between all entry points are bundled separately, as + * a set of one or more "common" bundles. + * + * @param {object} options - Build options. + * @param {boolean} options.applyLavaMoat - Whether the build should use + * LavaMoat at runtime or not. + * @param {string[]} options.browserPlatforms - A list of browser platforms to + * build bundles for. + * @param {BUILD_TARGETS} options.buildTarget - The current build target. + * @param {BuildType} options.buildType - The current build type (e.g. "main", + * "flask", etc.). + * @param {string[]} options.entryFiles - A list of entry point file paths, + * relative to the repository root directory. + * @param {string[] | null} options.ignoredFiles - A list of files to exclude + * from the current build. + * @param {boolean} options.policyOnly - Whether to stop the build after + * generating the LavaMoat policy, skipping any writes to disk other than the + * LavaMoat policy itself. + * @param {boolean} options.shouldLintFenceFiles - Whether files with code + * fences should be linted after fences have been removed. + * @param {string} options.version - The current version of the extension. + * @returns {Function} A function that creates the set of bundles. + */ function createFactoredBuild({ applyLavaMoat, browserPlatforms, + buildTarget, buildType, - devMode, entryFiles, ignoredFiles, policyOnly, shouldLintFenceFiles, - testing, version, }) { return async function () { @@ -453,25 +515,23 @@ function createFactoredBuild({ const { bundlerOpts, events } = buildConfiguration; // devMode options - const reloadOnChange = Boolean(devMode); - const minify = Boolean(devMode) === false; + const reloadOnChange = isDevBuild(buildTarget); + const minify = !isDevBuild(buildTarget); - const envVars = getEnvironmentVariables({ + const envVars = await getEnvironmentVariables({ + buildTarget, buildType, - devMode, - testing, version, }); setupBundlerDefaults(buildConfiguration, { + buildTarget, buildType, - devMode, envVars, ignoredFiles, policyOnly, minify, reloadOnChange, shouldLintFenceFiles, - testing, }); // set bundle entries @@ -597,16 +657,16 @@ function createFactoredBuild({ ...commonSet.values(), ...groupSet.values(), ].map((label) => `./${label}.js`); - await bundleMV3AppInitialiser({ - jsBundles, + await createManifestV3AppInitializationBundle({ + applyLavaMoat, browserPlatforms, + buildTarget, buildType, - devMode, ignoredFiles, - testing, + jsBundles, policyOnly, shouldLintFenceFiles, - applyLavaMoat, + version, }); } break; @@ -630,23 +690,48 @@ function createFactoredBuild({ } }); - await bundleIt(buildConfiguration, { reloadOnChange }); + await createBundle(buildConfiguration, { reloadOnChange }); }; } +/** + * Return a function that creates a single JavaScript bundle. + * + * @param {object} options - Build options. + * @param {string[]} options.browserPlatforms - A list of browser platforms to + * build the bundle for. + * @param {BUILD_TARGETS} options.buildTarget - The current build target. + * @param {BuildType} options.buildType - The current build type (e.g. "main", + * "flask", etc.). + * @param {string} options.destFilepath - The file path the bundle should be + * written to. + * @param {string[]} options.entryFilepath - The entry point file path, + * relative to the repository root directory. + * @param {Record} options.extraEnvironmentVariables - Extra + * environment variables to inject just into this bundle. + * @param {string[] | null} options.ignoredFiles - A list of files to exclude + * from the current build. + * @param {string} options.label - A label used to describe this bundle in any + * diagnostic messages. + * @param {boolean} options.policyOnly - Whether to stop the build after + * generating the LavaMoat policy, skipping any writes to disk other than the + * LavaMoat policy itself. + * @param {boolean} options.shouldLintFenceFiles - Whether files with code + * fences should be linted after fences have been removed. + * @param {string} options.version - The current version of the extension. + * @returns {Function} A function that creates the bundle. + */ function createNormalBundle({ browserPlatforms, + buildTarget, buildType, destFilepath, - devMode, entryFilepath, - extraEntries = [], + extraEnvironmentVariables, ignoredFiles, label, policyOnly, - modulesToExpose, shouldLintFenceFiles, - testing, version, }) { return async function () { @@ -656,36 +741,30 @@ function createNormalBundle({ const { bundlerOpts, events } = buildConfiguration; // devMode options + const devMode = isDevBuild(buildTarget); const reloadOnChange = Boolean(devMode); const minify = Boolean(devMode) === false; - const envVars = getEnvironmentVariables({ - buildType, - devMode, - testing, - version, - }); + const envVars = { + ...(await getEnvironmentVariables({ + buildTarget, + buildType, + version, + })), + ...extraEnvironmentVariables, + }; setupBundlerDefaults(buildConfiguration, { buildType, - devMode, envVars, ignoredFiles, policyOnly, minify, reloadOnChange, shouldLintFenceFiles, - testing, }); // set bundle entries - bundlerOpts.entries = [...extraEntries]; - if (entryFilepath) { - bundlerOpts.entries.push(entryFilepath); - } - - if (modulesToExpose) { - bundlerOpts.require = bundlerOpts.require.concat(modulesToExpose); - } + bundlerOpts.entries = [entryFilepath]; // instrument pipeline events.on('configurePipeline', ({ pipeline }) => { @@ -701,7 +780,7 @@ function createNormalBundle({ }); }); - await bundleIt(buildConfiguration, { reloadOnChange }); + await createBundle(buildConfiguration, { reloadOnChange }); }; } @@ -723,15 +802,14 @@ function createBuildConfiguration() { function setupBundlerDefaults( buildConfiguration, { + buildTarget, buildType, - devMode, envVars, ignoredFiles, policyOnly, minify, reloadOnChange, shouldLintFenceFiles, - testing, }, ) { const { bundlerOpts } = buildConfiguration; @@ -740,7 +818,7 @@ function setupBundlerDefaults( Object.assign(bundlerOpts, { // Source transforms transform: [ - // Remove code that should be excluded from builds of the current type + // // Remove code that should be excluded from builds of the current type createRemoveFencedCodeTransform(buildType, shouldLintFenceFiles), // Transpile top-level code [ @@ -754,13 +832,13 @@ function setupBundlerDefaults( // Look for TypeScript files when walking the dependency tree extensions, // Use entryFilepath for moduleIds, easier to determine origin file - fullPaths: devMode, + fullPaths: isDevBuild(buildTarget) || isTestBuild(buildTarget), // For sourcemaps debug: true, }); - // Ensure react-devtools are not included in non-dev builds - if (!devMode || testing) { + // Ensure react-devtools is only included in dev builds + if (buildTarget !== BUILD_TARGETS.DEV) { bundlerOpts.manualIgnore.push('react-devtools'); bundlerOpts.manualIgnore.push('remote-redux-devtools'); } @@ -786,7 +864,7 @@ function setupBundlerDefaults( } // Setup source maps - setupSourcemaps(buildConfiguration, { devMode }); + setupSourcemaps(buildConfiguration, { buildTarget }); } } @@ -840,7 +918,7 @@ function setupMinification(buildConfiguration) { }); } -function setupSourcemaps(buildConfiguration, { devMode }) { +function setupSourcemaps(buildConfiguration, { buildTarget }) { const { events } = buildConfiguration; events.on('configurePipeline', ({ pipeline }) => { pipeline.get('sourcemaps:init').push(sourcemaps.init({ loadMaps: true })); @@ -849,14 +927,14 @@ function setupSourcemaps(buildConfiguration, { devMode }) { // Use inline source maps for development due to Chrome DevTools bug // https://bugs.chromium.org/p/chromium/issues/detail?id=931675 .push( - devMode + isDevBuild(buildTarget) ? sourcemaps.write() : sourcemaps.write('../sourcemaps', { addComment: false }), ); }); } -async function bundleIt(buildConfiguration, { reloadOnChange }) { +async function createBundle(buildConfiguration, { reloadOnChange }) { const { label, bundlerOpts, events } = buildConfiguration; const bundler = browserify(bundlerOpts); @@ -898,7 +976,7 @@ async function bundleIt(buildConfiguration, { reloadOnChange }) { if (!reloadOnChange) { bundleStream.on('error', (error) => { console.error('Bundling failed! See details below.'); - console.error(error.stack || error); + logError(error); process.exit(1); }); } @@ -916,55 +994,54 @@ async function bundleIt(buildConfiguration, { reloadOnChange }) { } } -function getEnvironmentVariables({ buildType, devMode, testing, version }) { - const environment = getEnvironment({ devMode, testing }); - if (environment === ENVIRONMENT.PRODUCTION && !process.env.SENTRY_DSN) { - throw new Error('Missing SENTRY_DSN environment variable'); - } +/** + * Get environment variables to inject in the current build. + * + * @param {object} options - Build options. + * @param {BUILD_TARGETS} options.buildTarget - The current build target. + * @param {BuildType} options.buildType - The current build type (e.g. "main", + * "flask", etc.). + * @param {string} options.version - The current version of the extension. + * @returns {object} A map of environment variables to inject. + */ +async function getEnvironmentVariables({ buildTarget, buildType, version }) { + const environment = getEnvironment({ buildTarget }); + const config = + environment === ENVIRONMENT.PRODUCTION + ? await getProductionConfig(buildType) + : await getConfig(); + + const devMode = isDevBuild(buildTarget); + const testing = isTestBuild(buildTarget); return { + COLLECTIBLES_V1: config.COLLECTIBLES_V1 === '1', + CONF: devMode ? config : {}, + IN_TEST: testing, + INFURA_PROJECT_ID: getInfuraProjectId({ + buildType, + config, + environment, + testing, + }), METAMASK_DEBUG: devMode, METAMASK_ENVIRONMENT: environment, METAMASK_VERSION: version, METAMASK_BUILD_TYPE: buildType, NODE_ENV: devMode ? ENVIRONMENT.DEVELOPMENT : ENVIRONMENT.PRODUCTION, - IN_TEST: testing, - PHISHING_WARNING_PAGE_URL: getPhishingWarningPageUrl({ testing }), - PUBNUB_SUB_KEY: process.env.PUBNUB_SUB_KEY || '', - PUBNUB_PUB_KEY: process.env.PUBNUB_PUB_KEY || '', - CONF: devMode ? metamaskrc : {}, - SENTRY_DSN: process.env.SENTRY_DSN, - SENTRY_DSN_DEV: metamaskrc.SENTRY_DSN_DEV, - INFURA_PROJECT_ID: getInfuraProjectId({ buildType, environment, testing }), - SEGMENT_HOST: metamaskrc.SEGMENT_HOST, - SEGMENT_WRITE_KEY: getSegmentWriteKey({ buildType, environment }), - SWAPS_USE_DEV_APIS: process.env.SWAPS_USE_DEV_APIS === '1', - ONBOARDING_V2: metamaskrc.ONBOARDING_V2 === '1', - COLLECTIBLES_V1: metamaskrc.COLLECTIBLES_V1 === '1', - TOKEN_DETECTION_V2: metamaskrc.TOKEN_DETECTION_V2 === '1', - ADD_POPULAR_NETWORKS: metamaskrc.ADD_POPULAR_NETWORKS === '1', + ONBOARDING_V2: config.ONBOARDING_V2 === '1', + PHISHING_WARNING_PAGE_URL: getPhishingWarningPageUrl({ config, testing }), + PUBNUB_PUB_KEY: config.PUBNUB_PUB_KEY || '', + PUBNUB_SUB_KEY: config.PUBNUB_SUB_KEY || '', + SEGMENT_HOST: config.SEGMENT_HOST, + SEGMENT_WRITE_KEY: getSegmentWriteKey({ buildType, config, environment }), + SENTRY_DSN: config.SENTRY_DSN, + SENTRY_DSN_DEV: config.SENTRY_DSN_DEV, + SIWE_V1: config.SIWE_V1 === '1', + SWAPS_USE_DEV_APIS: config.SWAPS_USE_DEV_APIS === '1', + TOKEN_ALLOWANCE_IMPROVEMENTS: config.TOKEN_ALLOWANCE_IMPROVEMENTS === '1', }; } -function getEnvironment({ devMode, testing }) { - // get environment slug - if (devMode) { - return ENVIRONMENT.DEVELOPMENT; - } else if (testing) { - return ENVIRONMENT.TESTING; - } else if (process.env.CIRCLE_BRANCH === 'master') { - return ENVIRONMENT.PRODUCTION; - } else if ( - /^Version-v(\d+)[.](\d+)[.](\d+)/u.test(process.env.CIRCLE_BRANCH) - ) { - return ENVIRONMENT.RELEASE_CANDIDATE; - } else if (process.env.CIRCLE_BRANCH === 'develop') { - return ENVIRONMENT.STAGING; - } else if (process.env.CIRCLE_PULL_REQUEST) { - return ENVIRONMENT.PULL_REQUEST; - } - return ENVIRONMENT.OTHER; -} - function renderHtmlFile({ htmlName, groupSet, diff --git a/development/build/styles.js b/development/build/styles.js index 926609dff..47c5e5c66 100644 --- a/development/build/styles.js +++ b/development/build/styles.js @@ -73,7 +73,7 @@ async function buildScssPipeline(src, dest, devMode, rtl) { // use our own compiler which runs sass in its own process // in order to not pollute the intrinsics // eslint-disable-next-line node/global-require - sass.compiler = require('./sass-compiler.js'); + sass.compiler = require('./sass-compiler'); } await pump( ...[ diff --git a/development/build/task.js b/development/build/task.js index 26df8bf85..328f65e64 100644 --- a/development/build/task.js +++ b/development/build/task.js @@ -15,6 +15,7 @@ module.exports = { }; const { setupTaskDisplay } = require('./display'); +const { logError } = require('./utils'); async function runTask(taskName, { skipStats } = {}) { if (!(taskName in tasks)) { @@ -30,7 +31,7 @@ async function runTask(taskName, { skipStats } = {}) { console.error( `MetaMask build: Encountered an error while running task "${taskName}".`, ); - console.error(err); + logError(err); process.exit(1); } taskEvents.emit('complete'); diff --git a/development/build/transforms/remove-fenced-code.js b/development/build/transforms/remove-fenced-code.js index 90d49972e..6a95adf17 100644 --- a/development/build/transforms/remove-fenced-code.js +++ b/development/build/transforms/remove-fenced-code.js @@ -320,9 +320,8 @@ function removeFencedCode(filePath, typeOfCurrentBuild, fileContent) { let currentCommand; for (let i = 0; i < parsedDirectives.length; i++) { - const { line, indices, terminus, command, parameters } = parsedDirectives[ - i - ]; + const { line, indices, terminus, command, parameters } = + parsedDirectives[i]; if (i % 2 === 0) { if (terminus !== DirectiveTerminuses.BEGIN) { throw new Error( @@ -368,9 +367,8 @@ function removeFencedCode(filePath, typeOfCurrentBuild, fileContent) { } // Forbid empty fences - const { line: previousLine, indices: previousIndices } = parsedDirectives[ - i - 1 - ]; + const { line: previousLine, indices: previousIndices } = + parsedDirectives[i - 1]; if (fileContent.substring(previousIndices[1], indices[0]).trim() === '') { throw new Error( `Empty fence found in file "${filePath}":\n${previousLine}\n${line}\n`, diff --git a/development/build/transforms/remove-fenced-code.test.js b/development/build/transforms/remove-fenced-code.test.js index 3be3e401a..d185ee6f5 100644 --- a/development/build/transforms/remove-fenced-code.test.js +++ b/development/build/transforms/remove-fenced-code.test.js @@ -289,9 +289,8 @@ describe('build/transforms/remove-fenced-code', () => { ), ).toStrictEqual([ignoredLine, true]); - const modifiedInputWithoutFences = testData.validInputs.withoutFences.concat( - ignoredLine, - ); + const modifiedInputWithoutFences = + testData.validInputs.withoutFences.concat(ignoredLine); // These inputs will not be transformed expect( diff --git a/development/build/transforms/utils.js b/development/build/transforms/utils.js index fb7f49c32..0f8172cd3 100644 --- a/development/build/transforms/utils.js +++ b/development/build/transforms/utils.js @@ -1,5 +1,5 @@ const { ESLint } = require('eslint'); -const eslintrc = require('../../../.eslintrc.js'); +const eslintrc = require('../../../.eslintrc'); eslintrc.overrides.forEach((override) => { const rules = override.rules ?? {}; diff --git a/development/build/utils.js b/development/build/utils.js index 9ca4f5c17..f783c6d40 100644 --- a/development/build/utils.js +++ b/development/build/utils.js @@ -1,5 +1,30 @@ const semver = require('semver'); const { BuildType } = require('../lib/build-type'); +const { BUILD_TARGETS, ENVIRONMENT } = require('./constants'); + +/** + * Returns whether the current build is a development build or not. + * + * @param {BUILD_TARGETS} buildTarget - The current build target. + * @returns Whether the current build is a development build. + */ +function isDevBuild(buildTarget) { + return ( + buildTarget === BUILD_TARGETS.DEV || buildTarget === BUILD_TARGETS.TEST_DEV + ); +} + +/** + * Returns whether the current build is an e2e test build or not. + * + * @param {BUILD_TARGETS} buildTarget - The current build target. + * @returns Whether the current build is an e2e test build. + */ +function isTestBuild(buildTarget) { + return ( + buildTarget === BUILD_TARGETS.TEST || buildTarget === BUILD_TARGETS.TEST_DEV + ); +} /** * Map the current version to a format that is compatible with each browser. @@ -51,6 +76,51 @@ function getBrowserVersionMap(platforms, version) { }, {}); } +/** + * Get the environment of the current build. + * + * @param {object} options - Build options. + * @param {BUILD_TARGETS} options.buildTarget - The target of the current build. + * @returns {ENVIRONMENT} The current build environment. + */ +function getEnvironment({ buildTarget }) { + // get environment slug + if (buildTarget === BUILD_TARGETS.PROD) { + return ENVIRONMENT.PRODUCTION; + } else if (isDevBuild(buildTarget)) { + return ENVIRONMENT.DEVELOPMENT; + } else if (isTestBuild(buildTarget)) { + return ENVIRONMENT.TESTING; + } else if ( + /^Version-v(\d+)[.](\d+)[.](\d+)/u.test(process.env.CIRCLE_BRANCH) + ) { + return ENVIRONMENT.RELEASE_CANDIDATE; + } else if (process.env.CIRCLE_BRANCH === 'develop') { + return ENVIRONMENT.STAGING; + } else if (process.env.CIRCLE_PULL_REQUEST) { + return ENVIRONMENT.PULL_REQUEST; + } + return ENVIRONMENT.OTHER; +} + +/** + * Log an error to the console. + * + * This function includes a workaround for a SES bug that results in errors + * being printed to the console as `{}`. The workaround is to print the stack + * instead, which does work correctly. + * + * @see {@link https://github.com/endojs/endo/issues/944} + * @param {Error} error - The error to print + */ +function logError(error) { + console.error(error.stack || error); +} + module.exports = { getBrowserVersionMap, + getEnvironment, + isDevBuild, + isTestBuild, + logError, }; diff --git a/development/charts/flamegraph/chart/index.html b/development/charts/flamegraph/chart/index.html new file mode 100644 index 000000000..7afe9f9d0 --- /dev/null +++ b/development/charts/flamegraph/chart/index.html @@ -0,0 +1,170 @@ + + + + + + + + + + + + + Performance Measurements + + + + + +
+
+ +

d3-flame-graph

+
+
+
+
+
+ + + + + + + + + + + diff --git a/development/charts/flamegraph/lib/d3-flamegraph-tooltip.js b/development/charts/flamegraph/lib/d3-flamegraph-tooltip.js new file mode 100644 index 000000000..cc042a0f2 --- /dev/null +++ b/development/charts/flamegraph/lib/d3-flamegraph-tooltip.js @@ -0,0 +1,3117 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["flamegraph"] = factory(); + else + root["flamegraph"] = root["flamegraph"] || {}, root["flamegraph"]["tooltip"] = factory(); +})(self, function() { +return /******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// ESM COMPAT FLAG +__webpack_require__.r(__webpack_exports__); + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "defaultFlamegraphTooltip": () => (/* binding */ defaultFlamegraphTooltip) +}); + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selector.js +function none() {} + +/* harmony default export */ function selector(selector) { + return selector == null ? none : function() { + return this.querySelector(selector); + }; +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/select.js + + + +/* harmony default export */ function selection_select(select) { + if (typeof select !== "function") select = selector(select); + + for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { + if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { + if ("__data__" in node) subnode.__data__ = node.__data__; + subgroup[i] = subnode; + } + } + } + + return new Selection(subgroups, this._parents); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/array.js +// Given something array like (or null), returns something that is strictly an +// array. This is used to ensure that array-like objects passed to d3.selectAll +// or selection.selectAll are converted into proper arrays when creating a +// selection; we don’t ever want to create a selection backed by a live +// HTMLCollection or NodeList. However, note that selection.selectAll will use a +// static NodeList as a group, since it safely derived from querySelectorAll. +function array(x) { + return x == null ? [] : Array.isArray(x) ? x : Array.from(x); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selectorAll.js +function empty() { + return []; +} + +/* harmony default export */ function selectorAll(selector) { + return selector == null ? empty : function() { + return this.querySelectorAll(selector); + }; +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/selectAll.js + + + + +function arrayAll(select) { + return function() { + return array(select.apply(this, arguments)); + }; +} + +/* harmony default export */ function selectAll(select) { + if (typeof select === "function") select = arrayAll(select); + else select = selectorAll(select); + + for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { + if (node = group[i]) { + subgroups.push(select.call(node, node.__data__, i, group)); + parents.push(node); + } + } + } + + return new Selection(subgroups, parents); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/matcher.js +/* harmony default export */ function matcher(selector) { + return function() { + return this.matches(selector); + }; +} + +function childMatcher(selector) { + return function(node) { + return node.matches(selector); + }; +} + + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/selectChild.js + + +var find = Array.prototype.find; + +function childFind(match) { + return function() { + return find.call(this.children, match); + }; +} + +function childFirst() { + return this.firstElementChild; +} + +/* harmony default export */ function selectChild(match) { + return this.select(match == null ? childFirst + : childFind(typeof match === "function" ? match : childMatcher(match))); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/selectChildren.js + + +var filter = Array.prototype.filter; + +function children() { + return Array.from(this.children); +} + +function childrenFilter(match) { + return function() { + return filter.call(this.children, match); + }; +} + +/* harmony default export */ function selectChildren(match) { + return this.selectAll(match == null ? children + : childrenFilter(typeof match === "function" ? match : childMatcher(match))); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/filter.js + + + +/* harmony default export */ function selection_filter(match) { + if (typeof match !== "function") match = matcher(match); + + for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { + if ((node = group[i]) && match.call(node, node.__data__, i, group)) { + subgroup.push(node); + } + } + } + + return new Selection(subgroups, this._parents); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/sparse.js +/* harmony default export */ function sparse(update) { + return new Array(update.length); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/enter.js + + + +/* harmony default export */ function enter() { + return new Selection(this._enter || this._groups.map(sparse), this._parents); +} + +function EnterNode(parent, datum) { + this.ownerDocument = parent.ownerDocument; + this.namespaceURI = parent.namespaceURI; + this._next = null; + this._parent = parent; + this.__data__ = datum; +} + +EnterNode.prototype = { + constructor: EnterNode, + appendChild: function(child) { return this._parent.insertBefore(child, this._next); }, + insertBefore: function(child, next) { return this._parent.insertBefore(child, next); }, + querySelector: function(selector) { return this._parent.querySelector(selector); }, + querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); } +}; + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/constant.js +/* harmony default export */ function src_constant(x) { + return function() { + return x; + }; +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/data.js + + + + +function bindIndex(parent, group, enter, update, exit, data) { + var i = 0, + node, + groupLength = group.length, + dataLength = data.length; + + // Put any non-null nodes that fit into update. + // Put any null nodes into enter. + // Put any remaining data into enter. + for (; i < dataLength; ++i) { + if (node = group[i]) { + node.__data__ = data[i]; + update[i] = node; + } else { + enter[i] = new EnterNode(parent, data[i]); + } + } + + // Put any non-null nodes that don’t fit into exit. + for (; i < groupLength; ++i) { + if (node = group[i]) { + exit[i] = node; + } + } +} + +function bindKey(parent, group, enter, update, exit, data, key) { + var i, + node, + nodeByKeyValue = new Map, + groupLength = group.length, + dataLength = data.length, + keyValues = new Array(groupLength), + keyValue; + + // Compute the key for each node. + // If multiple nodes have the same key, the duplicates are added to exit. + for (i = 0; i < groupLength; ++i) { + if (node = group[i]) { + keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + ""; + if (nodeByKeyValue.has(keyValue)) { + exit[i] = node; + } else { + nodeByKeyValue.set(keyValue, node); + } + } + } + + // Compute the key for each datum. + // If there a node associated with this key, join and add it to update. + // If there is not (or the key is a duplicate), add it to enter. + for (i = 0; i < dataLength; ++i) { + keyValue = key.call(parent, data[i], i, data) + ""; + if (node = nodeByKeyValue.get(keyValue)) { + update[i] = node; + node.__data__ = data[i]; + nodeByKeyValue.delete(keyValue); + } else { + enter[i] = new EnterNode(parent, data[i]); + } + } + + // Add any remaining nodes that were not bound to data to exit. + for (i = 0; i < groupLength; ++i) { + if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) { + exit[i] = node; + } + } +} + +function datum(node) { + return node.__data__; +} + +/* harmony default export */ function data(value, key) { + if (!arguments.length) return Array.from(this, datum); + + var bind = key ? bindKey : bindIndex, + parents = this._parents, + groups = this._groups; + + if (typeof value !== "function") value = src_constant(value); + + for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) { + var parent = parents[j], + group = groups[j], + groupLength = group.length, + data = arraylike(value.call(parent, parent && parent.__data__, j, parents)), + dataLength = data.length, + enterGroup = enter[j] = new Array(dataLength), + updateGroup = update[j] = new Array(dataLength), + exitGroup = exit[j] = new Array(groupLength); + + bind(parent, group, enterGroup, updateGroup, exitGroup, data, key); + + // Now connect the enter nodes to their following update node, such that + // appendChild can insert the materialized enter node before this node, + // rather than at the end of the parent node. + for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) { + if (previous = enterGroup[i0]) { + if (i0 >= i1) i1 = i0 + 1; + while (!(next = updateGroup[i1]) && ++i1 < dataLength); + previous._next = next || null; + } + } + } + + update = new Selection(update, parents); + update._enter = enter; + update._exit = exit; + return update; +} + +// Given some data, this returns an array-like view of it: an object that +// exposes a length property and allows numeric indexing. Note that unlike +// selectAll, this isn’t worried about “live” collections because the resulting +// array will only be used briefly while data is being bound. (It is possible to +// cause the data to change while iterating by using a key function, but please +// don’t; we’d rather avoid a gratuitous copy.) +function arraylike(data) { + return typeof data === "object" && "length" in data + ? data // Array, TypedArray, NodeList, array-like + : Array.from(data); // Map, Set, iterable, string, or anything else +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/exit.js + + + +/* harmony default export */ function exit() { + return new Selection(this._exit || this._groups.map(sparse), this._parents); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/join.js +/* harmony default export */ function join(onenter, onupdate, onexit) { + var enter = this.enter(), update = this, exit = this.exit(); + if (typeof onenter === "function") { + enter = onenter(enter); + if (enter) enter = enter.selection(); + } else { + enter = enter.append(onenter + ""); + } + if (onupdate != null) { + update = onupdate(update); + if (update) update = update.selection(); + } + if (onexit == null) exit.remove(); else onexit(exit); + return enter && update ? enter.merge(update).order() : update; +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/merge.js + + +/* harmony default export */ function merge(context) { + var selection = context.selection ? context.selection() : context; + + for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { + for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { + if (node = group0[i] || group1[i]) { + merge[i] = node; + } + } + } + + for (; j < m0; ++j) { + merges[j] = groups0[j]; + } + + return new Selection(merges, this._parents); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/order.js +/* harmony default export */ function order() { + + for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) { + for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) { + if (node = group[i]) { + if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next); + next = node; + } + } + } + + return this; +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/sort.js + + +/* harmony default export */ function sort(compare) { + if (!compare) compare = ascending; + + function compareNode(a, b) { + return a && b ? compare(a.__data__, b.__data__) : !a - !b; + } + + for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) { + if (node = group[i]) { + sortgroup[i] = node; + } + } + sortgroup.sort(compareNode); + } + + return new Selection(sortgroups, this._parents).order(); +} + +function ascending(a, b) { + return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/call.js +/* harmony default export */ function call() { + var callback = arguments[0]; + arguments[0] = this; + callback.apply(null, arguments); + return this; +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/nodes.js +/* harmony default export */ function nodes() { + return Array.from(this); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/node.js +/* harmony default export */ function node() { + + for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { + for (var group = groups[j], i = 0, n = group.length; i < n; ++i) { + var node = group[i]; + if (node) return node; + } + } + + return null; +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/size.js +/* harmony default export */ function size() { + let size = 0; + for (const node of this) ++size; // eslint-disable-line no-unused-vars + return size; +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/empty.js +/* harmony default export */ function selection_empty() { + return !this.node(); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/each.js +/* harmony default export */ function each(callback) { + + for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { + for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { + if (node = group[i]) callback.call(node, node.__data__, i, group); + } + } + + return this; +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/namespaces.js +var xhtml = "http://www.w3.org/1999/xhtml"; + +/* harmony default export */ const namespaces = ({ + svg: "http://www.w3.org/2000/svg", + xhtml: xhtml, + xlink: "http://www.w3.org/1999/xlink", + xml: "http://www.w3.org/XML/1998/namespace", + xmlns: "http://www.w3.org/2000/xmlns/" +}); + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/namespace.js + + +/* harmony default export */ function namespace(name) { + var prefix = name += "", i = prefix.indexOf(":"); + if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1); + return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/attr.js + + +function attrRemove(name) { + return function() { + this.removeAttribute(name); + }; +} + +function attrRemoveNS(fullname) { + return function() { + this.removeAttributeNS(fullname.space, fullname.local); + }; +} + +function attrConstant(name, value) { + return function() { + this.setAttribute(name, value); + }; +} + +function attrConstantNS(fullname, value) { + return function() { + this.setAttributeNS(fullname.space, fullname.local, value); + }; +} + +function attrFunction(name, value) { + return function() { + var v = value.apply(this, arguments); + if (v == null) this.removeAttribute(name); + else this.setAttribute(name, v); + }; +} + +function attrFunctionNS(fullname, value) { + return function() { + var v = value.apply(this, arguments); + if (v == null) this.removeAttributeNS(fullname.space, fullname.local); + else this.setAttributeNS(fullname.space, fullname.local, v); + }; +} + +/* harmony default export */ function attr(name, value) { + var fullname = namespace(name); + + if (arguments.length < 2) { + var node = this.node(); + return fullname.local + ? node.getAttributeNS(fullname.space, fullname.local) + : node.getAttribute(fullname); + } + + return this.each((value == null + ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === "function" + ? (fullname.local ? attrFunctionNS : attrFunction) + : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value)); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/window.js +/* harmony default export */ function src_window(node) { + return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node + || (node.document && node) // node is a Window + || node.defaultView; // node is a Document +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/style.js + + +function styleRemove(name) { + return function() { + this.style.removeProperty(name); + }; +} + +function styleConstant(name, value, priority) { + return function() { + this.style.setProperty(name, value, priority); + }; +} + +function styleFunction(name, value, priority) { + return function() { + var v = value.apply(this, arguments); + if (v == null) this.style.removeProperty(name); + else this.style.setProperty(name, v, priority); + }; +} + +/* harmony default export */ function style(name, value, priority) { + return arguments.length > 1 + ? this.each((value == null + ? styleRemove : typeof value === "function" + ? styleFunction + : styleConstant)(name, value, priority == null ? "" : priority)) + : styleValue(this.node(), name); +} + +function styleValue(node, name) { + return node.style.getPropertyValue(name) + || src_window(node).getComputedStyle(node, null).getPropertyValue(name); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/property.js +function propertyRemove(name) { + return function() { + delete this[name]; + }; +} + +function propertyConstant(name, value) { + return function() { + this[name] = value; + }; +} + +function propertyFunction(name, value) { + return function() { + var v = value.apply(this, arguments); + if (v == null) delete this[name]; + else this[name] = v; + }; +} + +/* harmony default export */ function property(name, value) { + return arguments.length > 1 + ? this.each((value == null + ? propertyRemove : typeof value === "function" + ? propertyFunction + : propertyConstant)(name, value)) + : this.node()[name]; +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/classed.js +function classArray(string) { + return string.trim().split(/^|\s+/); +} + +function classList(node) { + return node.classList || new ClassList(node); +} + +function ClassList(node) { + this._node = node; + this._names = classArray(node.getAttribute("class") || ""); +} + +ClassList.prototype = { + add: function(name) { + var i = this._names.indexOf(name); + if (i < 0) { + this._names.push(name); + this._node.setAttribute("class", this._names.join(" ")); + } + }, + remove: function(name) { + var i = this._names.indexOf(name); + if (i >= 0) { + this._names.splice(i, 1); + this._node.setAttribute("class", this._names.join(" ")); + } + }, + contains: function(name) { + return this._names.indexOf(name) >= 0; + } +}; + +function classedAdd(node, names) { + var list = classList(node), i = -1, n = names.length; + while (++i < n) list.add(names[i]); +} + +function classedRemove(node, names) { + var list = classList(node), i = -1, n = names.length; + while (++i < n) list.remove(names[i]); +} + +function classedTrue(names) { + return function() { + classedAdd(this, names); + }; +} + +function classedFalse(names) { + return function() { + classedRemove(this, names); + }; +} + +function classedFunction(names, value) { + return function() { + (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names); + }; +} + +/* harmony default export */ function classed(name, value) { + var names = classArray(name + ""); + + if (arguments.length < 2) { + var list = classList(this.node()), i = -1, n = names.length; + while (++i < n) if (!list.contains(names[i])) return false; + return true; + } + + return this.each((typeof value === "function" + ? classedFunction : value + ? classedTrue + : classedFalse)(names, value)); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/text.js +function textRemove() { + this.textContent = ""; +} + +function textConstant(value) { + return function() { + this.textContent = value; + }; +} + +function textFunction(value) { + return function() { + var v = value.apply(this, arguments); + this.textContent = v == null ? "" : v; + }; +} + +/* harmony default export */ function selection_text(value) { + return arguments.length + ? this.each(value == null + ? textRemove : (typeof value === "function" + ? textFunction + : textConstant)(value)) + : this.node().textContent; +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/html.js +function htmlRemove() { + this.innerHTML = ""; +} + +function htmlConstant(value) { + return function() { + this.innerHTML = value; + }; +} + +function htmlFunction(value) { + return function() { + var v = value.apply(this, arguments); + this.innerHTML = v == null ? "" : v; + }; +} + +/* harmony default export */ function html(value) { + return arguments.length + ? this.each(value == null + ? htmlRemove : (typeof value === "function" + ? htmlFunction + : htmlConstant)(value)) + : this.node().innerHTML; +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/raise.js +function raise() { + if (this.nextSibling) this.parentNode.appendChild(this); +} + +/* harmony default export */ function selection_raise() { + return this.each(raise); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/lower.js +function lower() { + if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild); +} + +/* harmony default export */ function selection_lower() { + return this.each(lower); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/creator.js + + + +function creatorInherit(name) { + return function() { + var document = this.ownerDocument, + uri = this.namespaceURI; + return uri === xhtml && document.documentElement.namespaceURI === xhtml + ? document.createElement(name) + : document.createElementNS(uri, name); + }; +} + +function creatorFixed(fullname) { + return function() { + return this.ownerDocument.createElementNS(fullname.space, fullname.local); + }; +} + +/* harmony default export */ function creator(name) { + var fullname = namespace(name); + return (fullname.local + ? creatorFixed + : creatorInherit)(fullname); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/append.js + + +/* harmony default export */ function append(name) { + var create = typeof name === "function" ? name : creator(name); + return this.select(function() { + return this.appendChild(create.apply(this, arguments)); + }); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/insert.js + + + +function constantNull() { + return null; +} + +/* harmony default export */ function insert(name, before) { + var create = typeof name === "function" ? name : creator(name), + select = before == null ? constantNull : typeof before === "function" ? before : selector(before); + return this.select(function() { + return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null); + }); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/remove.js +function remove() { + var parent = this.parentNode; + if (parent) parent.removeChild(this); +} + +/* harmony default export */ function selection_remove() { + return this.each(remove); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/clone.js +function selection_cloneShallow() { + var clone = this.cloneNode(false), parent = this.parentNode; + return parent ? parent.insertBefore(clone, this.nextSibling) : clone; +} + +function selection_cloneDeep() { + var clone = this.cloneNode(true), parent = this.parentNode; + return parent ? parent.insertBefore(clone, this.nextSibling) : clone; +} + +/* harmony default export */ function clone(deep) { + return this.select(deep ? selection_cloneDeep : selection_cloneShallow); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/datum.js +/* harmony default export */ function selection_datum(value) { + return arguments.length + ? this.property("__data__", value) + : this.node().__data__; +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/on.js +function contextListener(listener) { + return function(event) { + listener.call(this, event, this.__data__); + }; +} + +function parseTypenames(typenames) { + return typenames.trim().split(/^|\s+/).map(function(t) { + var name = "", i = t.indexOf("."); + if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); + return {type: t, name: name}; + }); +} + +function onRemove(typename) { + return function() { + var on = this.__on; + if (!on) return; + for (var j = 0, i = -1, m = on.length, o; j < m; ++j) { + if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) { + this.removeEventListener(o.type, o.listener, o.options); + } else { + on[++i] = o; + } + } + if (++i) on.length = i; + else delete this.__on; + }; +} + +function onAdd(typename, value, options) { + return function() { + var on = this.__on, o, listener = contextListener(value); + if (on) for (var j = 0, m = on.length; j < m; ++j) { + if ((o = on[j]).type === typename.type && o.name === typename.name) { + this.removeEventListener(o.type, o.listener, o.options); + this.addEventListener(o.type, o.listener = listener, o.options = options); + o.value = value; + return; + } + } + this.addEventListener(typename.type, listener, options); + o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options}; + if (!on) this.__on = [o]; + else on.push(o); + }; +} + +/* harmony default export */ function on(typename, value, options) { + var typenames = parseTypenames(typename + ""), i, n = typenames.length, t; + + if (arguments.length < 2) { + var on = this.node().__on; + if (on) for (var j = 0, m = on.length, o; j < m; ++j) { + for (i = 0, o = on[j]; i < n; ++i) { + if ((t = typenames[i]).type === o.type && t.name === o.name) { + return o.value; + } + } + } + return; + } + + on = value ? onAdd : onRemove; + for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options)); + return this; +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/dispatch.js + + +function dispatchEvent(node, type, params) { + var window = src_window(node), + event = window.CustomEvent; + + if (typeof event === "function") { + event = new event(type, params); + } else { + event = window.document.createEvent("Event"); + if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail; + else event.initEvent(type, false, false); + } + + node.dispatchEvent(event); +} + +function dispatchConstant(type, params) { + return function() { + return dispatchEvent(this, type, params); + }; +} + +function dispatchFunction(type, params) { + return function() { + return dispatchEvent(this, type, params.apply(this, arguments)); + }; +} + +/* harmony default export */ function dispatch(type, params) { + return this.each((typeof params === "function" + ? dispatchFunction + : dispatchConstant)(type, params)); +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/iterator.js +/* harmony default export */ function* iterator() { + for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { + for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { + if (node = group[i]) yield node; + } + } +} + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/index.js + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +var root = [null]; + +function Selection(groups, parents) { + this._groups = groups; + this._parents = parents; +} + +function selection() { + return new Selection([[document.documentElement]], root); +} + +function selection_selection() { + return this; +} + +Selection.prototype = selection.prototype = { + constructor: Selection, + select: selection_select, + selectAll: selectAll, + selectChild: selectChild, + selectChildren: selectChildren, + filter: selection_filter, + data: data, + enter: enter, + exit: exit, + join: join, + merge: merge, + selection: selection_selection, + order: order, + sort: sort, + call: call, + nodes: nodes, + node: node, + size: size, + empty: selection_empty, + each: each, + attr: attr, + style: style, + property: property, + classed: classed, + text: selection_text, + html: html, + raise: selection_raise, + lower: selection_lower, + append: append, + insert: insert, + remove: selection_remove, + clone: clone, + datum: selection_datum, + on: on, + dispatch: dispatch, + [Symbol.iterator]: iterator +}; + +/* harmony default export */ const src_selection = (selection); + +;// CONCATENATED MODULE: ../node_modules/d3-selection/src/select.js + + +/* harmony default export */ function src_select(selector) { + return typeof selector === "string" + ? new Selection([[document.querySelector(selector)]], [document.documentElement]) + : new Selection([[selector]], root); +} + +;// CONCATENATED MODULE: ../node_modules/d3-dispatch/src/dispatch.js +var noop = {value: () => {}}; + +function dispatch_dispatch() { + for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) { + if (!(t = arguments[i] + "") || (t in _) || /[\s.]/.test(t)) throw new Error("illegal type: " + t); + _[t] = []; + } + return new Dispatch(_); +} + +function Dispatch(_) { + this._ = _; +} + +function dispatch_parseTypenames(typenames, types) { + return typenames.trim().split(/^|\s+/).map(function(t) { + var name = "", i = t.indexOf("."); + if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); + if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t); + return {type: t, name: name}; + }); +} + +Dispatch.prototype = dispatch_dispatch.prototype = { + constructor: Dispatch, + on: function(typename, callback) { + var _ = this._, + T = dispatch_parseTypenames(typename + "", _), + t, + i = -1, + n = T.length; + + // If no callback was specified, return the callback of the given type and name. + if (arguments.length < 2) { + while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t; + return; + } + + // If a type was specified, set the callback for the given type and name. + // Otherwise, if a null callback was specified, remove callbacks of the given name. + if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback); + while (++i < n) { + if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback); + else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null); + } + + return this; + }, + copy: function() { + var copy = {}, _ = this._; + for (var t in _) copy[t] = _[t].slice(); + return new Dispatch(copy); + }, + call: function(type, that) { + if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2]; + if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); + for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); + }, + apply: function(type, that, args) { + if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); + for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); + } +}; + +function get(type, name) { + for (var i = 0, n = type.length, c; i < n; ++i) { + if ((c = type[i]).name === name) { + return c.value; + } + } +} + +function set(type, name, callback) { + for (var i = 0, n = type.length; i < n; ++i) { + if (type[i].name === name) { + type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1)); + break; + } + } + if (callback != null) type.push({name: name, value: callback}); + return type; +} + +/* harmony default export */ const src_dispatch = (dispatch_dispatch); + +;// CONCATENATED MODULE: ../node_modules/d3-timer/src/timer.js +var timer_frame = 0, // is an animation frame pending? + timeout = 0, // is a timeout pending? + interval = 0, // are any timers active? + pokeDelay = 1000, // how frequently we check for clock skew + taskHead, + taskTail, + clockLast = 0, + clockNow = 0, + clockSkew = 0, + clock = typeof performance === "object" && performance.now ? performance : Date, + setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); }; + +function now() { + return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew); +} + +function clearNow() { + clockNow = 0; +} + +function Timer() { + this._call = + this._time = + this._next = null; +} + +Timer.prototype = timer.prototype = { + constructor: Timer, + restart: function(callback, delay, time) { + if (typeof callback !== "function") throw new TypeError("callback is not a function"); + time = (time == null ? now() : +time) + (delay == null ? 0 : +delay); + if (!this._next && taskTail !== this) { + if (taskTail) taskTail._next = this; + else taskHead = this; + taskTail = this; + } + this._call = callback; + this._time = time; + sleep(); + }, + stop: function() { + if (this._call) { + this._call = null; + this._time = Infinity; + sleep(); + } + } +}; + +function timer(callback, delay, time) { + var t = new Timer; + t.restart(callback, delay, time); + return t; +} + +function timerFlush() { + now(); // Get the current time, if not already set. + ++timer_frame; // Pretend we’ve set an alarm, if we haven’t already. + var t = taskHead, e; + while (t) { + if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e); + t = t._next; + } + --timer_frame; +} + +function wake() { + clockNow = (clockLast = clock.now()) + clockSkew; + timer_frame = timeout = 0; + try { + timerFlush(); + } finally { + timer_frame = 0; + nap(); + clockNow = 0; + } +} + +function poke() { + var now = clock.now(), delay = now - clockLast; + if (delay > pokeDelay) clockSkew -= delay, clockLast = now; +} + +function nap() { + var t0, t1 = taskHead, t2, time = Infinity; + while (t1) { + if (t1._call) { + if (time > t1._time) time = t1._time; + t0 = t1, t1 = t1._next; + } else { + t2 = t1._next, t1._next = null; + t1 = t0 ? t0._next = t2 : taskHead = t2; + } + } + taskTail = t0; + sleep(time); +} + +function sleep(time) { + if (timer_frame) return; // Soonest alarm already set, or will be. + if (timeout) timeout = clearTimeout(timeout); + var delay = time - clockNow; // Strictly less than if we recomputed clockNow. + if (delay > 24) { + if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew); + if (interval) interval = clearInterval(interval); + } else { + if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay); + timer_frame = 1, setFrame(wake); + } +} + +;// CONCATENATED MODULE: ../node_modules/d3-timer/src/timeout.js + + +/* harmony default export */ function src_timeout(callback, delay, time) { + var t = new Timer; + delay = delay == null ? 0 : +delay; + t.restart(elapsed => { + t.stop(); + callback(elapsed + delay); + }, delay, time); + return t; +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/schedule.js + + + +var emptyOn = src_dispatch("start", "end", "cancel", "interrupt"); +var emptyTween = []; + +var CREATED = 0; +var SCHEDULED = 1; +var STARTING = 2; +var STARTED = 3; +var RUNNING = 4; +var ENDING = 5; +var ENDED = 6; + +/* harmony default export */ function schedule(node, name, id, index, group, timing) { + var schedules = node.__transition; + if (!schedules) node.__transition = {}; + else if (id in schedules) return; + create(node, id, { + name: name, + index: index, // For context during callback. + group: group, // For context during callback. + on: emptyOn, + tween: emptyTween, + time: timing.time, + delay: timing.delay, + duration: timing.duration, + ease: timing.ease, + timer: null, + state: CREATED + }); +} + +function init(node, id) { + var schedule = schedule_get(node, id); + if (schedule.state > CREATED) throw new Error("too late; already scheduled"); + return schedule; +} + +function schedule_set(node, id) { + var schedule = schedule_get(node, id); + if (schedule.state > STARTED) throw new Error("too late; already running"); + return schedule; +} + +function schedule_get(node, id) { + var schedule = node.__transition; + if (!schedule || !(schedule = schedule[id])) throw new Error("transition not found"); + return schedule; +} + +function create(node, id, self) { + var schedules = node.__transition, + tween; + + // Initialize the self timer when the transition is created. + // Note the actual delay is not known until the first callback! + schedules[id] = self; + self.timer = timer(schedule, 0, self.time); + + function schedule(elapsed) { + self.state = SCHEDULED; + self.timer.restart(start, self.delay, self.time); + + // If the elapsed delay is less than our first sleep, start immediately. + if (self.delay <= elapsed) start(elapsed - self.delay); + } + + function start(elapsed) { + var i, j, n, o; + + // If the state is not SCHEDULED, then we previously errored on start. + if (self.state !== SCHEDULED) return stop(); + + for (i in schedules) { + o = schedules[i]; + if (o.name !== self.name) continue; + + // While this element already has a starting transition during this frame, + // defer starting an interrupting transition until that transition has a + // chance to tick (and possibly end); see d3/d3-transition#54! + if (o.state === STARTED) return src_timeout(start); + + // Interrupt the active transition, if any. + if (o.state === RUNNING) { + o.state = ENDED; + o.timer.stop(); + o.on.call("interrupt", node, node.__data__, o.index, o.group); + delete schedules[i]; + } + + // Cancel any pre-empted transitions. + else if (+i < id) { + o.state = ENDED; + o.timer.stop(); + o.on.call("cancel", node, node.__data__, o.index, o.group); + delete schedules[i]; + } + } + + // Defer the first tick to end of the current frame; see d3/d3#1576. + // Note the transition may be canceled after start and before the first tick! + // Note this must be scheduled before the start event; see d3/d3-transition#16! + // Assuming this is successful, subsequent callbacks go straight to tick. + src_timeout(function() { + if (self.state === STARTED) { + self.state = RUNNING; + self.timer.restart(tick, self.delay, self.time); + tick(elapsed); + } + }); + + // Dispatch the start event. + // Note this must be done before the tween are initialized. + self.state = STARTING; + self.on.call("start", node, node.__data__, self.index, self.group); + if (self.state !== STARTING) return; // interrupted + self.state = STARTED; + + // Initialize the tween, deleting null tween. + tween = new Array(n = self.tween.length); + for (i = 0, j = -1; i < n; ++i) { + if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) { + tween[++j] = o; + } + } + tween.length = j + 1; + } + + function tick(elapsed) { + var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1), + i = -1, + n = tween.length; + + while (++i < n) { + tween[i].call(node, t); + } + + // Dispatch the end event. + if (self.state === ENDING) { + self.on.call("end", node, node.__data__, self.index, self.group); + stop(); + } + } + + function stop() { + self.state = ENDED; + self.timer.stop(); + delete schedules[id]; + for (var i in schedules) return; // eslint-disable-line no-unused-vars + delete node.__transition; + } +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/interrupt.js + + +/* harmony default export */ function interrupt(node, name) { + var schedules = node.__transition, + schedule, + active, + empty = true, + i; + + if (!schedules) return; + + name = name == null ? null : name + ""; + + for (i in schedules) { + if ((schedule = schedules[i]).name !== name) { empty = false; continue; } + active = schedule.state > STARTING && schedule.state < ENDING; + schedule.state = ENDED; + schedule.timer.stop(); + schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group); + delete schedules[i]; + } + + if (empty) delete node.__transition; +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/selection/interrupt.js + + +/* harmony default export */ function selection_interrupt(name) { + return this.each(function() { + interrupt(this, name); + }); +} + +;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/number.js +/* harmony default export */ function number(a, b) { + return a = +a, b = +b, function(t) { + return a * (1 - t) + b * t; + }; +} + +;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/transform/decompose.js +var degrees = 180 / Math.PI; + +var identity = { + translateX: 0, + translateY: 0, + rotate: 0, + skewX: 0, + scaleX: 1, + scaleY: 1 +}; + +/* harmony default export */ function decompose(a, b, c, d, e, f) { + var scaleX, scaleY, skewX; + if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX; + if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX; + if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY; + if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX; + return { + translateX: e, + translateY: f, + rotate: Math.atan2(b, a) * degrees, + skewX: Math.atan(skewX) * degrees, + scaleX: scaleX, + scaleY: scaleY + }; +} + +;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/transform/parse.js + + +var svgNode; + +/* eslint-disable no-undef */ +function parseCss(value) { + const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + ""); + return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f); +} + +function parseSvg(value) { + if (value == null) return identity; + if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g"); + svgNode.setAttribute("transform", value); + if (!(value = svgNode.transform.baseVal.consolidate())) return identity; + value = value.matrix; + return decompose(value.a, value.b, value.c, value.d, value.e, value.f); +} + +;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/transform/index.js + + + +function interpolateTransform(parse, pxComma, pxParen, degParen) { + + function pop(s) { + return s.length ? s.pop() + " " : ""; + } + + function translate(xa, ya, xb, yb, s, q) { + if (xa !== xb || ya !== yb) { + var i = s.push("translate(", null, pxComma, null, pxParen); + q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)}); + } else if (xb || yb) { + s.push("translate(" + xb + pxComma + yb + pxParen); + } + } + + function rotate(a, b, s, q) { + if (a !== b) { + if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path + q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: number(a, b)}); + } else if (b) { + s.push(pop(s) + "rotate(" + b + degParen); + } + } + + function skewX(a, b, s, q) { + if (a !== b) { + q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: number(a, b)}); + } else if (b) { + s.push(pop(s) + "skewX(" + b + degParen); + } + } + + function scale(xa, ya, xb, yb, s, q) { + if (xa !== xb || ya !== yb) { + var i = s.push(pop(s) + "scale(", null, ",", null, ")"); + q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)}); + } else if (xb !== 1 || yb !== 1) { + s.push(pop(s) + "scale(" + xb + "," + yb + ")"); + } + } + + return function(a, b) { + var s = [], // string constants and placeholders + q = []; // number interpolators + a = parse(a), b = parse(b); + translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q); + rotate(a.rotate, b.rotate, s, q); + skewX(a.skewX, b.skewX, s, q); + scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q); + a = b = null; // gc + return function(t) { + var i = -1, n = q.length, o; + while (++i < n) s[(o = q[i]).i] = o.x(t); + return s.join(""); + }; + }; +} + +var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)"); +var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")"); + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/tween.js + + +function tweenRemove(id, name) { + var tween0, tween1; + return function() { + var schedule = schedule_set(this, id), + tween = schedule.tween; + + // If this node shared tween with the previous node, + // just assign the updated shared tween and we’re done! + // Otherwise, copy-on-write. + if (tween !== tween0) { + tween1 = tween0 = tween; + for (var i = 0, n = tween1.length; i < n; ++i) { + if (tween1[i].name === name) { + tween1 = tween1.slice(); + tween1.splice(i, 1); + break; + } + } + } + + schedule.tween = tween1; + }; +} + +function tweenFunction(id, name, value) { + var tween0, tween1; + if (typeof value !== "function") throw new Error; + return function() { + var schedule = schedule_set(this, id), + tween = schedule.tween; + + // If this node shared tween with the previous node, + // just assign the updated shared tween and we’re done! + // Otherwise, copy-on-write. + if (tween !== tween0) { + tween1 = (tween0 = tween).slice(); + for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) { + if (tween1[i].name === name) { + tween1[i] = t; + break; + } + } + if (i === n) tween1.push(t); + } + + schedule.tween = tween1; + }; +} + +/* harmony default export */ function tween(name, value) { + var id = this._id; + + name += ""; + + if (arguments.length < 2) { + var tween = schedule_get(this.node(), id).tween; + for (var i = 0, n = tween.length, t; i < n; ++i) { + if ((t = tween[i]).name === name) { + return t.value; + } + } + return null; + } + + return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value)); +} + +function tweenValue(transition, name, value) { + var id = transition._id; + + transition.each(function() { + var schedule = schedule_set(this, id); + (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments); + }); + + return function(node) { + return schedule_get(node, id).value[name]; + }; +} + +;// CONCATENATED MODULE: ../node_modules/d3-color/src/define.js +/* harmony default export */ function src_define(constructor, factory, prototype) { + constructor.prototype = factory.prototype = prototype; + prototype.constructor = constructor; +} + +function extend(parent, definition) { + var prototype = Object.create(parent.prototype); + for (var key in definition) prototype[key] = definition[key]; + return prototype; +} + +;// CONCATENATED MODULE: ../node_modules/d3-color/src/color.js + + +function Color() {} + +var darker = 0.7; +var brighter = 1 / darker; + +var reI = "\\s*([+-]?\\d+)\\s*", + reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", + reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", + reHex = /^#([0-9a-f]{3,8})$/, + reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"), + reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"), + reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"), + reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"), + reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"), + reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$"); + +var named = { + aliceblue: 0xf0f8ff, + antiquewhite: 0xfaebd7, + aqua: 0x00ffff, + aquamarine: 0x7fffd4, + azure: 0xf0ffff, + beige: 0xf5f5dc, + bisque: 0xffe4c4, + black: 0x000000, + blanchedalmond: 0xffebcd, + blue: 0x0000ff, + blueviolet: 0x8a2be2, + brown: 0xa52a2a, + burlywood: 0xdeb887, + cadetblue: 0x5f9ea0, + chartreuse: 0x7fff00, + chocolate: 0xd2691e, + coral: 0xff7f50, + cornflowerblue: 0x6495ed, + cornsilk: 0xfff8dc, + crimson: 0xdc143c, + cyan: 0x00ffff, + darkblue: 0x00008b, + darkcyan: 0x008b8b, + darkgoldenrod: 0xb8860b, + darkgray: 0xa9a9a9, + darkgreen: 0x006400, + darkgrey: 0xa9a9a9, + darkkhaki: 0xbdb76b, + darkmagenta: 0x8b008b, + darkolivegreen: 0x556b2f, + darkorange: 0xff8c00, + darkorchid: 0x9932cc, + darkred: 0x8b0000, + darksalmon: 0xe9967a, + darkseagreen: 0x8fbc8f, + darkslateblue: 0x483d8b, + darkslategray: 0x2f4f4f, + darkslategrey: 0x2f4f4f, + darkturquoise: 0x00ced1, + darkviolet: 0x9400d3, + deeppink: 0xff1493, + deepskyblue: 0x00bfff, + dimgray: 0x696969, + dimgrey: 0x696969, + dodgerblue: 0x1e90ff, + firebrick: 0xb22222, + floralwhite: 0xfffaf0, + forestgreen: 0x228b22, + fuchsia: 0xff00ff, + gainsboro: 0xdcdcdc, + ghostwhite: 0xf8f8ff, + gold: 0xffd700, + goldenrod: 0xdaa520, + gray: 0x808080, + green: 0x008000, + greenyellow: 0xadff2f, + grey: 0x808080, + honeydew: 0xf0fff0, + hotpink: 0xff69b4, + indianred: 0xcd5c5c, + indigo: 0x4b0082, + ivory: 0xfffff0, + khaki: 0xf0e68c, + lavender: 0xe6e6fa, + lavenderblush: 0xfff0f5, + lawngreen: 0x7cfc00, + lemonchiffon: 0xfffacd, + lightblue: 0xadd8e6, + lightcoral: 0xf08080, + lightcyan: 0xe0ffff, + lightgoldenrodyellow: 0xfafad2, + lightgray: 0xd3d3d3, + lightgreen: 0x90ee90, + lightgrey: 0xd3d3d3, + lightpink: 0xffb6c1, + lightsalmon: 0xffa07a, + lightseagreen: 0x20b2aa, + lightskyblue: 0x87cefa, + lightslategray: 0x778899, + lightslategrey: 0x778899, + lightsteelblue: 0xb0c4de, + lightyellow: 0xffffe0, + lime: 0x00ff00, + limegreen: 0x32cd32, + linen: 0xfaf0e6, + magenta: 0xff00ff, + maroon: 0x800000, + mediumaquamarine: 0x66cdaa, + mediumblue: 0x0000cd, + mediumorchid: 0xba55d3, + mediumpurple: 0x9370db, + mediumseagreen: 0x3cb371, + mediumslateblue: 0x7b68ee, + mediumspringgreen: 0x00fa9a, + mediumturquoise: 0x48d1cc, + mediumvioletred: 0xc71585, + midnightblue: 0x191970, + mintcream: 0xf5fffa, + mistyrose: 0xffe4e1, + moccasin: 0xffe4b5, + navajowhite: 0xffdead, + navy: 0x000080, + oldlace: 0xfdf5e6, + olive: 0x808000, + olivedrab: 0x6b8e23, + orange: 0xffa500, + orangered: 0xff4500, + orchid: 0xda70d6, + palegoldenrod: 0xeee8aa, + palegreen: 0x98fb98, + paleturquoise: 0xafeeee, + palevioletred: 0xdb7093, + papayawhip: 0xffefd5, + peachpuff: 0xffdab9, + peru: 0xcd853f, + pink: 0xffc0cb, + plum: 0xdda0dd, + powderblue: 0xb0e0e6, + purple: 0x800080, + rebeccapurple: 0x663399, + red: 0xff0000, + rosybrown: 0xbc8f8f, + royalblue: 0x4169e1, + saddlebrown: 0x8b4513, + salmon: 0xfa8072, + sandybrown: 0xf4a460, + seagreen: 0x2e8b57, + seashell: 0xfff5ee, + sienna: 0xa0522d, + silver: 0xc0c0c0, + skyblue: 0x87ceeb, + slateblue: 0x6a5acd, + slategray: 0x708090, + slategrey: 0x708090, + snow: 0xfffafa, + springgreen: 0x00ff7f, + steelblue: 0x4682b4, + tan: 0xd2b48c, + teal: 0x008080, + thistle: 0xd8bfd8, + tomato: 0xff6347, + turquoise: 0x40e0d0, + violet: 0xee82ee, + wheat: 0xf5deb3, + white: 0xffffff, + whitesmoke: 0xf5f5f5, + yellow: 0xffff00, + yellowgreen: 0x9acd32 +}; + +src_define(Color, color, { + copy: function(channels) { + return Object.assign(new this.constructor, this, channels); + }, + displayable: function() { + return this.rgb().displayable(); + }, + hex: color_formatHex, // Deprecated! Use color.formatHex. + formatHex: color_formatHex, + formatHsl: color_formatHsl, + formatRgb: color_formatRgb, + toString: color_formatRgb +}); + +function color_formatHex() { + return this.rgb().formatHex(); +} + +function color_formatHsl() { + return hslConvert(this).formatHsl(); +} + +function color_formatRgb() { + return this.rgb().formatRgb(); +} + +function color(format) { + var m, l; + format = (format + "").trim().toLowerCase(); + return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000 + : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00 + : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000 + : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000 + : null) // invalid hex + : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0) + : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%) + : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) + : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1) + : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) + : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) + : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins + : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) + : null; +} + +function rgbn(n) { + return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1); +} + +function rgba(r, g, b, a) { + if (a <= 0) r = g = b = NaN; + return new Rgb(r, g, b, a); +} + +function rgbConvert(o) { + if (!(o instanceof Color)) o = color(o); + if (!o) return new Rgb; + o = o.rgb(); + return new Rgb(o.r, o.g, o.b, o.opacity); +} + +function color_rgb(r, g, b, opacity) { + return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity); +} + +function Rgb(r, g, b, opacity) { + this.r = +r; + this.g = +g; + this.b = +b; + this.opacity = +opacity; +} + +src_define(Rgb, color_rgb, extend(Color, { + brighter: function(k) { + k = k == null ? brighter : Math.pow(brighter, k); + return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); + }, + darker: function(k) { + k = k == null ? darker : Math.pow(darker, k); + return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); + }, + rgb: function() { + return this; + }, + displayable: function() { + return (-0.5 <= this.r && this.r < 255.5) + && (-0.5 <= this.g && this.g < 255.5) + && (-0.5 <= this.b && this.b < 255.5) + && (0 <= this.opacity && this.opacity <= 1); + }, + hex: rgb_formatHex, // Deprecated! Use color.formatHex. + formatHex: rgb_formatHex, + formatRgb: rgb_formatRgb, + toString: rgb_formatRgb +})); + +function rgb_formatHex() { + return "#" + hex(this.r) + hex(this.g) + hex(this.b); +} + +function rgb_formatRgb() { + var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); + return (a === 1 ? "rgb(" : "rgba(") + + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " + + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " + + Math.max(0, Math.min(255, Math.round(this.b) || 0)) + + (a === 1 ? ")" : ", " + a + ")"); +} + +function hex(value) { + value = Math.max(0, Math.min(255, Math.round(value) || 0)); + return (value < 16 ? "0" : "") + value.toString(16); +} + +function hsla(h, s, l, a) { + if (a <= 0) h = s = l = NaN; + else if (l <= 0 || l >= 1) h = s = NaN; + else if (s <= 0) h = NaN; + return new Hsl(h, s, l, a); +} + +function hslConvert(o) { + if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); + if (!(o instanceof Color)) o = color(o); + if (!o) return new Hsl; + if (o instanceof Hsl) return o; + o = o.rgb(); + var r = o.r / 255, + g = o.g / 255, + b = o.b / 255, + min = Math.min(r, g, b), + max = Math.max(r, g, b), + h = NaN, + s = max - min, + l = (max + min) / 2; + if (s) { + if (r === max) h = (g - b) / s + (g < b) * 6; + else if (g === max) h = (b - r) / s + 2; + else h = (r - g) / s + 4; + s /= l < 0.5 ? max + min : 2 - max - min; + h *= 60; + } else { + s = l > 0 && l < 1 ? 0 : h; + } + return new Hsl(h, s, l, o.opacity); +} + +function hsl(h, s, l, opacity) { + return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity); +} + +function Hsl(h, s, l, opacity) { + this.h = +h; + this.s = +s; + this.l = +l; + this.opacity = +opacity; +} + +src_define(Hsl, hsl, extend(Color, { + brighter: function(k) { + k = k == null ? brighter : Math.pow(brighter, k); + return new Hsl(this.h, this.s, this.l * k, this.opacity); + }, + darker: function(k) { + k = k == null ? darker : Math.pow(darker, k); + return new Hsl(this.h, this.s, this.l * k, this.opacity); + }, + rgb: function() { + var h = this.h % 360 + (this.h < 0) * 360, + s = isNaN(h) || isNaN(this.s) ? 0 : this.s, + l = this.l, + m2 = l + (l < 0.5 ? l : 1 - l) * s, + m1 = 2 * l - m2; + return new Rgb( + hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), + hsl2rgb(h, m1, m2), + hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), + this.opacity + ); + }, + displayable: function() { + return (0 <= this.s && this.s <= 1 || isNaN(this.s)) + && (0 <= this.l && this.l <= 1) + && (0 <= this.opacity && this.opacity <= 1); + }, + formatHsl: function() { + var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); + return (a === 1 ? "hsl(" : "hsla(") + + (this.h || 0) + ", " + + (this.s || 0) * 100 + "%, " + + (this.l || 0) * 100 + "%" + + (a === 1 ? ")" : ", " + a + ")"); + } +})); + +/* From FvD 13.37, CSS Color Module Level 3 */ +function hsl2rgb(h, m1, m2) { + return (h < 60 ? m1 + (m2 - m1) * h / 60 + : h < 180 ? m2 + : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 + : m1) * 255; +} + +;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/basis.js +function basis(t1, v0, v1, v2, v3) { + var t2 = t1 * t1, t3 = t2 * t1; + return ((1 - 3 * t1 + 3 * t2 - t3) * v0 + + (4 - 6 * t2 + 3 * t3) * v1 + + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 + + t3 * v3) / 6; +} + +/* harmony default export */ function src_basis(values) { + var n = values.length - 1; + return function(t) { + var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n), + v1 = values[i], + v2 = values[i + 1], + v0 = i > 0 ? values[i - 1] : 2 * v1 - v2, + v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1; + return basis((t - i / n) * n, v0, v1, v2, v3); + }; +} + +;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/basisClosed.js + + +/* harmony default export */ function basisClosed(values) { + var n = values.length; + return function(t) { + var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n), + v0 = values[(i + n - 1) % n], + v1 = values[i % n], + v2 = values[(i + 1) % n], + v3 = values[(i + 2) % n]; + return basis((t - i / n) * n, v0, v1, v2, v3); + }; +} + +;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/constant.js +/* harmony default export */ const d3_interpolate_src_constant = (x => () => x); + +;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/color.js + + +function linear(a, d) { + return function(t) { + return a + t * d; + }; +} + +function exponential(a, b, y) { + return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) { + return Math.pow(a + t * b, y); + }; +} + +function hue(a, b) { + var d = b - a; + return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a); +} + +function gamma(y) { + return (y = +y) === 1 ? nogamma : function(a, b) { + return b - a ? exponential(a, b, y) : d3_interpolate_src_constant(isNaN(a) ? b : a); + }; +} + +function nogamma(a, b) { + var d = b - a; + return d ? linear(a, d) : d3_interpolate_src_constant(isNaN(a) ? b : a); +} + +;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/rgb.js + + + + + +/* harmony default export */ const rgb = ((function rgbGamma(y) { + var color = gamma(y); + + function rgb(start, end) { + var r = color((start = color_rgb(start)).r, (end = color_rgb(end)).r), + g = color(start.g, end.g), + b = color(start.b, end.b), + opacity = nogamma(start.opacity, end.opacity); + return function(t) { + start.r = r(t); + start.g = g(t); + start.b = b(t); + start.opacity = opacity(t); + return start + ""; + }; + } + + rgb.gamma = rgbGamma; + + return rgb; +})(1)); + +function rgbSpline(spline) { + return function(colors) { + var n = colors.length, + r = new Array(n), + g = new Array(n), + b = new Array(n), + i, color; + for (i = 0; i < n; ++i) { + color = color_rgb(colors[i]); + r[i] = color.r || 0; + g[i] = color.g || 0; + b[i] = color.b || 0; + } + r = spline(r); + g = spline(g); + b = spline(b); + color.opacity = 1; + return function(t) { + color.r = r(t); + color.g = g(t); + color.b = b(t); + return color + ""; + }; + }; +} + +var rgbBasis = rgbSpline(src_basis); +var rgbBasisClosed = rgbSpline(basisClosed); + +;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/string.js + + +var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, + reB = new RegExp(reA.source, "g"); + +function zero(b) { + return function() { + return b; + }; +} + +function one(b) { + return function(t) { + return b(t) + ""; + }; +} + +/* harmony default export */ function string(a, b) { + var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b + am, // current match in a + bm, // current match in b + bs, // string preceding current number in b, if any + i = -1, // index in s + s = [], // string constants and placeholders + q = []; // number interpolators + + // Coerce inputs to strings. + a = a + "", b = b + ""; + + // Interpolate pairs of numbers in a & b. + while ((am = reA.exec(a)) + && (bm = reB.exec(b))) { + if ((bs = bm.index) > bi) { // a string precedes the next number in b + bs = b.slice(bi, bs); + if (s[i]) s[i] += bs; // coalesce with previous string + else s[++i] = bs; + } + if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match + if (s[i]) s[i] += bm; // coalesce with previous string + else s[++i] = bm; + } else { // interpolate non-matching numbers + s[++i] = null; + q.push({i: i, x: number(am, bm)}); + } + bi = reB.lastIndex; + } + + // Add remains of b. + if (bi < b.length) { + bs = b.slice(bi); + if (s[i]) s[i] += bs; // coalesce with previous string + else s[++i] = bs; + } + + // Special optimization for only a single match. + // Otherwise, interpolate each of the numbers and rejoin the string. + return s.length < 2 ? (q[0] + ? one(q[0].x) + : zero(b)) + : (b = q.length, function(t) { + for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t); + return s.join(""); + }); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/interpolate.js + + + +/* harmony default export */ function interpolate(a, b) { + var c; + return (typeof b === "number" ? number + : b instanceof color ? rgb + : (c = color(b)) ? (b = c, rgb) + : string)(a, b); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/attr.js + + + + + +function attr_attrRemove(name) { + return function() { + this.removeAttribute(name); + }; +} + +function attr_attrRemoveNS(fullname) { + return function() { + this.removeAttributeNS(fullname.space, fullname.local); + }; +} + +function attr_attrConstant(name, interpolate, value1) { + var string00, + string1 = value1 + "", + interpolate0; + return function() { + var string0 = this.getAttribute(name); + return string0 === string1 ? null + : string0 === string00 ? interpolate0 + : interpolate0 = interpolate(string00 = string0, value1); + }; +} + +function attr_attrConstantNS(fullname, interpolate, value1) { + var string00, + string1 = value1 + "", + interpolate0; + return function() { + var string0 = this.getAttributeNS(fullname.space, fullname.local); + return string0 === string1 ? null + : string0 === string00 ? interpolate0 + : interpolate0 = interpolate(string00 = string0, value1); + }; +} + +function attr_attrFunction(name, interpolate, value) { + var string00, + string10, + interpolate0; + return function() { + var string0, value1 = value(this), string1; + if (value1 == null) return void this.removeAttribute(name); + string0 = this.getAttribute(name); + string1 = value1 + ""; + return string0 === string1 ? null + : string0 === string00 && string1 === string10 ? interpolate0 + : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); + }; +} + +function attr_attrFunctionNS(fullname, interpolate, value) { + var string00, + string10, + interpolate0; + return function() { + var string0, value1 = value(this), string1; + if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local); + string0 = this.getAttributeNS(fullname.space, fullname.local); + string1 = value1 + ""; + return string0 === string1 ? null + : string0 === string00 && string1 === string10 ? interpolate0 + : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); + }; +} + +/* harmony default export */ function transition_attr(name, value) { + var fullname = namespace(name), i = fullname === "transform" ? interpolateTransformSvg : interpolate; + return this.attrTween(name, typeof value === "function" + ? (fullname.local ? attr_attrFunctionNS : attr_attrFunction)(fullname, i, tweenValue(this, "attr." + name, value)) + : value == null ? (fullname.local ? attr_attrRemoveNS : attr_attrRemove)(fullname) + : (fullname.local ? attr_attrConstantNS : attr_attrConstant)(fullname, i, value)); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/attrTween.js + + +function attrInterpolate(name, i) { + return function(t) { + this.setAttribute(name, i.call(this, t)); + }; +} + +function attrInterpolateNS(fullname, i) { + return function(t) { + this.setAttributeNS(fullname.space, fullname.local, i.call(this, t)); + }; +} + +function attrTweenNS(fullname, value) { + var t0, i0; + function tween() { + var i = value.apply(this, arguments); + if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i); + return t0; + } + tween._value = value; + return tween; +} + +function attrTween(name, value) { + var t0, i0; + function tween() { + var i = value.apply(this, arguments); + if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i); + return t0; + } + tween._value = value; + return tween; +} + +/* harmony default export */ function transition_attrTween(name, value) { + var key = "attr." + name; + if (arguments.length < 2) return (key = this.tween(key)) && key._value; + if (value == null) return this.tween(key, null); + if (typeof value !== "function") throw new Error; + var fullname = namespace(name); + return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value)); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/delay.js + + +function delayFunction(id, value) { + return function() { + init(this, id).delay = +value.apply(this, arguments); + }; +} + +function delayConstant(id, value) { + return value = +value, function() { + init(this, id).delay = value; + }; +} + +/* harmony default export */ function delay(value) { + var id = this._id; + + return arguments.length + ? this.each((typeof value === "function" + ? delayFunction + : delayConstant)(id, value)) + : schedule_get(this.node(), id).delay; +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/duration.js + + +function durationFunction(id, value) { + return function() { + schedule_set(this, id).duration = +value.apply(this, arguments); + }; +} + +function durationConstant(id, value) { + return value = +value, function() { + schedule_set(this, id).duration = value; + }; +} + +/* harmony default export */ function duration(value) { + var id = this._id; + + return arguments.length + ? this.each((typeof value === "function" + ? durationFunction + : durationConstant)(id, value)) + : schedule_get(this.node(), id).duration; +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/ease.js + + +function easeConstant(id, value) { + if (typeof value !== "function") throw new Error; + return function() { + schedule_set(this, id).ease = value; + }; +} + +/* harmony default export */ function ease(value) { + var id = this._id; + + return arguments.length + ? this.each(easeConstant(id, value)) + : schedule_get(this.node(), id).ease; +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/easeVarying.js + + +function easeVarying(id, value) { + return function() { + var v = value.apply(this, arguments); + if (typeof v !== "function") throw new Error; + schedule_set(this, id).ease = v; + }; +} + +/* harmony default export */ function transition_easeVarying(value) { + if (typeof value !== "function") throw new Error; + return this.each(easeVarying(this._id, value)); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/filter.js + + + +/* harmony default export */ function transition_filter(match) { + if (typeof match !== "function") match = matcher(match); + + for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { + if ((node = group[i]) && match.call(node, node.__data__, i, group)) { + subgroup.push(node); + } + } + } + + return new Transition(subgroups, this._parents, this._name, this._id); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/merge.js + + +/* harmony default export */ function transition_merge(transition) { + if (transition._id !== this._id) throw new Error; + + for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { + for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { + if (node = group0[i] || group1[i]) { + merge[i] = node; + } + } + } + + for (; j < m0; ++j) { + merges[j] = groups0[j]; + } + + return new Transition(merges, this._parents, this._name, this._id); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/on.js + + +function start(name) { + return (name + "").trim().split(/^|\s+/).every(function(t) { + var i = t.indexOf("."); + if (i >= 0) t = t.slice(0, i); + return !t || t === "start"; + }); +} + +function onFunction(id, name, listener) { + var on0, on1, sit = start(name) ? init : schedule_set; + return function() { + var schedule = sit(this, id), + on = schedule.on; + + // If this node shared a dispatch with the previous node, + // just assign the updated shared dispatch and we’re done! + // Otherwise, copy-on-write. + if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener); + + schedule.on = on1; + }; +} + +/* harmony default export */ function transition_on(name, listener) { + var id = this._id; + + return arguments.length < 2 + ? schedule_get(this.node(), id).on.on(name) + : this.each(onFunction(id, name, listener)); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/remove.js +function removeFunction(id) { + return function() { + var parent = this.parentNode; + for (var i in this.__transition) if (+i !== id) return; + if (parent) parent.removeChild(this); + }; +} + +/* harmony default export */ function transition_remove() { + return this.on("end.remove", removeFunction(this._id)); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/select.js + + + + +/* harmony default export */ function transition_select(select) { + var name = this._name, + id = this._id; + + if (typeof select !== "function") select = selector(select); + + for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { + if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { + if ("__data__" in node) subnode.__data__ = node.__data__; + subgroup[i] = subnode; + schedule(subgroup[i], name, id, i, subgroup, schedule_get(node, id)); + } + } + } + + return new Transition(subgroups, this._parents, name, id); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/selectAll.js + + + + +/* harmony default export */ function transition_selectAll(select) { + var name = this._name, + id = this._id; + + if (typeof select !== "function") select = selectorAll(select); + + for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { + if (node = group[i]) { + for (var children = select.call(node, node.__data__, i, group), child, inherit = schedule_get(node, id), k = 0, l = children.length; k < l; ++k) { + if (child = children[k]) { + schedule(child, name, id, k, children, inherit); + } + } + subgroups.push(children); + parents.push(node); + } + } + } + + return new Transition(subgroups, parents, name, id); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/selection.js + + +var selection_Selection = src_selection.prototype.constructor; + +/* harmony default export */ function transition_selection() { + return new selection_Selection(this._groups, this._parents); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/style.js + + + + + + +function styleNull(name, interpolate) { + var string00, + string10, + interpolate0; + return function() { + var string0 = styleValue(this, name), + string1 = (this.style.removeProperty(name), styleValue(this, name)); + return string0 === string1 ? null + : string0 === string00 && string1 === string10 ? interpolate0 + : interpolate0 = interpolate(string00 = string0, string10 = string1); + }; +} + +function style_styleRemove(name) { + return function() { + this.style.removeProperty(name); + }; +} + +function style_styleConstant(name, interpolate, value1) { + var string00, + string1 = value1 + "", + interpolate0; + return function() { + var string0 = styleValue(this, name); + return string0 === string1 ? null + : string0 === string00 ? interpolate0 + : interpolate0 = interpolate(string00 = string0, value1); + }; +} + +function style_styleFunction(name, interpolate, value) { + var string00, + string10, + interpolate0; + return function() { + var string0 = styleValue(this, name), + value1 = value(this), + string1 = value1 + ""; + if (value1 == null) string1 = value1 = (this.style.removeProperty(name), styleValue(this, name)); + return string0 === string1 ? null + : string0 === string00 && string1 === string10 ? interpolate0 + : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); + }; +} + +function styleMaybeRemove(id, name) { + var on0, on1, listener0, key = "style." + name, event = "end." + key, remove; + return function() { + var schedule = schedule_set(this, id), + on = schedule.on, + listener = schedule.value[key] == null ? remove || (remove = style_styleRemove(name)) : undefined; + + // If this node shared a dispatch with the previous node, + // just assign the updated shared dispatch and we’re done! + // Otherwise, copy-on-write. + if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener); + + schedule.on = on1; + }; +} + +/* harmony default export */ function transition_style(name, value, priority) { + var i = (name += "") === "transform" ? interpolateTransformCss : interpolate; + return value == null ? this + .styleTween(name, styleNull(name, i)) + .on("end.style." + name, style_styleRemove(name)) + : typeof value === "function" ? this + .styleTween(name, style_styleFunction(name, i, tweenValue(this, "style." + name, value))) + .each(styleMaybeRemove(this._id, name)) + : this + .styleTween(name, style_styleConstant(name, i, value), priority) + .on("end.style." + name, null); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/styleTween.js +function styleInterpolate(name, i, priority) { + return function(t) { + this.style.setProperty(name, i.call(this, t), priority); + }; +} + +function styleTween(name, value, priority) { + var t, i0; + function tween() { + var i = value.apply(this, arguments); + if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority); + return t; + } + tween._value = value; + return tween; +} + +/* harmony default export */ function transition_styleTween(name, value, priority) { + var key = "style." + (name += ""); + if (arguments.length < 2) return (key = this.tween(key)) && key._value; + if (value == null) return this.tween(key, null); + if (typeof value !== "function") throw new Error; + return this.tween(key, styleTween(name, value, priority == null ? "" : priority)); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/text.js + + +function text_textConstant(value) { + return function() { + this.textContent = value; + }; +} + +function text_textFunction(value) { + return function() { + var value1 = value(this); + this.textContent = value1 == null ? "" : value1; + }; +} + +/* harmony default export */ function transition_text(value) { + return this.tween("text", typeof value === "function" + ? text_textFunction(tweenValue(this, "text", value)) + : text_textConstant(value == null ? "" : value + "")); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/textTween.js +function textInterpolate(i) { + return function(t) { + this.textContent = i.call(this, t); + }; +} + +function textTween(value) { + var t0, i0; + function tween() { + var i = value.apply(this, arguments); + if (i !== i0) t0 = (i0 = i) && textInterpolate(i); + return t0; + } + tween._value = value; + return tween; +} + +/* harmony default export */ function transition_textTween(value) { + var key = "text"; + if (arguments.length < 1) return (key = this.tween(key)) && key._value; + if (value == null) return this.tween(key, null); + if (typeof value !== "function") throw new Error; + return this.tween(key, textTween(value)); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/transition.js + + + +/* harmony default export */ function transition() { + var name = this._name, + id0 = this._id, + id1 = newId(); + + for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { + if (node = group[i]) { + var inherit = schedule_get(node, id0); + schedule(node, name, id1, i, group, { + time: inherit.time + inherit.delay + inherit.duration, + delay: 0, + duration: inherit.duration, + ease: inherit.ease + }); + } + } + } + + return new Transition(groups, this._parents, name, id1); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/end.js + + +/* harmony default export */ function end() { + var on0, on1, that = this, id = that._id, size = that.size(); + return new Promise(function(resolve, reject) { + var cancel = {value: reject}, + end = {value: function() { if (--size === 0) resolve(); }}; + + that.each(function() { + var schedule = schedule_set(this, id), + on = schedule.on; + + // If this node shared a dispatch with the previous node, + // just assign the updated shared dispatch and we’re done! + // Otherwise, copy-on-write. + if (on !== on0) { + on1 = (on0 = on).copy(); + on1._.cancel.push(cancel); + on1._.interrupt.push(cancel); + on1._.end.push(end); + } + + schedule.on = on1; + }); + + // The selection was empty, resolve end immediately + if (size === 0) resolve(); + }); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/index.js + + + + + + + + + + + + + + + + + + + + + + +var id = 0; + +function Transition(groups, parents, name, id) { + this._groups = groups; + this._parents = parents; + this._name = name; + this._id = id; +} + +function transition_transition(name) { + return src_selection().transition(name); +} + +function newId() { + return ++id; +} + +var selection_prototype = src_selection.prototype; + +Transition.prototype = transition_transition.prototype = { + constructor: Transition, + select: transition_select, + selectAll: transition_selectAll, + selectChild: selection_prototype.selectChild, + selectChildren: selection_prototype.selectChildren, + filter: transition_filter, + merge: transition_merge, + selection: transition_selection, + transition: transition, + call: selection_prototype.call, + nodes: selection_prototype.nodes, + node: selection_prototype.node, + size: selection_prototype.size, + empty: selection_prototype.empty, + each: selection_prototype.each, + on: transition_on, + attr: transition_attr, + attrTween: transition_attrTween, + style: transition_style, + styleTween: transition_styleTween, + text: transition_text, + textTween: transition_textTween, + remove: transition_remove, + tween: tween, + delay: delay, + duration: duration, + ease: ease, + easeVarying: transition_easeVarying, + end: end, + [Symbol.iterator]: selection_prototype[Symbol.iterator] +}; + +;// CONCATENATED MODULE: ../node_modules/d3-ease/src/cubic.js +function cubicIn(t) { + return t * t * t; +} + +function cubicOut(t) { + return --t * t * t + 1; +} + +function cubicInOut(t) { + return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/selection/transition.js + + + + + +var defaultTiming = { + time: null, // Set on use. + delay: 0, + duration: 250, + ease: cubicInOut +}; + +function inherit(node, id) { + var timing; + while (!(timing = node.__transition) || !(timing = timing[id])) { + if (!(node = node.parentNode)) { + throw new Error(`transition ${id} not found`); + } + } + return timing; +} + +/* harmony default export */ function selection_transition(name) { + var id, + timing; + + if (name instanceof Transition) { + id = name._id, name = name._name; + } else { + id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + ""; + } + + for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { + if (node = group[i]) { + schedule(node, name, id, i, group, timing || inherit(node, id)); + } + } + } + + return new Transition(groups, this._parents, name, id); +} + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/selection/index.js + + + + +src_selection.prototype.interrupt = selection_interrupt; +src_selection.prototype.transition = selection_transition; + +;// CONCATENATED MODULE: ../node_modules/d3-transition/src/index.js + + + + + +;// CONCATENATED MODULE: ./tooltip.js +/* global event */ + + + + + + +function defaultLabel (d) { + return d.data.name +} + +function defaultFlamegraphTooltip () { + var rootElement = src_select('body') + var tooltip = null + // Function to get HTML content from data. + var html = defaultLabel + // Function to get text content from data. + var text = defaultLabel + // Whether to use d3's .html() to set content, otherwise use .text(). + var contentIsHTML = false + + function tip () { + tooltip = rootElement + .append('div') + .style('display', 'none') + .style('position', 'absolute') + .style('opacity', 0) + .style('pointer-events', 'none') + .attr('class', 'd3-flame-graph-tip') + } + + tip.show = function (d) { + tooltip + .style('display', 'block') + .style('left', event.pageX + 5 + 'px') + .style('top', event.pageY + 5 + 'px') + .transition() + .duration(200) + .style('opacity', 1) + .style('pointer-events', 'all') + + if (contentIsHTML) { + tooltip.html(html(d)) + } else { + tooltip.text(text(d)) + } + + return tip + } + + tip.hide = function () { + tooltip + .style('display', 'none') + .transition() + .duration(200) + .style('opacity', 0) + .style('pointer-events', 'none') + + return tip + } + + /** + * Gets/sets a function converting the d3 data into the tooltip's textContent. + * + * Cannot be combined with tip.html(). + */ + tip.text = function (_) { + if (!arguments.length) return text + text = _ + contentIsHTML = false + return tip + } + + /** + * Gets/sets a function converting the d3 data into the tooltip's innerHTML. + * + * Cannot be combined with tip.text(). + * + * @deprecated prefer tip.text(). + */ + tip.html = function (_) { + if (!arguments.length) return html + html = _ + contentIsHTML = true + return tip + } + + tip.destroy = function () { + tooltip.remove() + } + + return tip +} + +/******/ return __webpack_exports__; +/******/ })() +; +}); \ No newline at end of file diff --git a/development/charts/flamegraph/lib/d3-flamegraph.css b/development/charts/flamegraph/lib/d3-flamegraph.css new file mode 100644 index 000000000..fa6f345ff --- /dev/null +++ b/development/charts/flamegraph/lib/d3-flamegraph.css @@ -0,0 +1,46 @@ +.d3-flame-graph rect { + stroke: #EEEEEE; + fill-opacity: .8; +} + +.d3-flame-graph rect:hover { + stroke: #474747; + stroke-width: 0.5; + cursor: pointer; +} + +.d3-flame-graph-label { + pointer-events: none; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + font-size: 12px; + font-family: Verdana; + margin-left: 4px; + margin-right: 4px; + line-height: 1.5; + padding: 0 0 0; + font-weight: 400; + color: black; + text-align: left; +} + +.d3-flame-graph .fade { + opacity: 0.6 !important; +} + +.d3-flame-graph .title { + font-size: 20px; + font-family: Verdana; +} + +.d3-flame-graph-tip { + background-color: black; + border: none; + border-radius: 3px; + padding: 5px 10px 5px 10px; + min-width: 250px; + text-align: left; + color: white; + z-index: 10; +} \ No newline at end of file diff --git a/development/charts/flamegraph/lib/d3-flamegraph.js b/development/charts/flamegraph/lib/d3-flamegraph.js new file mode 100644 index 000000000..eabb2c449 --- /dev/null +++ b/development/charts/flamegraph/lib/d3-flamegraph.js @@ -0,0 +1,5719 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if (typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if (typeof define === 'function' && define.amd) define([], factory); + else if (typeof exports === 'object') exports['flamegraph'] = factory(); + else root['flamegraph'] = factory(); +})(self, function () { + return /******/ (() => { + // webpackBootstrap + /******/ 'use strict'; // The require scope + /******/ /******/ var __webpack_require__ = {}; /* webpack/runtime/define property getters */ + /******/ + /************************************************************************/ + /******/ /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ __webpack_require__.d = (exports, definition) => { + /******/ for (var key in definition) { + /******/ if ( + __webpack_require__.o(definition, key) && + !__webpack_require__.o(exports, key) + ) { + /******/ Object.defineProperty(exports, key, { + enumerable: true, + get: definition[key], + }); + /******/ + } + /******/ + } + /******/ + }; + /******/ + })(); /* webpack/runtime/hasOwnProperty shorthand */ + /******/ + /******/ /******/ (() => { + /******/ __webpack_require__.o = (obj, prop) => + Object.prototype.hasOwnProperty.call(obj, prop); + /******/ + })(); + /******/ + /************************************************************************/ + var __webpack_exports__ = {}; + + // EXPORTS + __webpack_require__.d(__webpack_exports__, { + default: () => /* binding */ flamegraph, + }); // CONCATENATED MODULE: ../node_modules/d3-selection/src/selector.js + + function none() {} + + /* harmony default export */ function selector(selector) { + return selector == null + ? none + : function () { + return this.querySelector(selector); + }; + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/select.js + + /* harmony default export */ function selection_select(select) { + if (typeof select !== 'function') select = selector(select); + + for ( + var groups = this._groups, + m = groups.length, + subgroups = new Array(m), + j = 0; + j < m; + ++j + ) { + for ( + var group = groups[j], + n = group.length, + subgroup = (subgroups[j] = new Array(n)), + node, + subnode, + i = 0; + i < n; + ++i + ) { + if ( + (node = group[i]) && + (subnode = select.call(node, node.__data__, i, group)) + ) { + if ('__data__' in node) subnode.__data__ = node.__data__; + subgroup[i] = subnode; + } + } + } + + return new Selection(subgroups, this._parents); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/array.js + + // Given something array like (or null), returns something that is strictly an + // array. This is used to ensure that array-like objects passed to d3.selectAll + // or selection.selectAll are converted into proper arrays when creating a + // selection; we don’t ever want to create a selection backed by a live + // HTMLCollection or NodeList. However, note that selection.selectAll will use a + // static NodeList as a group, since it safely derived from querySelectorAll. + function array(x) { + return x == null ? [] : Array.isArray(x) ? x : Array.from(x); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selectorAll.js + + function empty() { + return []; + } + + /* harmony default export */ function selectorAll(selector) { + return selector == null + ? empty + : function () { + return this.querySelectorAll(selector); + }; + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/selectAll.js + + function arrayAll(select) { + return function () { + return array(select.apply(this, arguments)); + }; + } + + /* harmony default export */ function selectAll(select) { + if (typeof select === 'function') select = arrayAll(select); + else select = selectorAll(select); + + for ( + var groups = this._groups, + m = groups.length, + subgroups = [], + parents = [], + j = 0; + j < m; + ++j + ) { + for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { + if ((node = group[i])) { + subgroups.push(select.call(node, node.__data__, i, group)); + parents.push(node); + } + } + } + + return new Selection(subgroups, parents); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/matcher.js + + /* harmony default export */ function matcher(selector) { + return function () { + return this.matches(selector); + }; + } + + function childMatcher(selector) { + return function (node) { + return node.matches(selector); + }; + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/selectChild.js + + var find = Array.prototype.find; + + function childFind(match) { + return function () { + return find.call(this.children, match); + }; + } + + function childFirst() { + return this.firstElementChild; + } + + /* harmony default export */ function selectChild(match) { + return this.select( + match == null + ? childFirst + : childFind( + typeof match === 'function' ? match : childMatcher(match), + ), + ); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/selectChildren.js + + var filter = Array.prototype.filter; + + function children() { + return Array.from(this.children); + } + + function childrenFilter(match) { + return function () { + return filter.call(this.children, match); + }; + } + + /* harmony default export */ function selectChildren(match) { + return this.selectAll( + match == null + ? children + : childrenFilter( + typeof match === 'function' ? match : childMatcher(match), + ), + ); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/filter.js + + /* harmony default export */ function selection_filter(match) { + if (typeof match !== 'function') match = matcher(match); + + for ( + var groups = this._groups, + m = groups.length, + subgroups = new Array(m), + j = 0; + j < m; + ++j + ) { + for ( + var group = groups[j], + n = group.length, + subgroup = (subgroups[j] = []), + node, + i = 0; + i < n; + ++i + ) { + if ((node = group[i]) && match.call(node, node.__data__, i, group)) { + subgroup.push(node); + } + } + } + + return new Selection(subgroups, this._parents); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/sparse.js + + /* harmony default export */ function sparse(update) { + return new Array(update.length); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/enter.js + + /* harmony default export */ function enter() { + return new Selection( + this._enter || this._groups.map(sparse), + this._parents, + ); + } + + function EnterNode(parent, datum) { + this.ownerDocument = parent.ownerDocument; + this.namespaceURI = parent.namespaceURI; + this._next = null; + this._parent = parent; + this.__data__ = datum; + } + + EnterNode.prototype = { + constructor: EnterNode, + appendChild: function (child) { + return this._parent.insertBefore(child, this._next); + }, + insertBefore: function (child, next) { + return this._parent.insertBefore(child, next); + }, + querySelector: function (selector) { + return this._parent.querySelector(selector); + }, + querySelectorAll: function (selector) { + return this._parent.querySelectorAll(selector); + }, + }; // CONCATENATED MODULE: ../node_modules/d3-selection/src/constant.js + + /* harmony default export */ function src_constant(x) { + return function () { + return x; + }; + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/data.js + + function bindIndex(parent, group, enter, update, exit, data) { + var i = 0, + node, + groupLength = group.length, + dataLength = data.length; + + // Put any non-null nodes that fit into update. + // Put any null nodes into enter. + // Put any remaining data into enter. + for (; i < dataLength; ++i) { + if ((node = group[i])) { + node.__data__ = data[i]; + update[i] = node; + } else { + enter[i] = new EnterNode(parent, data[i]); + } + } + + // Put any non-null nodes that don’t fit into exit. + for (; i < groupLength; ++i) { + if ((node = group[i])) { + exit[i] = node; + } + } + } + + function bindKey(parent, group, enter, update, exit, data, key) { + var i, + node, + nodeByKeyValue = new Map(), + groupLength = group.length, + dataLength = data.length, + keyValues = new Array(groupLength), + keyValue; + + // Compute the key for each node. + // If multiple nodes have the same key, the duplicates are added to exit. + for (i = 0; i < groupLength; ++i) { + if ((node = group[i])) { + keyValues[i] = keyValue = + key.call(node, node.__data__, i, group) + ''; + if (nodeByKeyValue.has(keyValue)) { + exit[i] = node; + } else { + nodeByKeyValue.set(keyValue, node); + } + } + } + + // Compute the key for each datum. + // If there a node associated with this key, join and add it to update. + // If there is not (or the key is a duplicate), add it to enter. + for (i = 0; i < dataLength; ++i) { + keyValue = key.call(parent, data[i], i, data) + ''; + if ((node = nodeByKeyValue.get(keyValue))) { + update[i] = node; + node.__data__ = data[i]; + nodeByKeyValue.delete(keyValue); + } else { + enter[i] = new EnterNode(parent, data[i]); + } + } + + // Add any remaining nodes that were not bound to data to exit. + for (i = 0; i < groupLength; ++i) { + if ((node = group[i]) && nodeByKeyValue.get(keyValues[i]) === node) { + exit[i] = node; + } + } + } + + function datum(node) { + return node.__data__; + } + + /* harmony default export */ function data(value, key) { + if (!arguments.length) return Array.from(this, datum); + + var bind = key ? bindKey : bindIndex, + parents = this._parents, + groups = this._groups; + + if (typeof value !== 'function') value = src_constant(value); + + for ( + var m = groups.length, + update = new Array(m), + enter = new Array(m), + exit = new Array(m), + j = 0; + j < m; + ++j + ) { + var parent = parents[j], + group = groups[j], + groupLength = group.length, + data = arraylike( + value.call(parent, parent && parent.__data__, j, parents), + ), + dataLength = data.length, + enterGroup = (enter[j] = new Array(dataLength)), + updateGroup = (update[j] = new Array(dataLength)), + exitGroup = (exit[j] = new Array(groupLength)); + + bind(parent, group, enterGroup, updateGroup, exitGroup, data, key); + + // Now connect the enter nodes to their following update node, such that + // appendChild can insert the materialized enter node before this node, + // rather than at the end of the parent node. + for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) { + if ((previous = enterGroup[i0])) { + if (i0 >= i1) i1 = i0 + 1; + while (!(next = updateGroup[i1]) && ++i1 < dataLength); + previous._next = next || null; + } + } + } + + update = new Selection(update, parents); + update._enter = enter; + update._exit = exit; + return update; + } + + // Given some data, this returns an array-like view of it: an object that + // exposes a length property and allows numeric indexing. Note that unlike + // selectAll, this isn’t worried about “live” collections because the resulting + // array will only be used briefly while data is being bound. (It is possible to + // cause the data to change while iterating by using a key function, but please + // don’t; we’d rather avoid a gratuitous copy.) + function arraylike(data) { + return typeof data === 'object' && 'length' in data + ? data // Array, TypedArray, NodeList, array-like + : Array.from(data); // Map, Set, iterable, string, or anything else + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/exit.js + + /* harmony default export */ function exit() { + return new Selection( + this._exit || this._groups.map(sparse), + this._parents, + ); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/join.js + + /* harmony default export */ function join(onenter, onupdate, onexit) { + var enter = this.enter(), + update = this, + exit = this.exit(); + if (typeof onenter === 'function') { + enter = onenter(enter); + if (enter) enter = enter.selection(); + } else { + enter = enter.append(onenter + ''); + } + if (onupdate != null) { + update = onupdate(update); + if (update) update = update.selection(); + } + if (onexit == null) exit.remove(); + else onexit(exit); + return enter && update ? enter.merge(update).order() : update; + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/merge.js + + /* harmony default export */ function merge(context) { + var selection = context.selection ? context.selection() : context; + + for ( + var groups0 = this._groups, + groups1 = selection._groups, + m0 = groups0.length, + m1 = groups1.length, + m = Math.min(m0, m1), + merges = new Array(m0), + j = 0; + j < m; + ++j + ) { + for ( + var group0 = groups0[j], + group1 = groups1[j], + n = group0.length, + merge = (merges[j] = new Array(n)), + node, + i = 0; + i < n; + ++i + ) { + if ((node = group0[i] || group1[i])) { + merge[i] = node; + } + } + } + + for (; j < m0; ++j) { + merges[j] = groups0[j]; + } + + return new Selection(merges, this._parents); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/order.js + + /* harmony default export */ function order() { + for (var groups = this._groups, j = -1, m = groups.length; ++j < m; ) { + for ( + var group = groups[j], i = group.length - 1, next = group[i], node; + --i >= 0; + + ) { + if ((node = group[i])) { + if (next && node.compareDocumentPosition(next) ^ 4) + next.parentNode.insertBefore(node, next); + next = node; + } + } + } + + return this; + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/sort.js + + /* harmony default export */ function sort(compare) { + if (!compare) compare = ascending; + + function compareNode(a, b) { + return a && b ? compare(a.__data__, b.__data__) : !a - !b; + } + + for ( + var groups = this._groups, + m = groups.length, + sortgroups = new Array(m), + j = 0; + j < m; + ++j + ) { + for ( + var group = groups[j], + n = group.length, + sortgroup = (sortgroups[j] = new Array(n)), + node, + i = 0; + i < n; + ++i + ) { + if ((node = group[i])) { + sortgroup[i] = node; + } + } + sortgroup.sort(compareNode); + } + + return new Selection(sortgroups, this._parents).order(); + } + + function ascending(a, b) { + return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/call.js + + /* harmony default export */ function call() { + var callback = arguments[0]; + arguments[0] = this; + callback.apply(null, arguments); + return this; + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/nodes.js + + /* harmony default export */ function nodes() { + return Array.from(this); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/node.js + + /* harmony default export */ function node() { + for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { + for (var group = groups[j], i = 0, n = group.length; i < n; ++i) { + var node = group[i]; + if (node) return node; + } + } + + return null; + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/size.js + + /* harmony default export */ function size() { + let size = 0; + for (const node of this) ++size; // eslint-disable-line no-unused-vars + return size; + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/empty.js + + /* harmony default export */ function selection_empty() { + return !this.node(); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/each.js + + /* harmony default export */ function each(callback) { + for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { + for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { + if ((node = group[i])) callback.call(node, node.__data__, i, group); + } + } + + return this; + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/namespaces.js + + var xhtml = 'http://www.w3.org/1999/xhtml'; + + /* harmony default export */ const namespaces = { + svg: 'http://www.w3.org/2000/svg', + xhtml: xhtml, + xlink: 'http://www.w3.org/1999/xlink', + xml: 'http://www.w3.org/XML/1998/namespace', + xmlns: 'http://www.w3.org/2000/xmlns/', + }; // CONCATENATED MODULE: ../node_modules/d3-selection/src/namespace.js + + /* harmony default export */ function namespace(name) { + var prefix = (name += ''), + i = prefix.indexOf(':'); + if (i >= 0 && (prefix = name.slice(0, i)) !== 'xmlns') + name = name.slice(i + 1); + return namespaces.hasOwnProperty(prefix) + ? { space: namespaces[prefix], local: name } + : name; // eslint-disable-line no-prototype-builtins + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/attr.js + + function attrRemove(name) { + return function () { + this.removeAttribute(name); + }; + } + + function attrRemoveNS(fullname) { + return function () { + this.removeAttributeNS(fullname.space, fullname.local); + }; + } + + function attrConstant(name, value) { + return function () { + this.setAttribute(name, value); + }; + } + + function attrConstantNS(fullname, value) { + return function () { + this.setAttributeNS(fullname.space, fullname.local, value); + }; + } + + function attrFunction(name, value) { + return function () { + var v = value.apply(this, arguments); + if (v == null) this.removeAttribute(name); + else this.setAttribute(name, v); + }; + } + + function attrFunctionNS(fullname, value) { + return function () { + var v = value.apply(this, arguments); + if (v == null) this.removeAttributeNS(fullname.space, fullname.local); + else this.setAttributeNS(fullname.space, fullname.local, v); + }; + } + + /* harmony default export */ function attr(name, value) { + var fullname = namespace(name); + + if (arguments.length < 2) { + var node = this.node(); + return fullname.local + ? node.getAttributeNS(fullname.space, fullname.local) + : node.getAttribute(fullname); + } + + return this.each( + (value == null + ? fullname.local + ? attrRemoveNS + : attrRemove + : typeof value === 'function' + ? fullname.local + ? attrFunctionNS + : attrFunction + : fullname.local + ? attrConstantNS + : attrConstant)(fullname, value), + ); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/window.js + + /* harmony default export */ function src_window(node) { + return ( + (node.ownerDocument && node.ownerDocument.defaultView) || // node is a Node + (node.document && node) || // node is a Window + node.defaultView + ); // node is a Document + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/style.js + + function styleRemove(name) { + return function () { + this.style.removeProperty(name); + }; + } + + function styleConstant(name, value, priority) { + return function () { + this.style.setProperty(name, value, priority); + }; + } + + function styleFunction(name, value, priority) { + return function () { + var v = value.apply(this, arguments); + if (v == null) this.style.removeProperty(name); + else this.style.setProperty(name, v, priority); + }; + } + + /* harmony default export */ function style(name, value, priority) { + return arguments.length > 1 + ? this.each( + (value == null + ? styleRemove + : typeof value === 'function' + ? styleFunction + : styleConstant)(name, value, priority == null ? '' : priority), + ) + : styleValue(this.node(), name); + } + + function styleValue(node, name) { + return ( + node.style.getPropertyValue(name) || + src_window(node).getComputedStyle(node, null).getPropertyValue(name) + ); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/property.js + + function propertyRemove(name) { + return function () { + delete this[name]; + }; + } + + function propertyConstant(name, value) { + return function () { + this[name] = value; + }; + } + + function propertyFunction(name, value) { + return function () { + var v = value.apply(this, arguments); + if (v == null) delete this[name]; + else this[name] = v; + }; + } + + /* harmony default export */ function property(name, value) { + return arguments.length > 1 + ? this.each( + (value == null + ? propertyRemove + : typeof value === 'function' + ? propertyFunction + : propertyConstant)(name, value), + ) + : this.node()[name]; + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/classed.js + + function classArray(string) { + return string.trim().split(/^|\s+/); + } + + function classList(node) { + return node.classList || new ClassList(node); + } + + function ClassList(node) { + this._node = node; + this._names = classArray(node.getAttribute('class') || ''); + } + + ClassList.prototype = { + add: function (name) { + var i = this._names.indexOf(name); + if (i < 0) { + this._names.push(name); + this._node.setAttribute('class', this._names.join(' ')); + } + }, + remove: function (name) { + var i = this._names.indexOf(name); + if (i >= 0) { + this._names.splice(i, 1); + this._node.setAttribute('class', this._names.join(' ')); + } + }, + contains: function (name) { + return this._names.indexOf(name) >= 0; + }, + }; + + function classedAdd(node, names) { + var list = classList(node), + i = -1, + n = names.length; + while (++i < n) list.add(names[i]); + } + + function classedRemove(node, names) { + var list = classList(node), + i = -1, + n = names.length; + while (++i < n) list.remove(names[i]); + } + + function classedTrue(names) { + return function () { + classedAdd(this, names); + }; + } + + function classedFalse(names) { + return function () { + classedRemove(this, names); + }; + } + + function classedFunction(names, value) { + return function () { + (value.apply(this, arguments) ? classedAdd : classedRemove)( + this, + names, + ); + }; + } + + /* harmony default export */ function classed(name, value) { + var names = classArray(name + ''); + + if (arguments.length < 2) { + var list = classList(this.node()), + i = -1, + n = names.length; + while (++i < n) if (!list.contains(names[i])) return false; + return true; + } + + return this.each( + (typeof value === 'function' + ? classedFunction + : value + ? classedTrue + : classedFalse)(names, value), + ); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/text.js + + function textRemove() { + this.textContent = ''; + } + + function textConstant(value) { + return function () { + this.textContent = value; + }; + } + + function textFunction(value) { + return function () { + var v = value.apply(this, arguments); + this.textContent = v == null ? '' : v; + }; + } + + /* harmony default export */ function selection_text(value) { + return arguments.length + ? this.each( + value == null + ? textRemove + : (typeof value === 'function' ? textFunction : textConstant)( + value, + ), + ) + : this.node().textContent; + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/html.js + + function htmlRemove() { + this.innerHTML = ''; + } + + function htmlConstant(value) { + return function () { + this.innerHTML = value; + }; + } + + function htmlFunction(value) { + return function () { + var v = value.apply(this, arguments); + this.innerHTML = v == null ? '' : v; + }; + } + + /* harmony default export */ function html(value) { + return arguments.length + ? this.each( + value == null + ? htmlRemove + : (typeof value === 'function' ? htmlFunction : htmlConstant)( + value, + ), + ) + : this.node().innerHTML; + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/raise.js + + function raise() { + if (this.nextSibling) this.parentNode.appendChild(this); + } + + /* harmony default export */ function selection_raise() { + return this.each(raise); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/lower.js + + function lower() { + if (this.previousSibling) + this.parentNode.insertBefore(this, this.parentNode.firstChild); + } + + /* harmony default export */ function selection_lower() { + return this.each(lower); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/creator.js + + function creatorInherit(name) { + return function () { + var document = this.ownerDocument, + uri = this.namespaceURI; + return uri === xhtml && document.documentElement.namespaceURI === xhtml + ? document.createElement(name) + : document.createElementNS(uri, name); + }; + } + + function creatorFixed(fullname) { + return function () { + return this.ownerDocument.createElementNS( + fullname.space, + fullname.local, + ); + }; + } + + /* harmony default export */ function creator(name) { + var fullname = namespace(name); + return (fullname.local ? creatorFixed : creatorInherit)(fullname); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/append.js + + /* harmony default export */ function append(name) { + var create = typeof name === 'function' ? name : creator(name); + return this.select(function () { + return this.appendChild(create.apply(this, arguments)); + }); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/insert.js + + function constantNull() { + return null; + } + + /* harmony default export */ function insert(name, before) { + var create = typeof name === 'function' ? name : creator(name), + select = + before == null + ? constantNull + : typeof before === 'function' + ? before + : selector(before); + return this.select(function () { + return this.insertBefore( + create.apply(this, arguments), + select.apply(this, arguments) || null, + ); + }); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/remove.js + + function remove() { + var parent = this.parentNode; + if (parent) parent.removeChild(this); + } + + /* harmony default export */ function selection_remove() { + return this.each(remove); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/clone.js + + function selection_cloneShallow() { + var clone = this.cloneNode(false), + parent = this.parentNode; + return parent ? parent.insertBefore(clone, this.nextSibling) : clone; + } + + function selection_cloneDeep() { + var clone = this.cloneNode(true), + parent = this.parentNode; + return parent ? parent.insertBefore(clone, this.nextSibling) : clone; + } + + /* harmony default export */ function clone(deep) { + return this.select(deep ? selection_cloneDeep : selection_cloneShallow); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/datum.js + + /* harmony default export */ function selection_datum(value) { + return arguments.length + ? this.property('__data__', value) + : this.node().__data__; + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/on.js + + function contextListener(listener) { + return function (event) { + listener.call(this, event, this.__data__); + }; + } + + function parseTypenames(typenames) { + return typenames + .trim() + .split(/^|\s+/) + .map(function (t) { + var name = '', + i = t.indexOf('.'); + if (i >= 0) (name = t.slice(i + 1)), (t = t.slice(0, i)); + return { type: t, name: name }; + }); + } + + function onRemove(typename) { + return function () { + var on = this.__on; + if (!on) return; + for (var j = 0, i = -1, m = on.length, o; j < m; ++j) { + if ( + ((o = on[j]), + (!typename.type || o.type === typename.type) && + o.name === typename.name) + ) { + this.removeEventListener(o.type, o.listener, o.options); + } else { + on[++i] = o; + } + } + if (++i) on.length = i; + else delete this.__on; + }; + } + + function onAdd(typename, value, options) { + return function () { + var on = this.__on, + o, + listener = contextListener(value); + if (on) + for (var j = 0, m = on.length; j < m; ++j) { + if ( + (o = on[j]).type === typename.type && + o.name === typename.name + ) { + this.removeEventListener(o.type, o.listener, o.options); + this.addEventListener( + o.type, + (o.listener = listener), + (o.options = options), + ); + o.value = value; + return; + } + } + this.addEventListener(typename.type, listener, options); + o = { + type: typename.type, + name: typename.name, + value: value, + listener: listener, + options: options, + }; + if (!on) this.__on = [o]; + else on.push(o); + }; + } + + /* harmony default export */ function on(typename, value, options) { + var typenames = parseTypenames(typename + ''), + i, + n = typenames.length, + t; + + if (arguments.length < 2) { + var on = this.node().__on; + if (on) + for (var j = 0, m = on.length, o; j < m; ++j) { + for (i = 0, o = on[j]; i < n; ++i) { + if ((t = typenames[i]).type === o.type && t.name === o.name) { + return o.value; + } + } + } + return; + } + + on = value ? onAdd : onRemove; + for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options)); + return this; + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/dispatch.js + + function dispatchEvent(node, type, params) { + var window = src_window(node), + event = window.CustomEvent; + + if (typeof event === 'function') { + event = new event(type, params); + } else { + event = window.document.createEvent('Event'); + if (params) + event.initEvent(type, params.bubbles, params.cancelable), + (event.detail = params.detail); + else event.initEvent(type, false, false); + } + + node.dispatchEvent(event); + } + + function dispatchConstant(type, params) { + return function () { + return dispatchEvent(this, type, params); + }; + } + + function dispatchFunction(type, params) { + return function () { + return dispatchEvent(this, type, params.apply(this, arguments)); + }; + } + + /* harmony default export */ function dispatch(type, params) { + return this.each( + (typeof params === 'function' ? dispatchFunction : dispatchConstant)( + type, + params, + ), + ); + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/iterator.js + + /* harmony default export */ function* iterator() { + for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { + for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { + if ((node = group[i])) yield node; + } + } + } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/index.js + + var root = [null]; + + function Selection(groups, parents) { + this._groups = groups; + this._parents = parents; + } + + function selection() { + return new Selection([[document.documentElement]], root); + } + + function selection_selection() { + return this; + } + + Selection.prototype = selection.prototype = { + constructor: Selection, + select: selection_select, + selectAll: selectAll, + selectChild: selectChild, + selectChildren: selectChildren, + filter: selection_filter, + data: data, + enter: enter, + exit: exit, + join: join, + merge: merge, + selection: selection_selection, + order: order, + sort: sort, + call: call, + nodes: nodes, + node: node, + size: size, + empty: selection_empty, + each: each, + attr: attr, + style: style, + property: property, + classed: classed, + text: selection_text, + html: html, + raise: selection_raise, + lower: selection_lower, + append: append, + insert: insert, + remove: selection_remove, + clone: clone, + datum: selection_datum, + on: on, + dispatch: dispatch, + [Symbol.iterator]: iterator, + }; + + /* harmony default export */ const src_selection = selection; // CONCATENATED MODULE: ../node_modules/d3-selection/src/select.js + + /* harmony default export */ function src_select(selector) { + return typeof selector === 'string' + ? new Selection( + [[document.querySelector(selector)]], + [document.documentElement], + ) + : new Selection([[selector]], root); + } // CONCATENATED MODULE: ../node_modules/d3-format/src/formatDecimal.js + + /* harmony default export */ function formatDecimal(x) { + return Math.abs((x = Math.round(x))) >= 1e21 + ? x.toLocaleString('en').replace(/,/g, '') + : x.toString(10); + } + + // Computes the decimal coefficient and exponent of the specified number x with + // significant digits p, where x is positive and p is in [1, 21] or undefined. + // For example, formatDecimalParts(1.23) returns ["123", 0]. + function formatDecimalParts(x, p) { + if ( + (i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf( + 'e', + )) < 0 + ) + return null; // NaN, ±Infinity + var i, + coefficient = x.slice(0, i); + + // The string returned by toExponential either has the form \d\.\d+e[-+]\d+ + // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3). + return [ + coefficient.length > 1 + ? coefficient[0] + coefficient.slice(2) + : coefficient, + +x.slice(i + 1), + ]; + } // CONCATENATED MODULE: ../node_modules/d3-format/src/exponent.js + + /* harmony default export */ function exponent(x) { + return (x = formatDecimalParts(Math.abs(x))), x ? x[1] : NaN; + } // CONCATENATED MODULE: ../node_modules/d3-format/src/formatGroup.js + + /* harmony default export */ function formatGroup(grouping, thousands) { + return function (value, width) { + var i = value.length, + t = [], + j = 0, + g = grouping[0], + length = 0; + + while (i > 0 && g > 0) { + if (length + g + 1 > width) g = Math.max(1, width - length); + t.push(value.substring((i -= g), i + g)); + if ((length += g + 1) > width) break; + g = grouping[(j = (j + 1) % grouping.length)]; + } + + return t.reverse().join(thousands); + }; + } // CONCATENATED MODULE: ../node_modules/d3-format/src/formatNumerals.js + + /* harmony default export */ function formatNumerals(numerals) { + return function (value) { + return value.replace(/[0-9]/g, function (i) { + return numerals[+i]; + }); + }; + } // CONCATENATED MODULE: ../node_modules/d3-format/src/formatSpecifier.js + + // [[fill]align][sign][symbol][0][width][,][.precision][~][type] + var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; + + function formatSpecifier(specifier) { + if (!(match = re.exec(specifier))) + throw new Error('invalid format: ' + specifier); + var match; + return new FormatSpecifier({ + fill: match[1], + align: match[2], + sign: match[3], + symbol: match[4], + zero: match[5], + width: match[6], + comma: match[7], + precision: match[8] && match[8].slice(1), + trim: match[9], + type: match[10], + }); + } + + formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof + + function FormatSpecifier(specifier) { + this.fill = specifier.fill === undefined ? ' ' : specifier.fill + ''; + this.align = specifier.align === undefined ? '>' : specifier.align + ''; + this.sign = specifier.sign === undefined ? '-' : specifier.sign + ''; + this.symbol = specifier.symbol === undefined ? '' : specifier.symbol + ''; + this.zero = !!specifier.zero; + this.width = specifier.width === undefined ? undefined : +specifier.width; + this.comma = !!specifier.comma; + this.precision = + specifier.precision === undefined ? undefined : +specifier.precision; + this.trim = !!specifier.trim; + this.type = specifier.type === undefined ? '' : specifier.type + ''; + } + + FormatSpecifier.prototype.toString = function () { + return ( + this.fill + + this.align + + this.sign + + this.symbol + + (this.zero ? '0' : '') + + (this.width === undefined ? '' : Math.max(1, this.width | 0)) + + (this.comma ? ',' : '') + + (this.precision === undefined + ? '' + : '.' + Math.max(0, this.precision | 0)) + + (this.trim ? '~' : '') + + this.type + ); + }; // CONCATENATED MODULE: ../node_modules/d3-format/src/formatTrim.js + + // Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k. + /* harmony default export */ function formatTrim(s) { + out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) { + switch (s[i]) { + case '.': + i0 = i1 = i; + break; + case '0': + if (i0 === 0) i0 = i; + i1 = i; + break; + default: + if (!+s[i]) break out; + if (i0 > 0) i0 = 0; + break; + } + } + return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s; + } // CONCATENATED MODULE: ../node_modules/d3-format/src/formatPrefixAuto.js + + var prefixExponent; + + /* harmony default export */ function formatPrefixAuto(x, p) { + var d = formatDecimalParts(x, p); + if (!d) return x + ''; + var coefficient = d[0], + exponent = d[1], + i = + exponent - + (prefixExponent = + Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + + 1, + n = coefficient.length; + return i === n + ? coefficient + : i > n + ? coefficient + new Array(i - n + 1).join('0') + : i > 0 + ? coefficient.slice(0, i) + '.' + coefficient.slice(i) + : '0.' + + new Array(1 - i).join('0') + + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y! + } // CONCATENATED MODULE: ../node_modules/d3-format/src/formatRounded.js + + /* harmony default export */ function formatRounded(x, p) { + var d = formatDecimalParts(x, p); + if (!d) return x + ''; + var coefficient = d[0], + exponent = d[1]; + return exponent < 0 + ? '0.' + new Array(-exponent).join('0') + coefficient + : coefficient.length > exponent + 1 + ? coefficient.slice(0, exponent + 1) + + '.' + + coefficient.slice(exponent + 1) + : coefficient + new Array(exponent - coefficient.length + 2).join('0'); + } // CONCATENATED MODULE: ../node_modules/d3-format/src/formatTypes.js + + /* harmony default export */ const formatTypes = { + '%': (x, p) => (x * 100).toFixed(p), + b: (x) => Math.round(x).toString(2), + c: (x) => x + '', + d: formatDecimal, + e: (x, p) => x.toExponential(p), + f: (x, p) => x.toFixed(p), + g: (x, p) => x.toPrecision(p), + o: (x) => Math.round(x).toString(8), + p: (x, p) => formatRounded(x * 100, p), + r: formatRounded, + s: formatPrefixAuto, + X: (x) => Math.round(x).toString(16).toUpperCase(), + x: (x) => Math.round(x).toString(16), + }; // CONCATENATED MODULE: ../node_modules/d3-format/src/identity.js + + /* harmony default export */ function identity(x) { + return x; + } // CONCATENATED MODULE: ../node_modules/d3-format/src/locale.js + + var map = Array.prototype.map, + prefixes = [ + 'y', + 'z', + 'a', + 'f', + 'p', + 'n', + 'µ', + 'm', + '', + 'k', + 'M', + 'G', + 'T', + 'P', + 'E', + 'Z', + 'Y', + ]; + + /* harmony default export */ function locale(locale) { + var group = + locale.grouping === undefined || locale.thousands === undefined + ? identity + : formatGroup( + map.call(locale.grouping, Number), + locale.thousands + '', + ), + currencyPrefix = + locale.currency === undefined ? '' : locale.currency[0] + '', + currencySuffix = + locale.currency === undefined ? '' : locale.currency[1] + '', + decimal = locale.decimal === undefined ? '.' : locale.decimal + '', + numerals = + locale.numerals === undefined + ? identity + : formatNumerals(map.call(locale.numerals, String)), + percent = locale.percent === undefined ? '%' : locale.percent + '', + minus = locale.minus === undefined ? '−' : locale.minus + '', + nan = locale.nan === undefined ? 'NaN' : locale.nan + ''; + + function newFormat(specifier) { + specifier = formatSpecifier(specifier); + + var fill = specifier.fill, + align = specifier.align, + sign = specifier.sign, + symbol = specifier.symbol, + zero = specifier.zero, + width = specifier.width, + comma = specifier.comma, + precision = specifier.precision, + trim = specifier.trim, + type = specifier.type; + + // The "n" type is an alias for ",g". + if (type === 'n') (comma = true), (type = 'g'); + // The "" type, and any invalid type, is an alias for ".12~g". + else if (!formatTypes[type]) + precision === undefined && (precision = 12), + (trim = true), + (type = 'g'); + + // If zero fill is specified, padding goes after sign and before digits. + if (zero || (fill === '0' && align === '=')) + (zero = true), (fill = '0'), (align = '='); + + // Compute the prefix and suffix. + // For SI-prefix, the suffix is lazily computed. + var prefix = + symbol === '$' + ? currencyPrefix + : symbol === '#' && /[boxX]/.test(type) + ? '0' + type.toLowerCase() + : '', + suffix = + symbol === '$' ? currencySuffix : /[%p]/.test(type) ? percent : ''; + + // What format function should we use? + // Is this an integer type? + // Can this type generate exponential notation? + var formatType = formatTypes[type], + maybeSuffix = /[defgprs%]/.test(type); + + // Set the default precision if not specified, + // or clamp the specified precision to the supported range. + // For significant precision, it must be in [1, 21]. + // For fixed precision, it must be in [0, 20]. + precision = + precision === undefined + ? 6 + : /[gprs]/.test(type) + ? Math.max(1, Math.min(21, precision)) + : Math.max(0, Math.min(20, precision)); + + function format(value) { + var valuePrefix = prefix, + valueSuffix = suffix, + i, + n, + c; + + if (type === 'c') { + valueSuffix = formatType(value) + valueSuffix; + value = ''; + } else { + value = +value; + + // Determine the sign. -0 is not less than 0, but 1 / -0 is! + var valueNegative = value < 0 || 1 / value < 0; + + // Perform the initial formatting. + value = isNaN(value) ? nan : formatType(Math.abs(value), precision); + + // Trim insignificant zeros. + if (trim) value = formatTrim(value); + + // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign. + if (valueNegative && +value === 0 && sign !== '+') + valueNegative = false; + + // Compute the prefix and suffix. + valuePrefix = + (valueNegative + ? sign === '(' + ? sign + : minus + : sign === '-' || sign === '(' + ? '' + : sign) + valuePrefix; + valueSuffix = + (type === 's' ? prefixes[8 + prefixExponent / 3] : '') + + valueSuffix + + (valueNegative && sign === '(' ? ')' : ''); + + // Break the formatted value into the integer “value” part that can be + // grouped, and fractional or exponential “suffix” part that is not. + if (maybeSuffix) { + (i = -1), (n = value.length); + while (++i < n) { + if (((c = value.charCodeAt(i)), 48 > c || c > 57)) { + valueSuffix = + (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + + valueSuffix; + value = value.slice(0, i); + break; + } + } + } + } + + // If the fill character is not "0", grouping is applied before padding. + if (comma && !zero) value = group(value, Infinity); + + // Compute the padding. + var length = valuePrefix.length + value.length + valueSuffix.length, + padding = + length < width ? new Array(width - length + 1).join(fill) : ''; + + // If the fill character is "0", grouping is applied after padding. + if (comma && zero) + (value = group( + padding + value, + padding.length ? width - valueSuffix.length : Infinity, + )), + (padding = ''); + + // Reconstruct the final output based on the desired alignment. + switch (align) { + case '<': + value = valuePrefix + value + valueSuffix + padding; + break; + case '=': + value = valuePrefix + padding + value + valueSuffix; + break; + case '^': + value = + padding.slice(0, (length = padding.length >> 1)) + + valuePrefix + + value + + valueSuffix + + padding.slice(length); + break; + default: + value = padding + valuePrefix + value + valueSuffix; + break; + } + + return numerals(value); + } + + format.toString = function () { + return specifier + ''; + }; + + return format; + } + + function formatPrefix(specifier, value) { + var f = newFormat( + ((specifier = formatSpecifier(specifier)), + (specifier.type = 'f'), + specifier), + ), + e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3, + k = Math.pow(10, -e), + prefix = prefixes[8 + e / 3]; + return function (value) { + return f(k * value) + prefix; + }; + } + + return { + format: newFormat, + formatPrefix: formatPrefix, + }; + } // CONCATENATED MODULE: ../node_modules/d3-format/src/defaultLocale.js + + var defaultLocale_locale; + var format; + var formatPrefix; + + defaultLocale({ + thousands: ',', + grouping: [3], + currency: ['$', ''], + }); + + function defaultLocale(definition) { + defaultLocale_locale = locale(definition); + format = defaultLocale_locale.format; + formatPrefix = defaultLocale_locale.formatPrefix; + return defaultLocale_locale; + } // CONCATENATED MODULE: ../node_modules/d3-array/src/ascending.js + + function ascending_ascending(a, b) { + return a == null || b == null + ? NaN + : a < b + ? -1 + : a > b + ? 1 + : a >= b + ? 0 + : NaN; + } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/treemap/round.js + + /* harmony default export */ function treemap_round(node) { + node.x0 = Math.round(node.x0); + node.y0 = Math.round(node.y0); + node.x1 = Math.round(node.x1); + node.y1 = Math.round(node.y1); + } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/treemap/dice.js + + /* harmony default export */ function dice(parent, x0, y0, x1, y1) { + var nodes = parent.children, + node, + i = -1, + n = nodes.length, + k = parent.value && (x1 - x0) / parent.value; + + while (++i < n) { + (node = nodes[i]), (node.y0 = y0), (node.y1 = y1); + (node.x0 = x0), (node.x1 = x0 += node.value * k); + } + } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/partition.js + + /* harmony default export */ function partition() { + var dx = 1, + dy = 1, + padding = 0, + round = false; + + function partition(root) { + var n = root.height + 1; + root.x0 = root.y0 = padding; + root.x1 = dx; + root.y1 = dy / n; + root.eachBefore(positionNode(dy, n)); + if (round) root.eachBefore(treemap_round); + return root; + } + + function positionNode(dy, n) { + return function (node) { + if (node.children) { + dice( + node, + node.x0, + (dy * (node.depth + 1)) / n, + node.x1, + (dy * (node.depth + 2)) / n, + ); + } + var x0 = node.x0, + y0 = node.y0, + x1 = node.x1 - padding, + y1 = node.y1 - padding; + if (x1 < x0) x0 = x1 = (x0 + x1) / 2; + if (y1 < y0) y0 = y1 = (y0 + y1) / 2; + node.x0 = x0; + node.y0 = y0; + node.x1 = x1; + node.y1 = y1; + }; + } + + partition.round = function (x) { + return arguments.length ? ((round = !!x), partition) : round; + }; + + partition.size = function (x) { + return arguments.length + ? ((dx = +x[0]), (dy = +x[1]), partition) + : [dx, dy]; + }; + + partition.padding = function (x) { + return arguments.length ? ((padding = +x), partition) : padding; + }; + + return partition; + } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/count.js + + function count(node) { + var sum = 0, + children = node.children, + i = children && children.length; + if (!i) sum = 1; + else while (--i >= 0) sum += children[i].value; + node.value = sum; + } + + /* harmony default export */ function hierarchy_count() { + return this.eachAfter(count); + } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/each.js + + /* harmony default export */ function hierarchy_each(callback, that) { + let index = -1; + for (const node of this) { + callback.call(that, node, ++index, this); + } + return this; + } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/eachBefore.js + + /* harmony default export */ function eachBefore(callback, that) { + var node = this, + nodes = [node], + children, + i, + index = -1; + while ((node = nodes.pop())) { + callback.call(that, node, ++index, this); + if ((children = node.children)) { + for (i = children.length - 1; i >= 0; --i) { + nodes.push(children[i]); + } + } + } + return this; + } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/eachAfter.js + + /* harmony default export */ function eachAfter(callback, that) { + var node = this, + nodes = [node], + next = [], + children, + i, + n, + index = -1; + while ((node = nodes.pop())) { + next.push(node); + if ((children = node.children)) { + for (i = 0, n = children.length; i < n; ++i) { + nodes.push(children[i]); + } + } + } + while ((node = next.pop())) { + callback.call(that, node, ++index, this); + } + return this; + } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/find.js + + /* harmony default export */ function hierarchy_find(callback, that) { + let index = -1; + for (const node of this) { + if (callback.call(that, node, ++index, this)) { + return node; + } + } + } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/sum.js + + /* harmony default export */ function sum(value) { + return this.eachAfter(function (node) { + var sum = +value(node.data) || 0, + children = node.children, + i = children && children.length; + while (--i >= 0) sum += children[i].value; + node.value = sum; + }); + } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/sort.js + + /* harmony default export */ function hierarchy_sort(compare) { + return this.eachBefore(function (node) { + if (node.children) { + node.children.sort(compare); + } + }); + } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/path.js + + /* harmony default export */ function path(end) { + var start = this, + ancestor = leastCommonAncestor(start, end), + nodes = [start]; + while (start !== ancestor) { + start = start.parent; + nodes.push(start); + } + var k = nodes.length; + while (end !== ancestor) { + nodes.splice(k, 0, end); + end = end.parent; + } + return nodes; + } + + function leastCommonAncestor(a, b) { + if (a === b) return a; + var aNodes = a.ancestors(), + bNodes = b.ancestors(), + c = null; + a = aNodes.pop(); + b = bNodes.pop(); + while (a === b) { + c = a; + a = aNodes.pop(); + b = bNodes.pop(); + } + return c; + } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/ancestors.js + + /* harmony default export */ function ancestors() { + var node = this, + nodes = [node]; + while ((node = node.parent)) { + nodes.push(node); + } + return nodes; + } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/descendants.js + + /* harmony default export */ function descendants() { + return Array.from(this); + } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/leaves.js + + /* harmony default export */ function leaves() { + var leaves = []; + this.eachBefore(function (node) { + if (!node.children) { + leaves.push(node); + } + }); + return leaves; + } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/links.js + + /* harmony default export */ function links() { + var root = this, + links = []; + root.each(function (node) { + if (node !== root) { + // Don’t include the root’s parent, if any. + links.push({ source: node.parent, target: node }); + } + }); + return links; + } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/iterator.js + + /* harmony default export */ function* hierarchy_iterator() { + var node = this, + current, + next = [node], + children, + i, + n; + do { + (current = next.reverse()), (next = []); + while ((node = current.pop())) { + yield node; + if ((children = node.children)) { + for (i = 0, n = children.length; i < n; ++i) { + next.push(children[i]); + } + } + } + } while (next.length); + } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/index.js + + function hierarchy(data, children) { + if (data instanceof Map) { + data = [undefined, data]; + if (children === undefined) children = mapChildren; + } else if (children === undefined) { + children = objectChildren; + } + + var root = new Node(data), + node, + nodes = [root], + child, + childs, + i, + n; + + while ((node = nodes.pop())) { + if ( + (childs = children(node.data)) && + (n = (childs = Array.from(childs)).length) + ) { + node.children = childs; + for (i = n - 1; i >= 0; --i) { + nodes.push((child = childs[i] = new Node(childs[i]))); + child.parent = node; + child.depth = node.depth + 1; + } + } + } + + return root.eachBefore(computeHeight); + } + + function node_copy() { + return hierarchy(this).eachBefore(copyData); + } + + function objectChildren(d) { + return d.children; + } + + function mapChildren(d) { + return Array.isArray(d) ? d[1] : null; + } + + function copyData(node) { + if (node.data.value !== undefined) node.value = node.data.value; + node.data = node.data.data; + } + + function computeHeight(node) { + var height = 0; + do node.height = height; + while ((node = node.parent) && node.height < ++height); + } + + function Node(data) { + this.data = data; + this.depth = this.height = 0; + this.parent = null; + } + + Node.prototype = hierarchy.prototype = { + constructor: Node, + count: hierarchy_count, + each: hierarchy_each, + eachAfter: eachAfter, + eachBefore: eachBefore, + find: hierarchy_find, + sum: sum, + sort: hierarchy_sort, + path: path, + ancestors: ancestors, + descendants: descendants, + leaves: leaves, + links: links, + copy: node_copy, + [Symbol.iterator]: hierarchy_iterator, + }; // CONCATENATED MODULE: ../node_modules/d3-array/src/ticks.js + + var e10 = Math.sqrt(50), + e5 = Math.sqrt(10), + e2 = Math.sqrt(2); + + function ticks(start, stop, count) { + var reverse, + i = -1, + n, + ticks, + step; + + (stop = +stop), (start = +start), (count = +count); + if (start === stop && count > 0) return [start]; + if ((reverse = stop < start)) (n = start), (start = stop), (stop = n); + if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) + return []; + + if (step > 0) { + let r0 = Math.round(start / step), + r1 = Math.round(stop / step); + if (r0 * step < start) ++r0; + if (r1 * step > stop) --r1; + ticks = new Array((n = r1 - r0 + 1)); + while (++i < n) ticks[i] = (r0 + i) * step; + } else { + step = -step; + let r0 = Math.round(start * step), + r1 = Math.round(stop * step); + if (r0 / step < start) ++r0; + if (r1 / step > stop) --r1; + ticks = new Array((n = r1 - r0 + 1)); + while (++i < n) ticks[i] = (r0 + i) / step; + } + + if (reverse) ticks.reverse(); + + return ticks; + } + + function tickIncrement(start, stop, count) { + var step = (stop - start) / Math.max(0, count), + power = Math.floor(Math.log(step) / Math.LN10), + error = step / Math.pow(10, power); + return power >= 0 + ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * + Math.pow(10, power) + : -Math.pow(10, -power) / + (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1); + } + + function tickStep(start, stop, count) { + var step0 = Math.abs(stop - start) / Math.max(0, count), + step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)), + error = step0 / step1; + if (error >= e10) step1 *= 10; + else if (error >= e5) step1 *= 5; + else if (error >= e2) step1 *= 2; + return stop < start ? -step1 : step1; + } // CONCATENATED MODULE: ../node_modules/d3-array/src/bisector.js + + function bisector(f) { + let delta = f; + let compare1 = f; + let compare2 = f; + + if (f.length !== 2) { + delta = (d, x) => f(d) - x; + compare1 = ascending_ascending; + compare2 = (d, x) => ascending_ascending(f(d), x); + } + + function left(a, x, lo = 0, hi = a.length) { + if (lo < hi) { + if (compare1(x, x) !== 0) return hi; + do { + const mid = (lo + hi) >>> 1; + if (compare2(a[mid], x) < 0) lo = mid + 1; + else hi = mid; + } while (lo < hi); + } + return lo; + } + + function right(a, x, lo = 0, hi = a.length) { + if (lo < hi) { + if (compare1(x, x) !== 0) return hi; + do { + const mid = (lo + hi) >>> 1; + if (compare2(a[mid], x) <= 0) lo = mid + 1; + else hi = mid; + } while (lo < hi); + } + return lo; + } + + function center(a, x, lo = 0, hi = a.length) { + const i = left(a, x, lo, hi - 1); + return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i; + } + + return { left, center, right }; + } // CONCATENATED MODULE: ../node_modules/d3-array/src/number.js + + function number(x) { + return x === null ? NaN : +x; + } + + function* numbers(values, valueof) { + if (valueof === undefined) { + for (let value of values) { + if (value != null && (value = +value) >= value) { + yield value; + } + } + } else { + let index = -1; + for (let value of values) { + if ( + (value = valueof(value, ++index, values)) != null && + (value = +value) >= value + ) { + yield value; + } + } + } + } // CONCATENATED MODULE: ../node_modules/d3-array/src/bisect.js + + const ascendingBisect = bisector(ascending_ascending); + const bisectRight = ascendingBisect.right; + const bisectLeft = ascendingBisect.left; + const bisectCenter = bisector(number).center; + /* harmony default export */ const bisect = bisectRight; // CONCATENATED MODULE: ../node_modules/d3-color/src/define.js + + /* harmony default export */ function src_define( + constructor, + factory, + prototype, + ) { + constructor.prototype = factory.prototype = prototype; + prototype.constructor = constructor; + } + + function extend(parent, definition) { + var prototype = Object.create(parent.prototype); + for (var key in definition) prototype[key] = definition[key]; + return prototype; + } // CONCATENATED MODULE: ../node_modules/d3-color/src/color.js + + function Color() {} + + var darker = 0.7; + var brighter = 1 / darker; + + var reI = '\\s*([+-]?\\d+)\\s*', + reN = '\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*', + reP = '\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*', + reHex = /^#([0-9a-f]{3,8})$/, + reRgbInteger = new RegExp('^rgb\\(' + [reI, reI, reI] + '\\)$'), + reRgbPercent = new RegExp('^rgb\\(' + [reP, reP, reP] + '\\)$'), + reRgbaInteger = new RegExp('^rgba\\(' + [reI, reI, reI, reN] + '\\)$'), + reRgbaPercent = new RegExp('^rgba\\(' + [reP, reP, reP, reN] + '\\)$'), + reHslPercent = new RegExp('^hsl\\(' + [reN, reP, reP] + '\\)$'), + reHslaPercent = new RegExp('^hsla\\(' + [reN, reP, reP, reN] + '\\)$'); + + var named = { + aliceblue: 0xf0f8ff, + antiquewhite: 0xfaebd7, + aqua: 0x00ffff, + aquamarine: 0x7fffd4, + azure: 0xf0ffff, + beige: 0xf5f5dc, + bisque: 0xffe4c4, + black: 0x000000, + blanchedalmond: 0xffebcd, + blue: 0x0000ff, + blueviolet: 0x8a2be2, + brown: 0xa52a2a, + burlywood: 0xdeb887, + cadetblue: 0x5f9ea0, + chartreuse: 0x7fff00, + chocolate: 0xd2691e, + coral: 0xff7f50, + cornflowerblue: 0x6495ed, + cornsilk: 0xfff8dc, + crimson: 0xdc143c, + cyan: 0x00ffff, + darkblue: 0x00008b, + darkcyan: 0x008b8b, + darkgoldenrod: 0xb8860b, + darkgray: 0xa9a9a9, + darkgreen: 0x006400, + darkgrey: 0xa9a9a9, + darkkhaki: 0xbdb76b, + darkmagenta: 0x8b008b, + darkolivegreen: 0x556b2f, + darkorange: 0xff8c00, + darkorchid: 0x9932cc, + darkred: 0x8b0000, + darksalmon: 0xe9967a, + darkseagreen: 0x8fbc8f, + darkslateblue: 0x483d8b, + darkslategray: 0x2f4f4f, + darkslategrey: 0x2f4f4f, + darkturquoise: 0x00ced1, + darkviolet: 0x9400d3, + deeppink: 0xff1493, + deepskyblue: 0x00bfff, + dimgray: 0x696969, + dimgrey: 0x696969, + dodgerblue: 0x1e90ff, + firebrick: 0xb22222, + floralwhite: 0xfffaf0, + forestgreen: 0x228b22, + fuchsia: 0xff00ff, + gainsboro: 0xdcdcdc, + ghostwhite: 0xf8f8ff, + gold: 0xffd700, + goldenrod: 0xdaa520, + gray: 0x808080, + green: 0x008000, + greenyellow: 0xadff2f, + grey: 0x808080, + honeydew: 0xf0fff0, + hotpink: 0xff69b4, + indianred: 0xcd5c5c, + indigo: 0x4b0082, + ivory: 0xfffff0, + khaki: 0xf0e68c, + lavender: 0xe6e6fa, + lavenderblush: 0xfff0f5, + lawngreen: 0x7cfc00, + lemonchiffon: 0xfffacd, + lightblue: 0xadd8e6, + lightcoral: 0xf08080, + lightcyan: 0xe0ffff, + lightgoldenrodyellow: 0xfafad2, + lightgray: 0xd3d3d3, + lightgreen: 0x90ee90, + lightgrey: 0xd3d3d3, + lightpink: 0xffb6c1, + lightsalmon: 0xffa07a, + lightseagreen: 0x20b2aa, + lightskyblue: 0x87cefa, + lightslategray: 0x778899, + lightslategrey: 0x778899, + lightsteelblue: 0xb0c4de, + lightyellow: 0xffffe0, + lime: 0x00ff00, + limegreen: 0x32cd32, + linen: 0xfaf0e6, + magenta: 0xff00ff, + maroon: 0x800000, + mediumaquamarine: 0x66cdaa, + mediumblue: 0x0000cd, + mediumorchid: 0xba55d3, + mediumpurple: 0x9370db, + mediumseagreen: 0x3cb371, + mediumslateblue: 0x7b68ee, + mediumspringgreen: 0x00fa9a, + mediumturquoise: 0x48d1cc, + mediumvioletred: 0xc71585, + midnightblue: 0x191970, + mintcream: 0xf5fffa, + mistyrose: 0xffe4e1, + moccasin: 0xffe4b5, + navajowhite: 0xffdead, + navy: 0x000080, + oldlace: 0xfdf5e6, + olive: 0x808000, + olivedrab: 0x6b8e23, + orange: 0xffa500, + orangered: 0xff4500, + orchid: 0xda70d6, + palegoldenrod: 0xeee8aa, + palegreen: 0x98fb98, + paleturquoise: 0xafeeee, + palevioletred: 0xdb7093, + papayawhip: 0xffefd5, + peachpuff: 0xffdab9, + peru: 0xcd853f, + pink: 0xffc0cb, + plum: 0xdda0dd, + powderblue: 0xb0e0e6, + purple: 0x800080, + rebeccapurple: 0x663399, + red: 0xff0000, + rosybrown: 0xbc8f8f, + royalblue: 0x4169e1, + saddlebrown: 0x8b4513, + salmon: 0xfa8072, + sandybrown: 0xf4a460, + seagreen: 0x2e8b57, + seashell: 0xfff5ee, + sienna: 0xa0522d, + silver: 0xc0c0c0, + skyblue: 0x87ceeb, + slateblue: 0x6a5acd, + slategray: 0x708090, + slategrey: 0x708090, + snow: 0xfffafa, + springgreen: 0x00ff7f, + steelblue: 0x4682b4, + tan: 0xd2b48c, + teal: 0x008080, + thistle: 0xd8bfd8, + tomato: 0xff6347, + turquoise: 0x40e0d0, + violet: 0xee82ee, + wheat: 0xf5deb3, + white: 0xffffff, + whitesmoke: 0xf5f5f5, + yellow: 0xffff00, + yellowgreen: 0x9acd32, + }; + + src_define(Color, color, { + copy: function (channels) { + return Object.assign(new this.constructor(), this, channels); + }, + displayable: function () { + return this.rgb().displayable(); + }, + hex: color_formatHex, // Deprecated! Use color.formatHex. + formatHex: color_formatHex, + formatHsl: color_formatHsl, + formatRgb: color_formatRgb, + toString: color_formatRgb, + }); + + function color_formatHex() { + return this.rgb().formatHex(); + } + + function color_formatHsl() { + return hslConvert(this).formatHsl(); + } + + function color_formatRgb() { + return this.rgb().formatRgb(); + } + + function color(format) { + var m, l; + format = (format + '').trim().toLowerCase(); + return (m = reHex.exec(format)) + ? ((l = m[1].length), + (m = parseInt(m[1], 16)), + l === 6 + ? rgbn(m) // #ff0000 + : l === 3 + ? new Rgb( + ((m >> 8) & 0xf) | ((m >> 4) & 0xf0), + ((m >> 4) & 0xf) | (m & 0xf0), + ((m & 0xf) << 4) | (m & 0xf), + 1, + ) // #f00 + : l === 8 + ? rgba( + (m >> 24) & 0xff, + (m >> 16) & 0xff, + (m >> 8) & 0xff, + (m & 0xff) / 0xff, + ) // #ff000000 + : l === 4 + ? rgba( + ((m >> 12) & 0xf) | ((m >> 8) & 0xf0), + ((m >> 8) & 0xf) | ((m >> 4) & 0xf0), + ((m >> 4) & 0xf) | (m & 0xf0), + (((m & 0xf) << 4) | (m & 0xf)) / 0xff, + ) // #f000 + : null) // invalid hex + : (m = reRgbInteger.exec(format)) + ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0) + : (m = reRgbPercent.exec(format)) + ? new Rgb((m[1] * 255) / 100, (m[2] * 255) / 100, (m[3] * 255) / 100, 1) // rgb(100%, 0%, 0%) + : (m = reRgbaInteger.exec(format)) + ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) + : (m = reRgbaPercent.exec(format)) + ? rgba((m[1] * 255) / 100, (m[2] * 255) / 100, (m[3] * 255) / 100, m[4]) // rgb(100%, 0%, 0%, 1) + : (m = reHslPercent.exec(format)) + ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) + : (m = reHslaPercent.exec(format)) + ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) + : named.hasOwnProperty(format) + ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins + : format === 'transparent' + ? new Rgb(NaN, NaN, NaN, 0) + : null; + } + + function rgbn(n) { + return new Rgb((n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff, 1); + } + + function rgba(r, g, b, a) { + if (a <= 0) r = g = b = NaN; + return new Rgb(r, g, b, a); + } + + function rgbConvert(o) { + if (!(o instanceof Color)) o = color(o); + if (!o) return new Rgb(); + o = o.rgb(); + return new Rgb(o.r, o.g, o.b, o.opacity); + } + + function color_rgb(r, g, b, opacity) { + return arguments.length === 1 + ? rgbConvert(r) + : new Rgb(r, g, b, opacity == null ? 1 : opacity); + } + + function Rgb(r, g, b, opacity) { + this.r = +r; + this.g = +g; + this.b = +b; + this.opacity = +opacity; + } + + src_define( + Rgb, + color_rgb, + extend(Color, { + brighter: function (k) { + k = k == null ? brighter : Math.pow(brighter, k); + return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); + }, + darker: function (k) { + k = k == null ? darker : Math.pow(darker, k); + return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); + }, + rgb: function () { + return this; + }, + displayable: function () { + return ( + -0.5 <= this.r && + this.r < 255.5 && + -0.5 <= this.g && + this.g < 255.5 && + -0.5 <= this.b && + this.b < 255.5 && + 0 <= this.opacity && + this.opacity <= 1 + ); + }, + hex: rgb_formatHex, // Deprecated! Use color.formatHex. + formatHex: rgb_formatHex, + formatRgb: rgb_formatRgb, + toString: rgb_formatRgb, + }), + ); + + function rgb_formatHex() { + return '#' + hex(this.r) + hex(this.g) + hex(this.b); + } + + function rgb_formatRgb() { + var a = this.opacity; + a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); + return ( + (a === 1 ? 'rgb(' : 'rgba(') + + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + + ', ' + + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + + ', ' + + Math.max(0, Math.min(255, Math.round(this.b) || 0)) + + (a === 1 ? ')' : ', ' + a + ')') + ); + } + + function hex(value) { + value = Math.max(0, Math.min(255, Math.round(value) || 0)); + return (value < 16 ? '0' : '') + value.toString(16); + } + + function hsla(h, s, l, a) { + if (a <= 0) h = s = l = NaN; + else if (l <= 0 || l >= 1) h = s = NaN; + else if (s <= 0) h = NaN; + return new Hsl(h, s, l, a); + } + + function hslConvert(o) { + if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); + if (!(o instanceof Color)) o = color(o); + if (!o) return new Hsl(); + if (o instanceof Hsl) return o; + o = o.rgb(); + var r = o.r / 255, + g = o.g / 255, + b = o.b / 255, + min = Math.min(r, g, b), + max = Math.max(r, g, b), + h = NaN, + s = max - min, + l = (max + min) / 2; + if (s) { + if (r === max) h = (g - b) / s + (g < b) * 6; + else if (g === max) h = (b - r) / s + 2; + else h = (r - g) / s + 4; + s /= l < 0.5 ? max + min : 2 - max - min; + h *= 60; + } else { + s = l > 0 && l < 1 ? 0 : h; + } + return new Hsl(h, s, l, o.opacity); + } + + function hsl(h, s, l, opacity) { + return arguments.length === 1 + ? hslConvert(h) + : new Hsl(h, s, l, opacity == null ? 1 : opacity); + } + + function Hsl(h, s, l, opacity) { + this.h = +h; + this.s = +s; + this.l = +l; + this.opacity = +opacity; + } + + src_define( + Hsl, + hsl, + extend(Color, { + brighter: function (k) { + k = k == null ? brighter : Math.pow(brighter, k); + return new Hsl(this.h, this.s, this.l * k, this.opacity); + }, + darker: function (k) { + k = k == null ? darker : Math.pow(darker, k); + return new Hsl(this.h, this.s, this.l * k, this.opacity); + }, + rgb: function () { + var h = (this.h % 360) + (this.h < 0) * 360, + s = isNaN(h) || isNaN(this.s) ? 0 : this.s, + l = this.l, + m2 = l + (l < 0.5 ? l : 1 - l) * s, + m1 = 2 * l - m2; + return new Rgb( + hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), + hsl2rgb(h, m1, m2), + hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), + this.opacity, + ); + }, + displayable: function () { + return ( + ((0 <= this.s && this.s <= 1) || isNaN(this.s)) && + 0 <= this.l && + this.l <= 1 && + 0 <= this.opacity && + this.opacity <= 1 + ); + }, + formatHsl: function () { + var a = this.opacity; + a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); + return ( + (a === 1 ? 'hsl(' : 'hsla(') + + (this.h || 0) + + ', ' + + (this.s || 0) * 100 + + '%, ' + + (this.l || 0) * 100 + + '%' + + (a === 1 ? ')' : ', ' + a + ')') + ); + }, + }), + ); + + /* From FvD 13.37, CSS Color Module Level 3 */ + function hsl2rgb(h, m1, m2) { + return ( + (h < 60 + ? m1 + ((m2 - m1) * h) / 60 + : h < 180 + ? m2 + : h < 240 + ? m1 + ((m2 - m1) * (240 - h)) / 60 + : m1) * 255 + ); + } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/basis.js + + function basis(t1, v0, v1, v2, v3) { + var t2 = t1 * t1, + t3 = t2 * t1; + return ( + ((1 - 3 * t1 + 3 * t2 - t3) * v0 + + (4 - 6 * t2 + 3 * t3) * v1 + + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 + + t3 * v3) / + 6 + ); + } + + /* harmony default export */ function src_basis(values) { + var n = values.length - 1; + return function (t) { + var i = + t <= 0 ? (t = 0) : t >= 1 ? ((t = 1), n - 1) : Math.floor(t * n), + v1 = values[i], + v2 = values[i + 1], + v0 = i > 0 ? values[i - 1] : 2 * v1 - v2, + v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1; + return basis((t - i / n) * n, v0, v1, v2, v3); + }; + } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/basisClosed.js + + /* harmony default export */ function basisClosed(values) { + var n = values.length; + return function (t) { + var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n), + v0 = values[(i + n - 1) % n], + v1 = values[i % n], + v2 = values[(i + 1) % n], + v3 = values[(i + 2) % n]; + return basis((t - i / n) * n, v0, v1, v2, v3); + }; + } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/constant.js + + /* harmony default export */ const d3_interpolate_src_constant = ( + x, + ) => () => x; // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/color.js + + function linear(a, d) { + return function (t) { + return a + t * d; + }; + } + + function exponential(a, b, y) { + return ( + (a = Math.pow(a, y)), + (b = Math.pow(b, y) - a), + (y = 1 / y), + function (t) { + return Math.pow(a + t * b, y); + } + ); + } + + function hue(a, b) { + var d = b - a; + return d + ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) + : constant(isNaN(a) ? b : a); + } + + function gamma(y) { + return (y = +y) === 1 + ? nogamma + : function (a, b) { + return b - a + ? exponential(a, b, y) + : d3_interpolate_src_constant(isNaN(a) ? b : a); + }; + } + + function nogamma(a, b) { + var d = b - a; + return d ? linear(a, d) : d3_interpolate_src_constant(isNaN(a) ? b : a); + } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/rgb.js + + /* harmony default export */ const rgb = (function rgbGamma(y) { + var color = gamma(y); + + function rgb(start, end) { + var r = color((start = color_rgb(start)).r, (end = color_rgb(end)).r), + g = color(start.g, end.g), + b = color(start.b, end.b), + opacity = nogamma(start.opacity, end.opacity); + return function (t) { + start.r = r(t); + start.g = g(t); + start.b = b(t); + start.opacity = opacity(t); + return start + ''; + }; + } + + rgb.gamma = rgbGamma; + + return rgb; + })(1); + + function rgbSpline(spline) { + return function (colors) { + var n = colors.length, + r = new Array(n), + g = new Array(n), + b = new Array(n), + i, + color; + for (i = 0; i < n; ++i) { + color = color_rgb(colors[i]); + r[i] = color.r || 0; + g[i] = color.g || 0; + b[i] = color.b || 0; + } + r = spline(r); + g = spline(g); + b = spline(b); + color.opacity = 1; + return function (t) { + color.r = r(t); + color.g = g(t); + color.b = b(t); + return color + ''; + }; + }; + } + + var rgbBasis = rgbSpline(src_basis); + var rgbBasisClosed = rgbSpline(basisClosed); // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/array.js + + /* harmony default export */ function src_array(a, b) { + return (isNumberArray(b) ? numberArray : genericArray)(a, b); + } + + function genericArray(a, b) { + var nb = b ? b.length : 0, + na = a ? Math.min(nb, a.length) : 0, + x = new Array(na), + c = new Array(nb), + i; + + for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]); + for (; i < nb; ++i) c[i] = b[i]; + + return function (t) { + for (i = 0; i < na; ++i) c[i] = x[i](t); + return c; + }; + } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/date.js + + /* harmony default export */ function date(a, b) { + var d = new Date(); + return ( + (a = +a), + (b = +b), + function (t) { + return d.setTime(a * (1 - t) + b * t), d; + } + ); + } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/number.js + + /* harmony default export */ function src_number(a, b) { + return ( + (a = +a), + (b = +b), + function (t) { + return a * (1 - t) + b * t; + } + ); + } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/object.js + + /* harmony default export */ function object(a, b) { + var i = {}, + c = {}, + k; + + if (a === null || typeof a !== 'object') a = {}; + if (b === null || typeof b !== 'object') b = {}; + + for (k in b) { + if (k in a) { + i[k] = value(a[k], b[k]); + } else { + c[k] = b[k]; + } + } + + return function (t) { + for (k in i) c[k] = i[k](t); + return c; + }; + } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/string.js + + var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, + reB = new RegExp(reA.source, 'g'); + + function zero(b) { + return function () { + return b; + }; + } + + function one(b) { + return function (t) { + return b(t) + ''; + }; + } + + /* harmony default export */ function string(a, b) { + var bi = (reA.lastIndex = reB.lastIndex = 0), // scan index for next number in b + am, // current match in a + bm, // current match in b + bs, // string preceding current number in b, if any + i = -1, // index in s + s = [], // string constants and placeholders + q = []; // number interpolators + + // Coerce inputs to strings. + (a = a + ''), (b = b + ''); + + // Interpolate pairs of numbers in a & b. + while ((am = reA.exec(a)) && (bm = reB.exec(b))) { + if ((bs = bm.index) > bi) { + // a string precedes the next number in b + bs = b.slice(bi, bs); + if (s[i]) s[i] += bs; + // coalesce with previous string + else s[++i] = bs; + } + if ((am = am[0]) === (bm = bm[0])) { + // numbers in a & b match + if (s[i]) s[i] += bm; + // coalesce with previous string + else s[++i] = bm; + } else { + // interpolate non-matching numbers + s[++i] = null; + q.push({ i: i, x: src_number(am, bm) }); + } + bi = reB.lastIndex; + } + + // Add remains of b. + if (bi < b.length) { + bs = b.slice(bi); + if (s[i]) s[i] += bs; + // coalesce with previous string + else s[++i] = bs; + } + + // Special optimization for only a single match. + // Otherwise, interpolate each of the numbers and rejoin the string. + return s.length < 2 + ? q[0] + ? one(q[0].x) + : zero(b) + : ((b = q.length), + function (t) { + for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t); + return s.join(''); + }); + } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/numberArray.js + + /* harmony default export */ function src_numberArray(a, b) { + if (!b) b = []; + var n = a ? Math.min(b.length, a.length) : 0, + c = b.slice(), + i; + return function (t) { + for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t; + return c; + }; + } + + function numberArray_isNumberArray(x) { + return ArrayBuffer.isView(x) && !(x instanceof DataView); + } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/value.js + + /* harmony default export */ function value(a, b) { + var t = typeof b, + c; + return b == null || t === 'boolean' + ? d3_interpolate_src_constant(b) + : (t === 'number' + ? src_number + : t === 'string' + ? (c = color(b)) + ? ((b = c), rgb) + : string + : b instanceof color + ? rgb + : b instanceof Date + ? date + : numberArray_isNumberArray(b) + ? src_numberArray + : Array.isArray(b) + ? genericArray + : (typeof b.valueOf !== 'function' && + typeof b.toString !== 'function') || + isNaN(b) + ? object + : src_number)(a, b); + } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/round.js + + /* harmony default export */ function round(a, b) { + return ( + (a = +a), + (b = +b), + function (t) { + return Math.round(a * (1 - t) + b * t); + } + ); + } // CONCATENATED MODULE: ../node_modules/d3-scale/src/constant.js + + function constants(x) { + return function () { + return x; + }; + } // CONCATENATED MODULE: ../node_modules/d3-scale/src/number.js + + function number_number(x) { + return +x; + } // CONCATENATED MODULE: ../node_modules/d3-scale/src/continuous.js + + var unit = [0, 1]; + + function continuous_identity(x) { + return x; + } + + function normalize(a, b) { + return (b -= a = +a) + ? function (x) { + return (x - a) / b; + } + : constants(isNaN(b) ? NaN : 0.5); + } + + function clamper(a, b) { + var t; + if (a > b) (t = a), (a = b), (b = t); + return function (x) { + return Math.max(a, Math.min(b, x)); + }; + } + + // normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1]. + // interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b]. + function bimap(domain, range, interpolate) { + var d0 = domain[0], + d1 = domain[1], + r0 = range[0], + r1 = range[1]; + if (d1 < d0) (d0 = normalize(d1, d0)), (r0 = interpolate(r1, r0)); + else (d0 = normalize(d0, d1)), (r0 = interpolate(r0, r1)); + return function (x) { + return r0(d0(x)); + }; + } + + function polymap(domain, range, interpolate) { + var j = Math.min(domain.length, range.length) - 1, + d = new Array(j), + r = new Array(j), + i = -1; + + // Reverse descending domains. + if (domain[j] < domain[0]) { + domain = domain.slice().reverse(); + range = range.slice().reverse(); + } + + while (++i < j) { + d[i] = normalize(domain[i], domain[i + 1]); + r[i] = interpolate(range[i], range[i + 1]); + } + + return function (x) { + var i = bisect(domain, x, 1, j) - 1; + return r[i](d[i](x)); + }; + } + + function copy(source, target) { + return target + .domain(source.domain()) + .range(source.range()) + .interpolate(source.interpolate()) + .clamp(source.clamp()) + .unknown(source.unknown()); + } + + function transformer() { + var domain = unit, + range = unit, + interpolate = value, + transform, + untransform, + unknown, + clamp = continuous_identity, + piecewise, + output, + input; + + function rescale() { + var n = Math.min(domain.length, range.length); + if (clamp !== continuous_identity) + clamp = clamper(domain[0], domain[n - 1]); + piecewise = n > 2 ? polymap : bimap; + output = input = null; + return scale; + } + + function scale(x) { + return x == null || isNaN((x = +x)) + ? unknown + : ( + output || + (output = piecewise(domain.map(transform), range, interpolate)) + )(transform(clamp(x))); + } + + scale.invert = function (y) { + return clamp( + untransform( + ( + input || + (input = piecewise(range, domain.map(transform), src_number)) + )(y), + ), + ); + }; + + scale.domain = function (_) { + return arguments.length + ? ((domain = Array.from(_, number_number)), rescale()) + : domain.slice(); + }; + + scale.range = function (_) { + return arguments.length + ? ((range = Array.from(_)), rescale()) + : range.slice(); + }; + + scale.rangeRound = function (_) { + return (range = Array.from(_)), (interpolate = round), rescale(); + }; + + scale.clamp = function (_) { + return arguments.length + ? ((clamp = _ ? true : continuous_identity), rescale()) + : clamp !== continuous_identity; + }; + + scale.interpolate = function (_) { + return arguments.length ? ((interpolate = _), rescale()) : interpolate; + }; + + scale.unknown = function (_) { + return arguments.length ? ((unknown = _), scale) : unknown; + }; + + return function (t, u) { + (transform = t), (untransform = u); + return rescale(); + }; + } + + function continuous() { + return transformer()(continuous_identity, continuous_identity); + } // CONCATENATED MODULE: ../node_modules/d3-scale/src/init.js + + function initRange(domain, range) { + switch (arguments.length) { + case 0: + break; + case 1: + this.range(domain); + break; + default: + this.range(range).domain(domain); + break; + } + return this; + } + + function initInterpolator(domain, interpolator) { + switch (arguments.length) { + case 0: + break; + case 1: { + if (typeof domain === 'function') this.interpolator(domain); + else this.range(domain); + break; + } + default: { + this.domain(domain); + if (typeof interpolator === 'function') + this.interpolator(interpolator); + else this.range(interpolator); + break; + } + } + return this; + } // CONCATENATED MODULE: ../node_modules/d3-format/src/precisionPrefix.js + + /* harmony default export */ function precisionPrefix(step, value) { + return Math.max( + 0, + Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - + exponent(Math.abs(step)), + ); + } // CONCATENATED MODULE: ../node_modules/d3-format/src/precisionRound.js + + /* harmony default export */ function precisionRound(step, max) { + (step = Math.abs(step)), (max = Math.abs(max) - step); + return Math.max(0, exponent(max) - exponent(step)) + 1; + } // CONCATENATED MODULE: ../node_modules/d3-format/src/precisionFixed.js + + /* harmony default export */ function precisionFixed(step) { + return Math.max(0, -exponent(Math.abs(step))); + } // CONCATENATED MODULE: ../node_modules/d3-scale/src/tickFormat.js + + function tickFormat(start, stop, count, specifier) { + var step = tickStep(start, stop, count), + precision; + specifier = formatSpecifier(specifier == null ? ',f' : specifier); + switch (specifier.type) { + case 's': { + var value = Math.max(Math.abs(start), Math.abs(stop)); + if ( + specifier.precision == null && + !isNaN((precision = precisionPrefix(step, value))) + ) + specifier.precision = precision; + return formatPrefix(specifier, value); + } + case '': + case 'e': + case 'g': + case 'p': + case 'r': { + if ( + specifier.precision == null && + !isNaN( + (precision = precisionRound( + step, + Math.max(Math.abs(start), Math.abs(stop)), + )), + ) + ) + specifier.precision = precision - (specifier.type === 'e'); + break; + } + case 'f': + case '%': { + if ( + specifier.precision == null && + !isNaN((precision = precisionFixed(step))) + ) + specifier.precision = precision - (specifier.type === '%') * 2; + break; + } + } + return format(specifier); + } // CONCATENATED MODULE: ../node_modules/d3-scale/src/linear.js + + function linearish(scale) { + var domain = scale.domain; + + scale.ticks = function (count) { + var d = domain(); + return ticks(d[0], d[d.length - 1], count == null ? 10 : count); + }; + + scale.tickFormat = function (count, specifier) { + var d = domain(); + return tickFormat( + d[0], + d[d.length - 1], + count == null ? 10 : count, + specifier, + ); + }; + + scale.nice = function (count) { + if (count == null) count = 10; + + var d = domain(); + var i0 = 0; + var i1 = d.length - 1; + var start = d[i0]; + var stop = d[i1]; + var prestep; + var step; + var maxIter = 10; + + if (stop < start) { + (step = start), (start = stop), (stop = step); + (step = i0), (i0 = i1), (i1 = step); + } + + while (maxIter-- > 0) { + step = tickIncrement(start, stop, count); + if (step === prestep) { + d[i0] = start; + d[i1] = stop; + return domain(d); + } else if (step > 0) { + start = Math.floor(start / step) * step; + stop = Math.ceil(stop / step) * step; + } else if (step < 0) { + start = Math.ceil(start * step) / step; + stop = Math.floor(stop * step) / step; + } else { + break; + } + prestep = step; + } + + return scale; + }; + + return scale; + } + + function linear_linear() { + var scale = continuous(); + + scale.copy = function () { + return copy(scale, linear_linear()); + }; + + initRange.apply(scale, arguments); + + return linearish(scale); + } // CONCATENATED MODULE: ../node_modules/d3-ease/src/cubic.js + + function cubicIn(t) { + return t * t * t; + } + + function cubicOut(t) { + return --t * t * t + 1; + } + + function cubicInOut(t) { + return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; + } // CONCATENATED MODULE: ../node_modules/d3-dispatch/src/dispatch.js + + var noop = { value: () => {} }; + + function dispatch_dispatch() { + for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) { + if (!(t = arguments[i] + '') || t in _ || /[\s.]/.test(t)) + throw new Error('illegal type: ' + t); + _[t] = []; + } + return new Dispatch(_); + } + + function Dispatch(_) { + this._ = _; + } + + function dispatch_parseTypenames(typenames, types) { + return typenames + .trim() + .split(/^|\s+/) + .map(function (t) { + var name = '', + i = t.indexOf('.'); + if (i >= 0) (name = t.slice(i + 1)), (t = t.slice(0, i)); + if (t && !types.hasOwnProperty(t)) + throw new Error('unknown type: ' + t); + return { type: t, name: name }; + }); + } + + Dispatch.prototype = dispatch_dispatch.prototype = { + constructor: Dispatch, + on: function (typename, callback) { + var _ = this._, + T = dispatch_parseTypenames(typename + '', _), + t, + i = -1, + n = T.length; + + // If no callback was specified, return the callback of the given type and name. + if (arguments.length < 2) { + while (++i < n) + if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) + return t; + return; + } + + // If a type was specified, set the callback for the given type and name. + // Otherwise, if a null callback was specified, remove callbacks of the given name. + if (callback != null && typeof callback !== 'function') + throw new Error('invalid callback: ' + callback); + while (++i < n) { + if ((t = (typename = T[i]).type)) + _[t] = set(_[t], typename.name, callback); + else if (callback == null) + for (t in _) _[t] = set(_[t], typename.name, null); + } + + return this; + }, + copy: function () { + var copy = {}, + _ = this._; + for (var t in _) copy[t] = _[t].slice(); + return new Dispatch(copy); + }, + call: function (type, that) { + if ((n = arguments.length - 2) > 0) + for (var args = new Array(n), i = 0, n, t; i < n; ++i) + args[i] = arguments[i + 2]; + if (!this._.hasOwnProperty(type)) + throw new Error('unknown type: ' + type); + for (t = this._[type], i = 0, n = t.length; i < n; ++i) + t[i].value.apply(that, args); + }, + apply: function (type, that, args) { + if (!this._.hasOwnProperty(type)) + throw new Error('unknown type: ' + type); + for (var t = this._[type], i = 0, n = t.length; i < n; ++i) + t[i].value.apply(that, args); + }, + }; + + function get(type, name) { + for (var i = 0, n = type.length, c; i < n; ++i) { + if ((c = type[i]).name === name) { + return c.value; + } + } + } + + function set(type, name, callback) { + for (var i = 0, n = type.length; i < n; ++i) { + if (type[i].name === name) { + (type[i] = noop), (type = type.slice(0, i).concat(type.slice(i + 1))); + break; + } + } + if (callback != null) type.push({ name: name, value: callback }); + return type; + } + + /* harmony default export */ const src_dispatch = dispatch_dispatch; // CONCATENATED MODULE: ../node_modules/d3-timer/src/timer.js + + var timer_frame = 0, // is an animation frame pending? + timeout = 0, // is a timeout pending? + interval = 0, // are any timers active? + pokeDelay = 1000, // how frequently we check for clock skew + taskHead, + taskTail, + clockLast = 0, + clockNow = 0, + clockSkew = 0, + clock = + typeof performance === 'object' && performance.now ? performance : Date, + setFrame = + typeof window === 'object' && window.requestAnimationFrame + ? window.requestAnimationFrame.bind(window) + : function (f) { + setTimeout(f, 17); + }; + + function now() { + return ( + clockNow || (setFrame(clearNow), (clockNow = clock.now() + clockSkew)) + ); + } + + function clearNow() { + clockNow = 0; + } + + function Timer() { + this._call = this._time = this._next = null; + } + + Timer.prototype = timer.prototype = { + constructor: Timer, + restart: function (callback, delay, time) { + if (typeof callback !== 'function') + throw new TypeError('callback is not a function'); + time = (time == null ? now() : +time) + (delay == null ? 0 : +delay); + if (!this._next && taskTail !== this) { + if (taskTail) taskTail._next = this; + else taskHead = this; + taskTail = this; + } + this._call = callback; + this._time = time; + sleep(); + }, + stop: function () { + if (this._call) { + this._call = null; + this._time = Infinity; + sleep(); + } + }, + }; + + function timer(callback, delay, time) { + var t = new Timer(); + t.restart(callback, delay, time); + return t; + } + + function timerFlush() { + now(); // Get the current time, if not already set. + ++timer_frame; // Pretend we’ve set an alarm, if we haven’t already. + var t = taskHead, + e; + while (t) { + if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e); + t = t._next; + } + --timer_frame; + } + + function wake() { + clockNow = (clockLast = clock.now()) + clockSkew; + timer_frame = timeout = 0; + try { + timerFlush(); + } finally { + timer_frame = 0; + nap(); + clockNow = 0; + } + } + + function poke() { + var now = clock.now(), + delay = now - clockLast; + if (delay > pokeDelay) (clockSkew -= delay), (clockLast = now); + } + + function nap() { + var t0, + t1 = taskHead, + t2, + time = Infinity; + while (t1) { + if (t1._call) { + if (time > t1._time) time = t1._time; + (t0 = t1), (t1 = t1._next); + } else { + (t2 = t1._next), (t1._next = null); + t1 = t0 ? (t0._next = t2) : (taskHead = t2); + } + } + taskTail = t0; + sleep(time); + } + + function sleep(time) { + if (timer_frame) return; // Soonest alarm already set, or will be. + if (timeout) timeout = clearTimeout(timeout); + var delay = time - clockNow; // Strictly less than if we recomputed clockNow. + if (delay > 24) { + if (time < Infinity) + timeout = setTimeout(wake, time - clock.now() - clockSkew); + if (interval) interval = clearInterval(interval); + } else { + if (!interval) + (clockLast = clock.now()), (interval = setInterval(poke, pokeDelay)); + (timer_frame = 1), setFrame(wake); + } + } // CONCATENATED MODULE: ../node_modules/d3-timer/src/timeout.js + + /* harmony default export */ function src_timeout(callback, delay, time) { + var t = new Timer(); + delay = delay == null ? 0 : +delay; + t.restart( + (elapsed) => { + t.stop(); + callback(elapsed + delay); + }, + delay, + time, + ); + return t; + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/schedule.js + + var emptyOn = src_dispatch('start', 'end', 'cancel', 'interrupt'); + var emptyTween = []; + + var CREATED = 0; + var SCHEDULED = 1; + var STARTING = 2; + var STARTED = 3; + var RUNNING = 4; + var ENDING = 5; + var ENDED = 6; + + /* harmony default export */ function schedule( + node, + name, + id, + index, + group, + timing, + ) { + var schedules = node.__transition; + if (!schedules) node.__transition = {}; + else if (id in schedules) return; + create(node, id, { + name: name, + index: index, // For context during callback. + group: group, // For context during callback. + on: emptyOn, + tween: emptyTween, + time: timing.time, + delay: timing.delay, + duration: timing.duration, + ease: timing.ease, + timer: null, + state: CREATED, + }); + } + + function init(node, id) { + var schedule = schedule_get(node, id); + if (schedule.state > CREATED) + throw new Error('too late; already scheduled'); + return schedule; + } + + function schedule_set(node, id) { + var schedule = schedule_get(node, id); + if (schedule.state > STARTED) + throw new Error('too late; already running'); + return schedule; + } + + function schedule_get(node, id) { + var schedule = node.__transition; + if (!schedule || !(schedule = schedule[id])) + throw new Error('transition not found'); + return schedule; + } + + function create(node, id, self) { + var schedules = node.__transition, + tween; + + // Initialize the self timer when the transition is created. + // Note the actual delay is not known until the first callback! + schedules[id] = self; + self.timer = timer(schedule, 0, self.time); + + function schedule(elapsed) { + self.state = SCHEDULED; + self.timer.restart(start, self.delay, self.time); + + // If the elapsed delay is less than our first sleep, start immediately. + if (self.delay <= elapsed) start(elapsed - self.delay); + } + + function start(elapsed) { + var i, j, n, o; + + // If the state is not SCHEDULED, then we previously errored on start. + if (self.state !== SCHEDULED) return stop(); + + for (i in schedules) { + o = schedules[i]; + if (o.name !== self.name) continue; + + // While this element already has a starting transition during this frame, + // defer starting an interrupting transition until that transition has a + // chance to tick (and possibly end); see d3/d3-transition#54! + if (o.state === STARTED) return src_timeout(start); + + // Interrupt the active transition, if any. + if (o.state === RUNNING) { + o.state = ENDED; + o.timer.stop(); + o.on.call('interrupt', node, node.__data__, o.index, o.group); + delete schedules[i]; + } + + // Cancel any pre-empted transitions. + else if (+i < id) { + o.state = ENDED; + o.timer.stop(); + o.on.call('cancel', node, node.__data__, o.index, o.group); + delete schedules[i]; + } + } + + // Defer the first tick to end of the current frame; see d3/d3#1576. + // Note the transition may be canceled after start and before the first tick! + // Note this must be scheduled before the start event; see d3/d3-transition#16! + // Assuming this is successful, subsequent callbacks go straight to tick. + src_timeout(function () { + if (self.state === STARTED) { + self.state = RUNNING; + self.timer.restart(tick, self.delay, self.time); + tick(elapsed); + } + }); + + // Dispatch the start event. + // Note this must be done before the tween are initialized. + self.state = STARTING; + self.on.call('start', node, node.__data__, self.index, self.group); + if (self.state !== STARTING) return; // interrupted + self.state = STARTED; + + // Initialize the tween, deleting null tween. + tween = new Array((n = self.tween.length)); + for (i = 0, j = -1; i < n; ++i) { + if ( + (o = self.tween[i].value.call( + node, + node.__data__, + self.index, + self.group, + )) + ) { + tween[++j] = o; + } + } + tween.length = j + 1; + } + + function tick(elapsed) { + var t = + elapsed < self.duration + ? self.ease.call(null, elapsed / self.duration) + : (self.timer.restart(stop), (self.state = ENDING), 1), + i = -1, + n = tween.length; + + while (++i < n) { + tween[i].call(node, t); + } + + // Dispatch the end event. + if (self.state === ENDING) { + self.on.call('end', node, node.__data__, self.index, self.group); + stop(); + } + } + + function stop() { + self.state = ENDED; + self.timer.stop(); + delete schedules[id]; + for (var i in schedules) return; // eslint-disable-line no-unused-vars + delete node.__transition; + } + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/interrupt.js + + /* harmony default export */ function interrupt(node, name) { + var schedules = node.__transition, + schedule, + active, + empty = true, + i; + + if (!schedules) return; + + name = name == null ? null : name + ''; + + for (i in schedules) { + if ((schedule = schedules[i]).name !== name) { + empty = false; + continue; + } + active = schedule.state > STARTING && schedule.state < ENDING; + schedule.state = ENDED; + schedule.timer.stop(); + schedule.on.call( + active ? 'interrupt' : 'cancel', + node, + node.__data__, + schedule.index, + schedule.group, + ); + delete schedules[i]; + } + + if (empty) delete node.__transition; + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/selection/interrupt.js + + /* harmony default export */ function selection_interrupt(name) { + return this.each(function () { + interrupt(this, name); + }); + } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/transform/decompose.js + + var degrees = 180 / Math.PI; + + var decompose_identity = { + translateX: 0, + translateY: 0, + rotate: 0, + skewX: 0, + scaleX: 1, + scaleY: 1, + }; + + /* harmony default export */ function decompose(a, b, c, d, e, f) { + var scaleX, scaleY, skewX; + if ((scaleX = Math.sqrt(a * a + b * b))) (a /= scaleX), (b /= scaleX); + if ((skewX = a * c + b * d)) (c -= a * skewX), (d -= b * skewX); + if ((scaleY = Math.sqrt(c * c + d * d))) + (c /= scaleY), (d /= scaleY), (skewX /= scaleY); + if (a * d < b * c) + (a = -a), (b = -b), (skewX = -skewX), (scaleX = -scaleX); + return { + translateX: e, + translateY: f, + rotate: Math.atan2(b, a) * degrees, + skewX: Math.atan(skewX) * degrees, + scaleX: scaleX, + scaleY: scaleY, + }; + } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/transform/parse.js + + var svgNode; + + /* eslint-disable no-undef */ + function parseCss(value) { + const m = new (typeof DOMMatrix === 'function' + ? DOMMatrix + : WebKitCSSMatrix)(value + ''); + return m.isIdentity + ? decompose_identity + : decompose(m.a, m.b, m.c, m.d, m.e, m.f); + } + + function parseSvg(value) { + if (value == null) return decompose_identity; + if (!svgNode) + svgNode = document.createElementNS('http://www.w3.org/2000/svg', 'g'); + svgNode.setAttribute('transform', value); + if (!(value = svgNode.transform.baseVal.consolidate())) + return decompose_identity; + value = value.matrix; + return decompose(value.a, value.b, value.c, value.d, value.e, value.f); + } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/transform/index.js + + function interpolateTransform(parse, pxComma, pxParen, degParen) { + function pop(s) { + return s.length ? s.pop() + ' ' : ''; + } + + function translate(xa, ya, xb, yb, s, q) { + if (xa !== xb || ya !== yb) { + var i = s.push('translate(', null, pxComma, null, pxParen); + q.push( + { i: i - 4, x: src_number(xa, xb) }, + { i: i - 2, x: src_number(ya, yb) }, + ); + } else if (xb || yb) { + s.push('translate(' + xb + pxComma + yb + pxParen); + } + } + + function rotate(a, b, s, q) { + if (a !== b) { + if (a - b > 180) b += 360; + else if (b - a > 180) a += 360; // shortest path + q.push({ + i: s.push(pop(s) + 'rotate(', null, degParen) - 2, + x: src_number(a, b), + }); + } else if (b) { + s.push(pop(s) + 'rotate(' + b + degParen); + } + } + + function skewX(a, b, s, q) { + if (a !== b) { + q.push({ + i: s.push(pop(s) + 'skewX(', null, degParen) - 2, + x: src_number(a, b), + }); + } else if (b) { + s.push(pop(s) + 'skewX(' + b + degParen); + } + } + + function scale(xa, ya, xb, yb, s, q) { + if (xa !== xb || ya !== yb) { + var i = s.push(pop(s) + 'scale(', null, ',', null, ')'); + q.push( + { i: i - 4, x: src_number(xa, xb) }, + { i: i - 2, x: src_number(ya, yb) }, + ); + } else if (xb !== 1 || yb !== 1) { + s.push(pop(s) + 'scale(' + xb + ',' + yb + ')'); + } + } + + return function (a, b) { + var s = [], // string constants and placeholders + q = []; // number interpolators + (a = parse(a)), (b = parse(b)); + translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q); + rotate(a.rotate, b.rotate, s, q); + skewX(a.skewX, b.skewX, s, q); + scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q); + a = b = null; // gc + return function (t) { + var i = -1, + n = q.length, + o; + while (++i < n) s[(o = q[i]).i] = o.x(t); + return s.join(''); + }; + }; + } + + var interpolateTransformCss = interpolateTransform( + parseCss, + 'px, ', + 'px)', + 'deg)', + ); + var interpolateTransformSvg = interpolateTransform( + parseSvg, + ', ', + ')', + ')', + ); // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/tween.js + + function tweenRemove(id, name) { + var tween0, tween1; + return function () { + var schedule = schedule_set(this, id), + tween = schedule.tween; + + // If this node shared tween with the previous node, + // just assign the updated shared tween and we’re done! + // Otherwise, copy-on-write. + if (tween !== tween0) { + tween1 = tween0 = tween; + for (var i = 0, n = tween1.length; i < n; ++i) { + if (tween1[i].name === name) { + tween1 = tween1.slice(); + tween1.splice(i, 1); + break; + } + } + } + + schedule.tween = tween1; + }; + } + + function tweenFunction(id, name, value) { + var tween0, tween1; + if (typeof value !== 'function') throw new Error(); + return function () { + var schedule = schedule_set(this, id), + tween = schedule.tween; + + // If this node shared tween with the previous node, + // just assign the updated shared tween and we’re done! + // Otherwise, copy-on-write. + if (tween !== tween0) { + tween1 = (tween0 = tween).slice(); + for ( + var t = { name: name, value: value }, i = 0, n = tween1.length; + i < n; + ++i + ) { + if (tween1[i].name === name) { + tween1[i] = t; + break; + } + } + if (i === n) tween1.push(t); + } + + schedule.tween = tween1; + }; + } + + /* harmony default export */ function tween(name, value) { + var id = this._id; + + name += ''; + + if (arguments.length < 2) { + var tween = schedule_get(this.node(), id).tween; + for (var i = 0, n = tween.length, t; i < n; ++i) { + if ((t = tween[i]).name === name) { + return t.value; + } + } + return null; + } + + return this.each( + (value == null ? tweenRemove : tweenFunction)(id, name, value), + ); + } + + function tweenValue(transition, name, value) { + var id = transition._id; + + transition.each(function () { + var schedule = schedule_set(this, id); + (schedule.value || (schedule.value = {}))[name] = value.apply( + this, + arguments, + ); + }); + + return function (node) { + return schedule_get(node, id).value[name]; + }; + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/interpolate.js + + /* harmony default export */ function interpolate(a, b) { + var c; + return (typeof b === 'number' + ? src_number + : b instanceof color + ? rgb + : (c = color(b)) + ? ((b = c), rgb) + : string)(a, b); + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/attr.js + + function attr_attrRemove(name) { + return function () { + this.removeAttribute(name); + }; + } + + function attr_attrRemoveNS(fullname) { + return function () { + this.removeAttributeNS(fullname.space, fullname.local); + }; + } + + function attr_attrConstant(name, interpolate, value1) { + var string00, + string1 = value1 + '', + interpolate0; + return function () { + var string0 = this.getAttribute(name); + return string0 === string1 + ? null + : string0 === string00 + ? interpolate0 + : (interpolate0 = interpolate((string00 = string0), value1)); + }; + } + + function attr_attrConstantNS(fullname, interpolate, value1) { + var string00, + string1 = value1 + '', + interpolate0; + return function () { + var string0 = this.getAttributeNS(fullname.space, fullname.local); + return string0 === string1 + ? null + : string0 === string00 + ? interpolate0 + : (interpolate0 = interpolate((string00 = string0), value1)); + }; + } + + function attr_attrFunction(name, interpolate, value) { + var string00, string10, interpolate0; + return function () { + var string0, + value1 = value(this), + string1; + if (value1 == null) return void this.removeAttribute(name); + string0 = this.getAttribute(name); + string1 = value1 + ''; + return string0 === string1 + ? null + : string0 === string00 && string1 === string10 + ? interpolate0 + : ((string10 = string1), + (interpolate0 = interpolate((string00 = string0), value1))); + }; + } + + function attr_attrFunctionNS(fullname, interpolate, value) { + var string00, string10, interpolate0; + return function () { + var string0, + value1 = value(this), + string1; + if (value1 == null) + return void this.removeAttributeNS(fullname.space, fullname.local); + string0 = this.getAttributeNS(fullname.space, fullname.local); + string1 = value1 + ''; + return string0 === string1 + ? null + : string0 === string00 && string1 === string10 + ? interpolate0 + : ((string10 = string1), + (interpolate0 = interpolate((string00 = string0), value1))); + }; + } + + /* harmony default export */ function transition_attr(name, value) { + var fullname = namespace(name), + i = fullname === 'transform' ? interpolateTransformSvg : interpolate; + return this.attrTween( + name, + typeof value === 'function' + ? (fullname.local ? attr_attrFunctionNS : attr_attrFunction)( + fullname, + i, + tweenValue(this, 'attr.' + name, value), + ) + : value == null + ? (fullname.local ? attr_attrRemoveNS : attr_attrRemove)(fullname) + : (fullname.local ? attr_attrConstantNS : attr_attrConstant)( + fullname, + i, + value, + ), + ); + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/attrTween.js + + function attrInterpolate(name, i) { + return function (t) { + this.setAttribute(name, i.call(this, t)); + }; + } + + function attrInterpolateNS(fullname, i) { + return function (t) { + this.setAttributeNS(fullname.space, fullname.local, i.call(this, t)); + }; + } + + function attrTweenNS(fullname, value) { + var t0, i0; + function tween() { + var i = value.apply(this, arguments); + if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i); + return t0; + } + tween._value = value; + return tween; + } + + function attrTween(name, value) { + var t0, i0; + function tween() { + var i = value.apply(this, arguments); + if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i); + return t0; + } + tween._value = value; + return tween; + } + + /* harmony default export */ function transition_attrTween(name, value) { + var key = 'attr.' + name; + if (arguments.length < 2) return (key = this.tween(key)) && key._value; + if (value == null) return this.tween(key, null); + if (typeof value !== 'function') throw new Error(); + var fullname = namespace(name); + return this.tween( + key, + (fullname.local ? attrTweenNS : attrTween)(fullname, value), + ); + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/delay.js + + function delayFunction(id, value) { + return function () { + init(this, id).delay = +value.apply(this, arguments); + }; + } + + function delayConstant(id, value) { + return ( + (value = +value), + function () { + init(this, id).delay = value; + } + ); + } + + /* harmony default export */ function delay(value) { + var id = this._id; + + return arguments.length + ? this.each( + (typeof value === 'function' ? delayFunction : delayConstant)( + id, + value, + ), + ) + : schedule_get(this.node(), id).delay; + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/duration.js + + function durationFunction(id, value) { + return function () { + schedule_set(this, id).duration = +value.apply(this, arguments); + }; + } + + function durationConstant(id, value) { + return ( + (value = +value), + function () { + schedule_set(this, id).duration = value; + } + ); + } + + /* harmony default export */ function duration(value) { + var id = this._id; + + return arguments.length + ? this.each( + (typeof value === 'function' ? durationFunction : durationConstant)( + id, + value, + ), + ) + : schedule_get(this.node(), id).duration; + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/ease.js + + function easeConstant(id, value) { + if (typeof value !== 'function') throw new Error(); + return function () { + schedule_set(this, id).ease = value; + }; + } + + /* harmony default export */ function ease(value) { + var id = this._id; + + return arguments.length + ? this.each(easeConstant(id, value)) + : schedule_get(this.node(), id).ease; + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/easeVarying.js + + function easeVarying(id, value) { + return function () { + var v = value.apply(this, arguments); + if (typeof v !== 'function') throw new Error(); + schedule_set(this, id).ease = v; + }; + } + + /* harmony default export */ function transition_easeVarying(value) { + if (typeof value !== 'function') throw new Error(); + return this.each(easeVarying(this._id, value)); + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/filter.js + + /* harmony default export */ function transition_filter(match) { + if (typeof match !== 'function') match = matcher(match); + + for ( + var groups = this._groups, + m = groups.length, + subgroups = new Array(m), + j = 0; + j < m; + ++j + ) { + for ( + var group = groups[j], + n = group.length, + subgroup = (subgroups[j] = []), + node, + i = 0; + i < n; + ++i + ) { + if ((node = group[i]) && match.call(node, node.__data__, i, group)) { + subgroup.push(node); + } + } + } + + return new Transition(subgroups, this._parents, this._name, this._id); + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/merge.js + + /* harmony default export */ function transition_merge(transition) { + if (transition._id !== this._id) throw new Error(); + + for ( + var groups0 = this._groups, + groups1 = transition._groups, + m0 = groups0.length, + m1 = groups1.length, + m = Math.min(m0, m1), + merges = new Array(m0), + j = 0; + j < m; + ++j + ) { + for ( + var group0 = groups0[j], + group1 = groups1[j], + n = group0.length, + merge = (merges[j] = new Array(n)), + node, + i = 0; + i < n; + ++i + ) { + if ((node = group0[i] || group1[i])) { + merge[i] = node; + } + } + } + + for (; j < m0; ++j) { + merges[j] = groups0[j]; + } + + return new Transition(merges, this._parents, this._name, this._id); + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/on.js + + function start(name) { + return (name + '') + .trim() + .split(/^|\s+/) + .every(function (t) { + var i = t.indexOf('.'); + if (i >= 0) t = t.slice(0, i); + return !t || t === 'start'; + }); + } + + function onFunction(id, name, listener) { + var on0, + on1, + sit = start(name) ? init : schedule_set; + return function () { + var schedule = sit(this, id), + on = schedule.on; + + // If this node shared a dispatch with the previous node, + // just assign the updated shared dispatch and we’re done! + // Otherwise, copy-on-write. + if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener); + + schedule.on = on1; + }; + } + + /* harmony default export */ function transition_on(name, listener) { + var id = this._id; + + return arguments.length < 2 + ? schedule_get(this.node(), id).on.on(name) + : this.each(onFunction(id, name, listener)); + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/remove.js + + function removeFunction(id) { + return function () { + var parent = this.parentNode; + for (var i in this.__transition) if (+i !== id) return; + if (parent) parent.removeChild(this); + }; + } + + /* harmony default export */ function transition_remove() { + return this.on('end.remove', removeFunction(this._id)); + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/select.js + + /* harmony default export */ function transition_select(select) { + var name = this._name, + id = this._id; + + if (typeof select !== 'function') select = selector(select); + + for ( + var groups = this._groups, + m = groups.length, + subgroups = new Array(m), + j = 0; + j < m; + ++j + ) { + for ( + var group = groups[j], + n = group.length, + subgroup = (subgroups[j] = new Array(n)), + node, + subnode, + i = 0; + i < n; + ++i + ) { + if ( + (node = group[i]) && + (subnode = select.call(node, node.__data__, i, group)) + ) { + if ('__data__' in node) subnode.__data__ = node.__data__; + subgroup[i] = subnode; + schedule( + subgroup[i], + name, + id, + i, + subgroup, + schedule_get(node, id), + ); + } + } + } + + return new Transition(subgroups, this._parents, name, id); + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/selectAll.js + + /* harmony default export */ function transition_selectAll(select) { + var name = this._name, + id = this._id; + + if (typeof select !== 'function') select = selectorAll(select); + + for ( + var groups = this._groups, + m = groups.length, + subgroups = [], + parents = [], + j = 0; + j < m; + ++j + ) { + for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { + if ((node = group[i])) { + for ( + var children = select.call(node, node.__data__, i, group), + child, + inherit = schedule_get(node, id), + k = 0, + l = children.length; + k < l; + ++k + ) { + if ((child = children[k])) { + schedule(child, name, id, k, children, inherit); + } + } + subgroups.push(children); + parents.push(node); + } + } + } + + return new Transition(subgroups, parents, name, id); + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/selection.js + + var selection_Selection = src_selection.prototype.constructor; + + /* harmony default export */ function transition_selection() { + return new selection_Selection(this._groups, this._parents); + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/style.js + + function styleNull(name, interpolate) { + var string00, string10, interpolate0; + return function () { + var string0 = styleValue(this, name), + string1 = (this.style.removeProperty(name), styleValue(this, name)); + return string0 === string1 + ? null + : string0 === string00 && string1 === string10 + ? interpolate0 + : (interpolate0 = interpolate( + (string00 = string0), + (string10 = string1), + )); + }; + } + + function style_styleRemove(name) { + return function () { + this.style.removeProperty(name); + }; + } + + function style_styleConstant(name, interpolate, value1) { + var string00, + string1 = value1 + '', + interpolate0; + return function () { + var string0 = styleValue(this, name); + return string0 === string1 + ? null + : string0 === string00 + ? interpolate0 + : (interpolate0 = interpolate((string00 = string0), value1)); + }; + } + + function style_styleFunction(name, interpolate, value) { + var string00, string10, interpolate0; + return function () { + var string0 = styleValue(this, name), + value1 = value(this), + string1 = value1 + ''; + if (value1 == null) + string1 = value1 = + (this.style.removeProperty(name), styleValue(this, name)); + return string0 === string1 + ? null + : string0 === string00 && string1 === string10 + ? interpolate0 + : ((string10 = string1), + (interpolate0 = interpolate((string00 = string0), value1))); + }; + } + + function styleMaybeRemove(id, name) { + var on0, + on1, + listener0, + key = 'style.' + name, + event = 'end.' + key, + remove; + return function () { + var schedule = schedule_set(this, id), + on = schedule.on, + listener = + schedule.value[key] == null + ? remove || (remove = style_styleRemove(name)) + : undefined; + + // If this node shared a dispatch with the previous node, + // just assign the updated shared dispatch and we’re done! + // Otherwise, copy-on-write. + if (on !== on0 || listener0 !== listener) + (on1 = (on0 = on).copy()).on(event, (listener0 = listener)); + + schedule.on = on1; + }; + } + + /* harmony default export */ function transition_style( + name, + value, + priority, + ) { + var i = + (name += '') === 'transform' ? interpolateTransformCss : interpolate; + return value == null + ? this.styleTween(name, styleNull(name, i)).on( + 'end.style.' + name, + style_styleRemove(name), + ) + : typeof value === 'function' + ? this.styleTween( + name, + style_styleFunction( + name, + i, + tweenValue(this, 'style.' + name, value), + ), + ).each(styleMaybeRemove(this._id, name)) + : this.styleTween( + name, + style_styleConstant(name, i, value), + priority, + ).on('end.style.' + name, null); + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/styleTween.js + + function styleInterpolate(name, i, priority) { + return function (t) { + this.style.setProperty(name, i.call(this, t), priority); + }; + } + + function styleTween(name, value, priority) { + var t, i0; + function tween() { + var i = value.apply(this, arguments); + if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority); + return t; + } + tween._value = value; + return tween; + } + + /* harmony default export */ function transition_styleTween( + name, + value, + priority, + ) { + var key = 'style.' + (name += ''); + if (arguments.length < 2) return (key = this.tween(key)) && key._value; + if (value == null) return this.tween(key, null); + if (typeof value !== 'function') throw new Error(); + return this.tween( + key, + styleTween(name, value, priority == null ? '' : priority), + ); + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/text.js + + function text_textConstant(value) { + return function () { + this.textContent = value; + }; + } + + function text_textFunction(value) { + return function () { + var value1 = value(this); + this.textContent = value1 == null ? '' : value1; + }; + } + + /* harmony default export */ function transition_text(value) { + return this.tween( + 'text', + typeof value === 'function' + ? text_textFunction(tweenValue(this, 'text', value)) + : text_textConstant(value == null ? '' : value + ''), + ); + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/textTween.js + + function textInterpolate(i) { + return function (t) { + this.textContent = i.call(this, t); + }; + } + + function textTween(value) { + var t0, i0; + function tween() { + var i = value.apply(this, arguments); + if (i !== i0) t0 = (i0 = i) && textInterpolate(i); + return t0; + } + tween._value = value; + return tween; + } + + /* harmony default export */ function transition_textTween(value) { + var key = 'text'; + if (arguments.length < 1) return (key = this.tween(key)) && key._value; + if (value == null) return this.tween(key, null); + if (typeof value !== 'function') throw new Error(); + return this.tween(key, textTween(value)); + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/transition.js + + /* harmony default export */ function transition() { + var name = this._name, + id0 = this._id, + id1 = newId(); + + for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { + if ((node = group[i])) { + var inherit = schedule_get(node, id0); + schedule(node, name, id1, i, group, { + time: inherit.time + inherit.delay + inherit.duration, + delay: 0, + duration: inherit.duration, + ease: inherit.ease, + }); + } + } + } + + return new Transition(groups, this._parents, name, id1); + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/end.js + + /* harmony default export */ function end() { + var on0, + on1, + that = this, + id = that._id, + size = that.size(); + return new Promise(function (resolve, reject) { + var cancel = { value: reject }, + end = { + value: function () { + if (--size === 0) resolve(); + }, + }; + + that.each(function () { + var schedule = schedule_set(this, id), + on = schedule.on; + + // If this node shared a dispatch with the previous node, + // just assign the updated shared dispatch and we’re done! + // Otherwise, copy-on-write. + if (on !== on0) { + on1 = (on0 = on).copy(); + on1._.cancel.push(cancel); + on1._.interrupt.push(cancel); + on1._.end.push(end); + } + + schedule.on = on1; + }); + + // The selection was empty, resolve end immediately + if (size === 0) resolve(); + }); + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/index.js + + var id = 0; + + function Transition(groups, parents, name, id) { + this._groups = groups; + this._parents = parents; + this._name = name; + this._id = id; + } + + function transition_transition(name) { + return src_selection().transition(name); + } + + function newId() { + return ++id; + } + + var selection_prototype = src_selection.prototype; + + Transition.prototype = transition_transition.prototype = { + constructor: Transition, + select: transition_select, + selectAll: transition_selectAll, + selectChild: selection_prototype.selectChild, + selectChildren: selection_prototype.selectChildren, + filter: transition_filter, + merge: transition_merge, + selection: transition_selection, + transition: transition, + call: selection_prototype.call, + nodes: selection_prototype.nodes, + node: selection_prototype.node, + size: selection_prototype.size, + empty: selection_prototype.empty, + each: selection_prototype.each, + on: transition_on, + attr: transition_attr, + attrTween: transition_attrTween, + style: transition_style, + styleTween: transition_styleTween, + text: transition_text, + textTween: transition_textTween, + remove: transition_remove, + tween: tween, + delay: delay, + duration: duration, + ease: ease, + easeVarying: transition_easeVarying, + end: end, + [Symbol.iterator]: selection_prototype[Symbol.iterator], + }; // CONCATENATED MODULE: ../node_modules/d3-transition/src/selection/transition.js + + var defaultTiming = { + time: null, // Set on use. + delay: 0, + duration: 250, + ease: cubicInOut, + }; + + function inherit(node, id) { + var timing; + while (!(timing = node.__transition) || !(timing = timing[id])) { + if (!(node = node.parentNode)) { + throw new Error(`transition ${id} not found`); + } + } + return timing; + } + + /* harmony default export */ function selection_transition(name) { + var id, timing; + + if (name instanceof Transition) { + (id = name._id), (name = name._name); + } else { + (id = newId()), + ((timing = defaultTiming).time = now()), + (name = name == null ? null : name + ''); + } + + for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { + if ((node = group[i])) { + schedule(node, name, id, i, group, timing || inherit(node, id)); + } + } + } + + return new Transition(groups, this._parents, name, id); + } // CONCATENATED MODULE: ../node_modules/d3-transition/src/selection/index.js + + src_selection.prototype.interrupt = selection_interrupt; + src_selection.prototype.transition = selection_transition; // CONCATENATED MODULE: ../node_modules/d3-transition/src/index.js // CONCATENATED MODULE: ./colorUtils.js + + function generateHash(name) { + // Return a vector (0.0->1.0) that is a hash of the input string. + // The hash is computed to favor early characters over later ones, so + // that strings with similar starts have similar vectors. Only the first + // 6 characters are considered. + const MAX_CHAR = 6; + + let hash = 0; + let maxHash = 0; + let weight = 1; + const mod = 10; + + if (name) { + for (let i = 0; i < name.length; i++) { + if (i > MAX_CHAR) { + break; + } + hash += weight * (name.charCodeAt(i) % mod); + maxHash += weight * (mod - 1); + weight *= 0.7; + } + if (maxHash > 0) { + hash = hash / maxHash; + } + } + return hash; + } + + function generateColorVector(name) { + let vector = 0; + if (name) { + const nameArr = name.split('`'); + if (nameArr.length > 1) { + name = nameArr[nameArr.length - 1]; // drop module name if present + } + name = name.split('(')[0]; // drop extra info + vector = generateHash(name); + } + return vector; + } // CONCATENATED MODULE: ./colorScheme.js + + function calculateColor(hue, vector) { + let r; + let g; + let b; + + if (hue === 'red') { + r = 200 + Math.round(55 * vector); + g = 50 + Math.round(80 * vector); + b = g; + } else if (hue === 'orange') { + r = 190 + Math.round(65 * vector); + g = 90 + Math.round(65 * vector); + b = 0; + } else if (hue === 'yellow') { + r = 175 + Math.round(55 * vector); + g = r; + b = 50 + Math.round(20 * vector); + } else if (hue === 'green') { + r = 50 + Math.round(60 * vector); + g = 200 + Math.round(55 * vector); + b = r; + } else if (hue === 'pastelgreen') { + // rgb(163,195,72) - rgb(238,244,221) + r = 163 + Math.round(75 * vector); + g = 195 + Math.round(49 * vector); + b = 72 + Math.round(149 * vector); + } else if (hue === 'blue') { + // rgb(91,156,221) - rgb(217,232,247) + r = 91 + Math.round(126 * vector); + g = 156 + Math.round(76 * vector); + b = 221 + Math.round(26 * vector); + } else if (hue === 'aqua') { + r = 50 + Math.round(60 * vector); + g = 165 + Math.round(55 * vector); + b = g; + } else if (hue === 'cold') { + r = 0 + Math.round(55 * (1 - vector)); + g = 0 + Math.round(230 * (1 - vector)); + b = 200 + Math.round(55 * vector); + } else { + // original warm palette + r = 200 + Math.round(55 * vector); + g = 0 + Math.round(230 * (1 - vector)); + b = 0 + Math.round(55 * (1 - vector)); + } + + return 'rgb(' + r + ',' + g + ',' + b + ')'; + } // CONCATENATED MODULE: ./flamegraph.js + + /* harmony default export */ function flamegraph() { + let w = 960; // graph width + let h = null; // graph height + let c = 18; // cell height + let selection = null; // selection + let tooltip = null; // tooltip + let title = ''; // graph title + let transitionDuration = 750; + let transitionEase = cubicInOut; // tooltip offset + let sort = false; + let inverted = false; // invert the graph direction + let clickHandler = null; + let hoverHandler = null; + let minFrameSize = 0; + let detailsElement = null; + let searchDetails = null; + let selfValue = false; + let resetHeightOnZoom = false; + let scrollOnZoom = false; + let minHeight = null; + let computeDelta = false; + let colorHue = null; + + let getName = function (d) { + return d.data.n || d.data.name; + }; + + let getValue = function (d) { + if ('v' in d) { + return d.v; + } else { + return d.value; + } + }; + + let getChildren = function (d) { + return d.c || d.children; + }; + + let getLibtype = function (d) { + return d.data.l || d.data.libtype; + }; + + let getDelta = function (d) { + if ('d' in d.data) { + return d.data.d; + } else { + return d.data.delta; + } + }; + + let searchHandler = function (searchResults, searchSum, totalValue) { + searchDetails = () => { + if (detailsElement) { + detailsElement.textContent = + 'search: ' + + searchSum + + ' of ' + + totalValue + + ' total time ( ' + + format('.3f')(100 * (searchSum / totalValue), 3) + + '%)'; + } + }; + searchDetails(); + }; + const originalSearchHandler = searchHandler; + + let searchMatch = (d, term, ignoreCase = false) => { + if (!term) { + return false; + } + let label = getName(d); + if (ignoreCase) { + term = term.toLowerCase(); + label = label.toLowerCase(); + } + const re = new RegExp(term); + return typeof label !== 'undefined' && label && label.match(re); + }; + const originalSearchMatch = searchMatch; + + let detailsHandler = function (d) { + if (detailsElement) { + if (d) { + detailsElement.textContent = d; + } else { + if (typeof searchDetails === 'function') { + searchDetails(); + } else { + detailsElement.textContent = ''; + } + } + } + }; + const originalDetailsHandler = detailsHandler; + + let labelHandler = function (d) { + return ( + getName(d) + + ' (' + + format('.3f')(100 * (d.x1 - d.x0), 3) + + '%, ' + + getValue(d) + + ' ms)' + ); + }; + + let colorMapper = function (d) { + return d.highlight ? '#E600E6' : colorHash(getName(d), getLibtype(d)); + }; + const originalColorMapper = colorMapper; + + function colorHash(name, libtype) { + // Return a color for the given name and library type. The library type + // selects the hue, and the name is hashed to a color in that hue. + + // default when libtype is not in use + let hue = colorHue || 'warm'; + + if (!colorHue && !(typeof libtype === 'undefined' || libtype === '')) { + // Select hue. Order is important. + hue = 'red'; + if (typeof name !== 'undefined' && name && name.match(/::/)) { + hue = 'yellow'; + } + if (libtype === 'kernel') { + hue = 'orange'; + } else if (libtype === 'jit') { + hue = 'green'; + } else if (libtype === 'inlined') { + hue = 'aqua'; + } + } + + const vector = generateColorVector(name); + return calculateColor(hue, vector); + } + + function show(d) { + d.data.fade = false; + d.data.hide = false; + if (d.children) { + d.children.forEach(show); + } + } + + function hideSiblings(node) { + let child = node; + let parent = child.parent; + let children, i, sibling; + while (parent) { + children = parent.children; + i = children.length; + while (i--) { + sibling = children[i]; + if (sibling !== child) { + sibling.data.hide = true; + } + } + child = parent; + parent = child.parent; + } + } + + function fadeAncestors(d) { + if (d.parent) { + d.parent.data.fade = true; + fadeAncestors(d.parent); + } + } + + function zoom(d) { + if (tooltip) tooltip.hide(); + hideSiblings(d); + show(d); + fadeAncestors(d); + update(); + if (scrollOnZoom) { + const chartOffset = src_select(this).select('svg')._groups[0][0] + .parentNode.offsetTop; + const maxFrames = (window.innerHeight - chartOffset) / c; + const frameOffset = (d.height - maxFrames + 10) * c; + window.scrollTo({ + top: chartOffset + frameOffset, + left: 0, + behavior: 'smooth', + }); + } + if (typeof clickHandler === 'function') { + clickHandler(d); + } + } + + function searchTree(d, term) { + const results = []; + let sum = 0; + + function searchInner(d, foundParent) { + let found = false; + + if (searchMatch(d, term)) { + d.highlight = true; + found = true; + if (!foundParent) { + sum += getValue(d); + } + results.push(d); + } else { + d.highlight = false; + } + + if (getChildren(d)) { + getChildren(d).forEach(function (child) { + searchInner(child, foundParent || found); + }); + } + } + searchInner(d, false); + + return [results, sum]; + } + + function findTree(d, id) { + if (d.id === id) { + return d; + } else { + const children = getChildren(d); + if (children) { + for (let i = 0; i < children.length; i++) { + const found = findTree(children[i], id); + if (found) { + return found; + } + } + } + } + } + + function clear(d) { + d.highlight = false; + if (getChildren(d)) { + getChildren(d).forEach(function (child) { + clear(child); + }); + } + } + + function doSort(a, b) { + if (typeof sort === 'function') { + return sort(a, b); + } else if (sort) { + return ascending_ascending(getName(a), getName(b)); + } + } + + const p = partition(); + + function filterNodes(root) { + let nodeList = root.descendants(); + if (minFrameSize > 0) { + const kx = w / (root.x1 - root.x0); + nodeList = nodeList.filter(function (el) { + return (el.x1 - el.x0) * kx > minFrameSize; + }); + } + return nodeList; + } + + function update() { + selection.each(function (root) { + const x = linear_linear().range([0, w]); + const y = linear_linear().range([0, c]); + + reappraiseNode(root); + + if (sort) root.sort(doSort); + + p(root); + + const kx = w / (root.x1 - root.x0); + function width(d) { + return (d.x1 - d.x0) * kx; + } + + const descendants = filterNodes(root); + const svg = src_select(this).select('svg'); + svg.attr('width', w); + + let g = svg.selectAll('g').data(descendants, function (d) { + return d.id; + }); + + // if height is not set: set height on first update, after nodes were filtered by minFrameSize + if (!h || resetHeightOnZoom) { + const maxDepth = Math.max.apply( + null, + descendants.map(function (n) { + return n.depth; + }), + ); + + h = (maxDepth + 3) * c; + if (h < minHeight) h = minHeight; + + svg.attr('height', h); + } + + g.transition() + .duration(transitionDuration) + .ease(transitionEase) + .attr('transform', function (d) { + return ( + 'translate(' + + x(d.x0) + + ',' + + (inverted ? y(d.depth) : h - y(d.depth) - c) + + ')' + ); + }); + + g.select('rect') + .transition() + .duration(transitionDuration) + .ease(transitionEase) + .attr('width', width); + + const node = g + .enter() + .append('svg:g') + .attr('transform', function (d) { + return ( + 'translate(' + + x(d.x0) + + ',' + + (inverted ? y(d.depth) : h - y(d.depth) - c) + + ')' + ); + }); + + node + .append('svg:rect') + .transition() + .delay(transitionDuration / 2) + .attr('width', width); + + if (!tooltip) { + node.append('svg:title'); + } + + node.append('foreignObject').append('xhtml:div'); + + // Now we have to re-select to see the new elements (why?). + g = svg.selectAll('g').data(descendants, function (d) { + return d.id; + }); + + g.attr('width', width) + .attr('height', function (d) { + return c; + }) + .attr('name', function (d) { + return getName(d); + }) + .attr('class', function (d) { + return d.data.fade ? 'frame fade' : 'frame'; + }); + + g.select('rect') + .attr('height', function (d) { + return c; + }) + .attr('fill', function (d) { + return colorMapper(d); + }); + + if (!tooltip) { + g.select('title').text(labelHandler); + } + + g.select('foreignObject') + .attr('width', width) + .attr('height', function (d) { + return c; + }) + .select('div') + .attr('class', 'd3-flame-graph-label') + .style('display', function (d) { + return width(d) < 35 ? 'none' : 'block'; + }) + .transition() + .delay(transitionDuration) + .text(getName); + + g.on('click', (_, d) => { + zoom(d); + }); + + g.exit().remove(); + + g.on('mouseover', function (_, d) { + if (tooltip) tooltip.show(d, this); + detailsHandler(labelHandler(d)); + if (typeof hoverHandler === 'function') { + hoverHandler(d); + } + }).on('mouseout', function () { + if (tooltip) tooltip.hide(); + detailsHandler(null); + }); + }); + } + + function merge(data, samples) { + samples.forEach(function (sample) { + const node = data.find(function (element) { + return element.name === sample.name; + }); + + if (node) { + node.value += sample.value; + if (sample.children) { + if (!node.children) { + node.children = []; + } + merge(node.children, sample.children); + } + } else { + data.push(sample); + } + }); + } + + function forEachNode(node, f) { + f(node); + let children = node.children; + if (children) { + const stack = [children]; + let count, child, grandChildren; + while (stack.length) { + children = stack.pop(); + count = children.length; + while (count--) { + child = children[count]; + f(child); + grandChildren = child.children; + if (grandChildren) { + stack.push(grandChildren); + } + } + } + } + } + + function adoptNode(node) { + let id = 0; + forEachNode(node, function (n) { + n.id = id++; + }); + } + + function reappraiseNode(root) { + let node, + children, + grandChildren, + childrenValue, + i, + j, + child, + childValue; + const stack = []; + const included = []; + const excluded = []; + const compoundValue = !selfValue; + let item = root.data; + if (item.hide) { + root.value = 0; + children = root.children; + if (children) { + excluded.push(children); + } + } else { + root.value = item.fade ? 0 : getValue(item); + stack.push(root); + } + // First DFS pass: + // 1. Update node.value with node's self value + // 2. Populate excluded list with children under hidden nodes + // 3. Populate included list with children under visible nodes + while ((node = stack.pop())) { + children = node.children; + if (children && (i = children.length)) { + childrenValue = 0; + while (i--) { + child = children[i]; + item = child.data; + if (item.hide) { + child.value = 0; + grandChildren = child.children; + if (grandChildren) { + excluded.push(grandChildren); + } + continue; + } + if (item.fade) { + child.value = 0; + } else { + childValue = getValue(item); + child.value = childValue; + childrenValue += childValue; + } + stack.push(child); + } + // Here second part of `&&` is actually checking for `node.data.fade`. However, + // checking for node.value is faster and presents more oportunities for JS optimizer. + if (compoundValue && node.value) { + node.value -= childrenValue; + } + included.push(children); + } + } + // Postorder traversal to compute compound value of each visible node. + i = included.length; + while (i--) { + children = included[i]; + childrenValue = 0; + j = children.length; + while (j--) { + childrenValue += children[j].value; + } + children[0].parent.value += childrenValue; + } + // Continue DFS to set value of all hidden nodes to 0. + while (excluded.length) { + children = excluded.pop(); + j = children.length; + while (j--) { + child = children[j]; + child.value = 0; + grandChildren = child.children; + if (grandChildren) { + excluded.push(grandChildren); + } + } + } + } + + function processData() { + selection.datum((data) => { + if (data.constructor.name !== 'Node') { + // creating a root hierarchical structure + const root = hierarchy(data, getChildren); + + // augumenting nodes with ids + adoptNode(root); + + // calculate actual value + reappraiseNode(root); + + // store value for later use + root.originalValue = root.value; + + // computing deltas for differentials + if (computeDelta) { + root.eachAfter((node) => { + let sum = getDelta(node); + const children = node.children; + let i = children && children.length; + while (--i >= 0) sum += children[i].delta; + node.delta = sum; + }); + } + + // setting the bound data for the selection + return root; + } + }); + } + + function chart(s) { + if (!arguments.length) { + return chart; + } + + // saving the selection on `.call` + selection = s; + + // processing raw data to be used in the chart + processData(); + + // create chart svg + selection.each(function (data) { + if (src_select(this).select('svg').size() === 0) { + const svg = src_select(this) + .append('svg:svg') + .attr('width', w) + .attr('class', 'partition d3-flame-graph'); + + if (h) { + if (h < minHeight) h = minHeight; + svg.attr('height', h); + } + + svg + .append('svg:text') + .attr('class', 'title') + .attr('text-anchor', 'middle') + .attr('y', '25') + .attr('x', w / 2) + .attr('fill', '#808080') + .text(title); + + if (tooltip) svg.call(tooltip); + } + }); + + // first draw + update(); + } + + chart.height = function (_) { + if (!arguments.length) { + return h; + } + h = _; + return chart; + }; + + chart.minHeight = function (_) { + if (!arguments.length) { + return minHeight; + } + minHeight = _; + return chart; + }; + + chart.width = function (_) { + if (!arguments.length) { + return w; + } + w = _; + return chart; + }; + + chart.cellHeight = function (_) { + if (!arguments.length) { + return c; + } + c = _; + return chart; + }; + + chart.tooltip = function (_) { + if (!arguments.length) { + return tooltip; + } + if (typeof _ === 'function') { + tooltip = _; + } + return chart; + }; + + chart.title = function (_) { + if (!arguments.length) { + return title; + } + title = _; + return chart; + }; + + chart.transitionDuration = function (_) { + if (!arguments.length) { + return transitionDuration; + } + transitionDuration = _; + return chart; + }; + + chart.transitionEase = function (_) { + if (!arguments.length) { + return transitionEase; + } + transitionEase = _; + return chart; + }; + + chart.sort = function (_) { + if (!arguments.length) { + return sort; + } + sort = _; + return chart; + }; + + chart.inverted = function (_) { + if (!arguments.length) { + return inverted; + } + inverted = _; + return chart; + }; + + chart.computeDelta = function (_) { + if (!arguments.length) { + return computeDelta; + } + computeDelta = _; + return chart; + }; + + chart.setLabelHandler = function (_) { + if (!arguments.length) { + return labelHandler; + } + labelHandler = _; + return chart; + }; + // Kept for backwards compatibility. + chart.label = chart.setLabelHandler; + + chart.search = function (term) { + const searchResults = []; + let searchSum = 0; + let totalValue = 0; + selection.each(function (data) { + const res = searchTree(data, term); + searchResults.push(...res[0]); + searchSum += res[1]; + totalValue += data.originalValue; + }); + searchHandler(searchResults, searchSum, totalValue); + update(); + }; + + chart.findById = function (id) { + if (typeof id === 'undefined' || id === null) { + return null; + } + let found = null; + selection.each(function (data) { + if (found === null) { + found = findTree(data, id); + } + }); + return found; + }; + + chart.clear = function () { + detailsHandler(null); + selection.each(function (root) { + clear(root); + update(); + }); + }; + + chart.zoomTo = function (d) { + zoom(d); + }; + + chart.resetZoom = function () { + selection.each(function (root) { + zoom(root); // zoom to root + }); + }; + + chart.onClick = function (_) { + if (!arguments.length) { + return clickHandler; + } + clickHandler = _; + return chart; + }; + + chart.onHover = function (_) { + if (!arguments.length) { + return hoverHandler; + } + hoverHandler = _; + return chart; + }; + + chart.merge = function (data) { + if (!selection) { + return chart; + } + + // TODO: Fix merge with zoom + // Merging a zoomed chart doesn't work properly, so + // clearing zoom before merge. + // To apply zoom on merge, we would need to set hide + // and fade on new data according to current data. + // New ids are generated for the whole data structure, + // so previous ids might not be the same. For merge to + // work with zoom, previous ids should be maintained. + this.resetZoom(); + + // Clear search details + // Merge requires a new search, updating data and + // the details handler with search results. + // Since we don't store the search term, can't + // perform search again. + searchDetails = null; + detailsHandler(null); + + selection.datum((root) => { + merge([root.data], [data]); + return root.data; + }); + processData(); + update(); + return chart; + }; + + chart.update = function (data) { + if (!selection) { + return chart; + } + if (data) { + selection.datum(data); + processData(); + } + update(); + return chart; + }; + + chart.destroy = function () { + if (!selection) { + return chart; + } + if (tooltip) { + tooltip.hide(); + if (typeof tooltip.destroy === 'function') { + tooltip.destroy(); + } + } + selection.selectAll('svg').remove(); + return chart; + }; + + chart.setColorMapper = function (_) { + if (!arguments.length) { + colorMapper = originalColorMapper; + return chart; + } + colorMapper = (d) => { + const originalColor = originalColorMapper(d); + return _(d, originalColor); + }; + return chart; + }; + // Kept for backwards compatibility. + chart.color = chart.setColorMapper; + + chart.setColorHue = function (_) { + if (!arguments.length) { + colorHue = null; + return chart; + } + colorHue = _; + return chart; + }; + + chart.minFrameSize = function (_) { + if (!arguments.length) { + return minFrameSize; + } + minFrameSize = _; + return chart; + }; + + chart.setDetailsElement = function (_) { + if (!arguments.length) { + return detailsElement; + } + detailsElement = _; + return chart; + }; + // Kept for backwards compatibility. + chart.details = chart.setDetailsElement; + + chart.selfValue = function (_) { + if (!arguments.length) { + return selfValue; + } + selfValue = _; + return chart; + }; + + chart.resetHeightOnZoom = function (_) { + if (!arguments.length) { + return resetHeightOnZoom; + } + resetHeightOnZoom = _; + return chart; + }; + + chart.scrollOnZoom = function (_) { + if (!arguments.length) { + return scrollOnZoom; + } + scrollOnZoom = _; + return chart; + }; + + chart.getName = function (_) { + if (!arguments.length) { + return getName; + } + getName = _; + return chart; + }; + + chart.getValue = function (_) { + if (!arguments.length) { + return getValue; + } + getValue = _; + return chart; + }; + + chart.getChildren = function (_) { + if (!arguments.length) { + return getChildren; + } + getChildren = _; + return chart; + }; + + chart.getLibtype = function (_) { + if (!arguments.length) { + return getLibtype; + } + getLibtype = _; + return chart; + }; + + chart.getDelta = function (_) { + if (!arguments.length) { + return getDelta; + } + getDelta = _; + return chart; + }; + + chart.setSearchHandler = function (_) { + if (!arguments.length) { + searchHandler = originalSearchHandler; + return chart; + } + searchHandler = _; + return chart; + }; + + chart.setDetailsHandler = function (_) { + if (!arguments.length) { + detailsHandler = originalDetailsHandler; + return chart; + } + detailsHandler = _; + return chart; + }; + + chart.setSearchMatch = function (_) { + if (!arguments.length) { + searchMatch = originalSearchMatch; + return chart; + } + searchMatch = _; + return chart; + }; + + return chart; + } + + __webpack_exports__ = __webpack_exports__['default']; + /******/ return __webpack_exports__; + /******/ + })(); +}); diff --git a/development/charts/table/index.html b/development/charts/table/index.html new file mode 100644 index 000000000..ec11ecfde --- /dev/null +++ b/development/charts/table/index.html @@ -0,0 +1,67 @@ + + + + + + + + +
+
+ + + + + + + +
S.NoNameTotalTime
+
+
+ + diff --git a/development/charts/table/jquery.min.js b/development/charts/table/jquery.min.js new file mode 100644 index 000000000..8cdc80eb8 --- /dev/null +++ b/development/charts/table/jquery.min.js @@ -0,0 +1,18 @@ +/*! + * jQuery JavaScript Library v1.6.2 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu Jun 30 14:16:56 2011 -0400 + */ +(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return!0}function D(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i. +shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j +)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bX(bS,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cv(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/development/create-static-server.js b/development/create-static-server.js old mode 100644 new mode 100755 index c01a5e16a..a8d5e28b0 --- a/development/create-static-server.js +++ b/development/create-static-server.js @@ -1,3 +1,4 @@ +#!/usr/bin/env node const http = require('http'); const path = require('path'); diff --git a/development/generate-lavamoat-policies.js b/development/generate-lavamoat-policies.js new file mode 100755 index 000000000..4ac600636 --- /dev/null +++ b/development/generate-lavamoat-policies.js @@ -0,0 +1,54 @@ +#!/usr/bin/env node +const concurrently = require('concurrently'); +const yargs = require('yargs/yargs'); +const { hideBin } = require('yargs/helpers'); +const { BuildType } = require('./lib/build-type'); + +start().catch((error) => { + console.error('Policy generation failed.', error); + process.exitCode = 1; +}); + +async function start() { + const { + argv: { buildTypes, parallel }, + } = yargs(hideBin(process.argv)).usage( + '$0 [options]', + 'Generate the LavaMoat policy file for one more more build types.', + (yargsInstance) => + yargsInstance + .option('build-types', { + alias: ['t'], + choices: Object.values(BuildType), + default: Object.values(BuildType), + demandOption: true, + description: 'The build type(s) to generate policy files for.', + }) + .option('parallel', { + alias: ['p'], + default: true, + demandOption: true, + description: 'Whether to generate policies in parallel.', + type: 'boolean', + }) + .strict(), + ); + + await concurrently( + (Array.isArray(buildTypes) ? buildTypes : [buildTypes]).map( + (buildType) => ({ + command: `yarn build scripts:dist --policy-only --build-type=${buildType}`, + env: { + WRITE_AUTO_POLICY: 1, + }, + name: buildType, + }), + ), + { + killOthers: true, + maxProcesses: parallel ? buildTypes.length : 1, + }, + ); + + console.log('Policy file(s) successfully generated!'); +} diff --git a/development/generate-lavamoat-policies.sh b/development/generate-lavamoat-policies.sh deleted file mode 100755 index fe91aaeaf..000000000 --- a/development/generate-lavamoat-policies.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -u -set -o pipefail - -# Generate LavaMoat policies for the extension background script for each build -# type. -# ATTN: This may tax your device when running it locally. -WRITE_AUTO_POLICY=1 yarn build scripts:prod --policy-only && -WRITE_AUTO_POLICY=1 yarn build scripts:prod --policy-only --build-type beta && -WRITE_AUTO_POLICY=1 yarn build scripts:prod --policy-only --build-type flask diff --git a/development/gource-viz.sh b/development/gource-viz.sh index d2896f940..daacbdfe1 100755 --- a/development/gource-viz.sh +++ b/development/gource-viz.sh @@ -21,4 +21,4 @@ gource \ --title "MetaMask Development History" \ --output-ppm-stream - \ --output-framerate 30 \ - | ffmpeg -y -r 30 -f image2pipe -vcodec ppm -i - -b 65536K metamask-dev-history.mp4 \ No newline at end of file + | ffmpeg -y -r 30 -f image2pipe -vcodec ppm -i - -b 65536K metamask-dev-history.mp4 diff --git a/development/highlights/README.md b/development/highlights/README.md index 1f6788ea9..f5c5952bc 100644 --- a/development/highlights/README.md +++ b/development/highlights/README.md @@ -1,3 +1,3 @@ ### highlights -the purpose of this directory is to house utilities for generating "highlight" messages for the metamaskbot comment based on changes included in the PR \ No newline at end of file +the purpose of this directory is to house utilities for generating "highlight" messages for the metamaskbot comment based on changes included in the PR diff --git a/development/highlights/index.js b/development/highlights/index.js index 5ed891e5d..2b263005f 100644 --- a/development/highlights/index.js +++ b/development/highlights/index.js @@ -1,6 +1,6 @@ const { promisify } = require('util'); const exec = promisify(require('child_process').exec); -const storybook = require('./storybook.js'); +const storybook = require('./storybook'); module.exports = { getHighlights }; diff --git a/development/lib/create-segment-server.js b/development/lib/create-segment-server.js index f2181af7b..34c3d365a 100644 --- a/development/lib/create-segment-server.js +++ b/development/lib/create-segment-server.js @@ -19,7 +19,7 @@ function defaultOnError(error) { /** * This function handles requests for the mock Segment server * - * @typedef {(request: IncomingMessage, response: ServerResponse, metricEvents: Array) => void} MockSegmentRequestHandler + * @typedef {(request: IncomingMessage, response: ServerResponse, metricEvents: Array) => void} MockSegmentRequestHandler */ /** diff --git a/development/lib/locales.js b/development/lib/locales.js index 0b83d0ac6..f2e8da816 100644 --- a/development/lib/locales.js +++ b/development/lib/locales.js @@ -18,6 +18,7 @@ function getLocalePath(code) { ); } +// eslint-disable-next-line consistent-return async function getLocale(code) { try { const localeFilePath = getLocalePath(code); diff --git a/development/metamaskbot-build-announce.js b/development/metamaskbot-build-announce.js index 9310a92d8..8ce98ce67 100755 --- a/development/metamaskbot-build-announce.js +++ b/development/metamaskbot-build-announce.js @@ -1,6 +1,8 @@ #!/usr/bin/env node const { promises: fs } = require('fs'); const path = require('path'); +// Fetch is part of node js in future versions, thus triggering no-shadow +// eslint-disable-next-line no-shadow const fetch = require('node-fetch'); const glob = require('fast-glob'); const VERSION = require('../package.json').version; @@ -91,9 +93,22 @@ async function start() { const storybookUrl = `${BUILD_LINK_BASE}/storybook/index.html`; const storybookLink = `Storybook`; + const tsMigrationDashboardUrl = `${BUILD_LINK_BASE}/ts-migration-dashboard/index.html`; + const tsMigrationDashboardLink = `Dashboard`; + // links to bundle browser builds const depVizUrl = `${BUILD_LINK_BASE}/build-artifacts/build-viz/index.html`; const depVizLink = `Build System`; + const moduleInitStatsBackgroundUrl = `${BUILD_LINK_BASE}/test-artifacts/chrome/mv3/initialisation/background/index.html`; + const moduleInitStatsBackgroundLink = `Background Module Init Stats`; + const moduleInitStatsUIUrl = `${BUILD_LINK_BASE}/test-artifacts/chrome/mv3/initialisation/ui/index.html`; + const moduleInitStatsUILink = `UI Init Stats`; + const moduleLoadStatsUrl = `${BUILD_LINK_BASE}/test-artifacts/chrome/mv3/load_time/index.html`; + const moduleLoadStatsLink = `Module Load Stats`; + const bundleSizeStatsUrl = `${BUILD_LINK_BASE}/test-artifacts/chrome/mv3/bundle_size.json`; + const bundleSizeStatsLink = `Bundle Size Stats`; + const userActionsStatsUrl = `${BUILD_LINK_BASE}/test-artifacts/chrome/benchmark/user_actions.json`; + const userActionsStatsLink = `E2e Actions Stats`; // link to artifacts const allArtifactsUrl = `https://circleci.com/gh/MetaMask/metamask-extension/${CIRCLE_BUILD_NUM}#artifacts/containers/0`; @@ -103,8 +118,14 @@ async function start() { `builds (beta): ${betaBuildLinks}`, `builds (flask): ${flaskBuildLinks}`, `build viz: ${depVizLink}`, + `mv3: ${moduleInitStatsBackgroundLink}`, + `mv3: ${moduleInitStatsUILink}`, + `mv3: ${moduleLoadStatsLink}`, + `mv3: ${bundleSizeStatsLink}`, + `mv2: ${userActionsStatsLink}`, `code coverage: ${coverageLink}`, `storybook: ${storybookLink}`, + `typescript migration: ${tsMigrationDashboardLink}`, `all artifacts`, `
bundle viz: diff --git a/development/missing-locale-strings.js b/development/missing-locale-strings.js old mode 100644 new mode 100755 index 387e13501..4bf60552d --- a/development/missing-locale-strings.js +++ b/development/missing-locale-strings.js @@ -1,3 +1,4 @@ +#!/usr/bin/env node // ////////////////////////////////////////////////////////////////////////////// // // Reports on missing localized strings diff --git a/development/mock-segment.js b/development/mock-segment.js old mode 100644 new mode 100755 index 347bc6fa7..9d11738de --- a/development/mock-segment.js +++ b/development/mock-segment.js @@ -1,3 +1,4 @@ +#!/usr/bin/env node const { createSegmentServer } = require('./lib/create-segment-server'); const { parsePort } = require('./lib/parse-port'); diff --git a/development/sentry-publish.js b/development/sentry-publish.js old mode 100644 new mode 100755 diff --git a/development/show-deps-install-scripts.js b/development/show-deps-install-scripts.js old mode 100644 new mode 100755 index dca698b10..f84bab6f5 --- a/development/show-deps-install-scripts.js +++ b/development/show-deps-install-scripts.js @@ -1,3 +1,4 @@ +#!/usr/bin/env node // This script lists all dependencies that have package install scripts const path = require('path'); const readInstalled = require('read-installed'); diff --git a/development/sourcemap-validator.js b/development/sourcemap-validator.js old mode 100644 new mode 100755 index 0531a03ce..87c74a123 --- a/development/sourcemap-validator.js +++ b/development/sourcemap-validator.js @@ -1,3 +1,4 @@ +#!/usr/bin/env node const fs = require('fs'); const path = require('path'); const { SourceMapConsumer } = require('source-map'); diff --git a/development/static-server.js b/development/static-server.js old mode 100644 new mode 100755 index de994aec3..facdc915b --- a/development/static-server.js +++ b/development/static-server.js @@ -1,3 +1,4 @@ +#!/usr/bin/env node const fs = require('fs'); const path = require('path'); diff --git a/development/ts-migration-dashboard/files-to-convert.json b/development/ts-migration-dashboard/files-to-convert.json new file mode 100644 index 000000000..e8cc2681f --- /dev/null +++ b/development/ts-migration-dashboard/files-to-convert.json @@ -0,0 +1,1737 @@ +[ + ".eslintrc.js", + "app/scripts/account-import-strategies/account-import-strategies.test.js", + "app/scripts/account-import-strategies/index.js", + "app/scripts/background.js", + "app/scripts/constants/contracts.js", + "app/scripts/constants/on-ramp.js", + "app/scripts/contentscript.js", + "app/scripts/controllers/alert.js", + "app/scripts/controllers/app-state.js", + "app/scripts/controllers/cached-balances.js", + "app/scripts/controllers/cached-balances.test.js", + "app/scripts/controllers/detect-tokens.js", + "app/scripts/controllers/detect-tokens.test.js", + "app/scripts/controllers/ens/ens.js", + "app/scripts/controllers/ens/index.js", + "app/scripts/controllers/ens/index.test.js", + "app/scripts/controllers/incoming-transactions.js", + "app/scripts/controllers/incoming-transactions.test.js", + "app/scripts/controllers/metametrics.js", + "app/scripts/controllers/metametrics.test.js", + "app/scripts/controllers/network/createInfuraClient.js", + "app/scripts/controllers/network/createJsonRpcClient.js", + "app/scripts/controllers/network/createMetamaskMiddleware.js", + "app/scripts/controllers/network/index.js", + "app/scripts/controllers/network/middleware/pending.js", + "app/scripts/controllers/network/network-controller.test.js", + "app/scripts/controllers/network/network.js", + "app/scripts/controllers/network/pending-middleware.test.js", + "app/scripts/controllers/network/util.js", + "app/scripts/controllers/network/util.test.js", + "app/scripts/controllers/onboarding.js", + "app/scripts/controllers/permissions/background-api.js", + "app/scripts/controllers/permissions/background-api.test.js", + "app/scripts/controllers/permissions/caveat-mutators.js", + "app/scripts/controllers/permissions/caveat-mutators.test.js", + "app/scripts/controllers/permissions/enums.js", + "app/scripts/controllers/permissions/flask/snap-permissions.js", + "app/scripts/controllers/permissions/flask/snap-permissions.test.js", + "app/scripts/controllers/permissions/index.js", + "app/scripts/controllers/permissions/permission-log.js", + "app/scripts/controllers/permissions/permission-log.test.js", + "app/scripts/controllers/permissions/selectors.js", + "app/scripts/controllers/permissions/selectors.test.js", + "app/scripts/controllers/permissions/specifications.js", + "app/scripts/controllers/permissions/specifications.test.js", + "app/scripts/controllers/preferences.js", + "app/scripts/controllers/preferences.test.js", + "app/scripts/controllers/swaps.js", + "app/scripts/controllers/swaps.test.js", + "app/scripts/controllers/threebox.js", + "app/scripts/controllers/transactions/index.js", + "app/scripts/controllers/transactions/index.test.js", + "app/scripts/controllers/transactions/lib/tx-state-history-helpers.js", + "app/scripts/controllers/transactions/lib/tx-state-history-helpers.test.js", + "app/scripts/controllers/transactions/lib/util.js", + "app/scripts/controllers/transactions/lib/util.test.js", + "app/scripts/controllers/transactions/pending-tx-tracker.js", + "app/scripts/controllers/transactions/pending-tx-tracker.test.js", + "app/scripts/controllers/transactions/tx-gas-utils.js", + "app/scripts/controllers/transactions/tx-gas-utils.test.js", + "app/scripts/controllers/transactions/tx-state-manager.js", + "app/scripts/controllers/transactions/tx-state-manager.test.js", + "app/scripts/detect-multiple-instances.js", + "app/scripts/detect-multiple-instances.test.js", + "app/scripts/disable-console.js", + "app/scripts/first-time-state.js", + "app/scripts/inpage.js", + "app/scripts/lib/ComposableObservableStore.js", + "app/scripts/lib/ComposableObservableStore.test.js", + "app/scripts/lib/account-tracker.js", + "app/scripts/lib/buy-url.js", + "app/scripts/lib/buy-url.test.js", + "app/scripts/lib/cleanErrorStack.js", + "app/scripts/lib/cleanErrorStack.test.js", + "app/scripts/lib/createLoggerMiddleware.js", + "app/scripts/lib/createMetaRPCHandler.js", + "app/scripts/lib/createMetaRPCHandler.test.js", + "app/scripts/lib/createOnboardingMiddleware.js", + "app/scripts/lib/createOriginMiddleware.js", + "app/scripts/lib/createRPCMethodTrackingMiddleware.js", + "app/scripts/lib/createRPCMethodTrackingMiddleware.test.js", + "app/scripts/lib/createStreamSink.js", + "app/scripts/lib/createTabIdMiddleware.js", + "app/scripts/lib/decrypt-message-manager.js", + "app/scripts/lib/encryption-public-key-manager.js", + "app/scripts/lib/ens-ipfs/contracts/registry.js", + "app/scripts/lib/ens-ipfs/contracts/resolver.js", + "app/scripts/lib/ens-ipfs/resolver.js", + "app/scripts/lib/ens-ipfs/setup.js", + "app/scripts/lib/extractEthjsErrorMessage.js", + "app/scripts/lib/get-first-preferred-lang-code.js", + "app/scripts/lib/getObjStructure.js", + "app/scripts/lib/local-store.js", + "app/scripts/lib/message-manager.js", + "app/scripts/lib/message-manager.test.js", + "app/scripts/lib/metaRPCClientFactory.js", + "app/scripts/lib/metaRPCClientFactory.test.js", + "app/scripts/lib/migrator/index.js", + "app/scripts/lib/migrator/index.test.js", + "app/scripts/lib/network-store.js", + "app/scripts/lib/notification-manager.js", + "app/scripts/lib/personal-message-manager.js", + "app/scripts/lib/personal-message-manager.test.js", + "app/scripts/lib/rpc-method-middleware/createMethodMiddleware.js", + "app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js", + "app/scripts/lib/rpc-method-middleware/handlers/eth-accounts.js", + "app/scripts/lib/rpc-method-middleware/handlers/get-provider-state.js", + "app/scripts/lib/rpc-method-middleware/handlers/index.js", + "app/scripts/lib/rpc-method-middleware/handlers/log-web3-shim-usage.js", + "app/scripts/lib/rpc-method-middleware/handlers/request-accounts.js", + "app/scripts/lib/rpc-method-middleware/handlers/send-metadata.js", + "app/scripts/lib/rpc-method-middleware/handlers/switch-ethereum-chain.js", + "app/scripts/lib/rpc-method-middleware/handlers/watch-asset.js", + "app/scripts/lib/rpc-method-middleware/index.js", + "app/scripts/lib/seed-phrase-verifier.js", + "app/scripts/lib/seed-phrase-verifier.test.js", + "app/scripts/lib/segment.js", + "app/scripts/lib/setupSentry.js", + "app/scripts/lib/stream-utils.js", + "app/scripts/lib/typed-message-manager.js", + "app/scripts/lib/typed-message-manager.test.js", + "app/scripts/lib/util.js", + "app/scripts/lib/util.test.js", + "app/scripts/lockdown-more.js", + "app/scripts/lockdown-run.js", + "app/scripts/metamask-controller.js", + "app/scripts/metamask-controller.test.js", + "app/scripts/migrations/002.js", + "app/scripts/migrations/003.js", + "app/scripts/migrations/004.js", + "app/scripts/migrations/005.js", + "app/scripts/migrations/006.js", + "app/scripts/migrations/007.js", + "app/scripts/migrations/008.js", + "app/scripts/migrations/009.js", + "app/scripts/migrations/010.js", + "app/scripts/migrations/011.js", + "app/scripts/migrations/012.js", + "app/scripts/migrations/013.js", + "app/scripts/migrations/014.js", + "app/scripts/migrations/015.js", + "app/scripts/migrations/016.js", + "app/scripts/migrations/017.js", + "app/scripts/migrations/018.js", + "app/scripts/migrations/019.js", + "app/scripts/migrations/020.js", + "app/scripts/migrations/021.js", + "app/scripts/migrations/021.test.js", + "app/scripts/migrations/022.js", + "app/scripts/migrations/022.test.js", + "app/scripts/migrations/023.js", + "app/scripts/migrations/023.test.js", + "app/scripts/migrations/024.js", + "app/scripts/migrations/024.test.js", + "app/scripts/migrations/025.js", + "app/scripts/migrations/025.test.js", + "app/scripts/migrations/026.js", + "app/scripts/migrations/026.test.js", + "app/scripts/migrations/027.js", + "app/scripts/migrations/027.test.js", + "app/scripts/migrations/028.js", + "app/scripts/migrations/028.test.js", + "app/scripts/migrations/029.js", + "app/scripts/migrations/029.test.js", + "app/scripts/migrations/030.js", + "app/scripts/migrations/030.test.js", + "app/scripts/migrations/031.js", + "app/scripts/migrations/031.test.js", + "app/scripts/migrations/032.js", + "app/scripts/migrations/033.js", + "app/scripts/migrations/033.test.js", + "app/scripts/migrations/034.js", + "app/scripts/migrations/034.test.js", + "app/scripts/migrations/035.js", + "app/scripts/migrations/035.test.js", + "app/scripts/migrations/036.js", + "app/scripts/migrations/036.test.js", + "app/scripts/migrations/037.js", + "app/scripts/migrations/037.test.js", + "app/scripts/migrations/038.js", + "app/scripts/migrations/038.test.js", + "app/scripts/migrations/039.js", + "app/scripts/migrations/039.test.js", + "app/scripts/migrations/040.js", + "app/scripts/migrations/040.test.js", + "app/scripts/migrations/041.js", + "app/scripts/migrations/041.test.js", + "app/scripts/migrations/042.js", + "app/scripts/migrations/042.test.js", + "app/scripts/migrations/043.js", + "app/scripts/migrations/043.test.js", + "app/scripts/migrations/044.js", + "app/scripts/migrations/044.test.js", + "app/scripts/migrations/045.js", + "app/scripts/migrations/045.test.js", + "app/scripts/migrations/046.js", + "app/scripts/migrations/046.test.js", + "app/scripts/migrations/047.js", + "app/scripts/migrations/047.test.js", + "app/scripts/migrations/048.js", + "app/scripts/migrations/048.test.js", + "app/scripts/migrations/049.js", + "app/scripts/migrations/049.test.js", + "app/scripts/migrations/050.js", + "app/scripts/migrations/050.test.js", + "app/scripts/migrations/051.js", + "app/scripts/migrations/051.test.js", + "app/scripts/migrations/052.js", + "app/scripts/migrations/052.test.js", + "app/scripts/migrations/053.js", + "app/scripts/migrations/053.test.js", + "app/scripts/migrations/054.js", + "app/scripts/migrations/054.test.js", + "app/scripts/migrations/055.js", + "app/scripts/migrations/055.test.js", + "app/scripts/migrations/056.js", + "app/scripts/migrations/056.test.js", + "app/scripts/migrations/057.js", + "app/scripts/migrations/057.test.js", + "app/scripts/migrations/058.js", + "app/scripts/migrations/058.test.js", + "app/scripts/migrations/059.js", + "app/scripts/migrations/059.test.js", + "app/scripts/migrations/060.js", + "app/scripts/migrations/060.test.js", + "app/scripts/migrations/061.js", + "app/scripts/migrations/061.test.js", + "app/scripts/migrations/062.js", + "app/scripts/migrations/062.test.js", + "app/scripts/migrations/063.js", + "app/scripts/migrations/063.test.js", + "app/scripts/migrations/064.js", + "app/scripts/migrations/064.test.js", + "app/scripts/migrations/065.js", + "app/scripts/migrations/065.test.js", + "app/scripts/migrations/066.js", + "app/scripts/migrations/066.test.js", + "app/scripts/migrations/067.js", + "app/scripts/migrations/067.test.js", + "app/scripts/migrations/068.js", + "app/scripts/migrations/068.test.js", + "app/scripts/migrations/069.js", + "app/scripts/migrations/069.test.js", + "app/scripts/migrations/070.js", + "app/scripts/migrations/070.test.js", + "app/scripts/migrations/071.js", + "app/scripts/migrations/071.test.js", + "app/scripts/migrations/072.js", + "app/scripts/migrations/072.test.js", + "app/scripts/migrations/073.js", + "app/scripts/migrations/073.test.js", + "app/scripts/migrations/fail-tx.js", + "app/scripts/migrations/index.js", + "app/scripts/migrations/migrations.test.js", + "app/scripts/migrations/template.js", + "app/scripts/migrations/template.test.js", + "app/scripts/platforms/extension.js", + "app/scripts/platforms/extension.test.js", + "app/scripts/sentry-install.js", + "app/scripts/ui.js", + "development/build/constants.js", + "development/build/display.js", + "development/build/etc.js", + "development/build/index.js", + "development/build/manifest.js", + "development/build/sass-compiler.js", + "development/build/scripts.js", + "development/build/static.js", + "development/build/styles.js", + "development/build/task.js", + "development/build/transforms/remove-fenced-code.js", + "development/build/transforms/remove-fenced-code.test.js", + "development/build/transforms/utils.js", + "development/build/transforms/utils.test.js", + "development/build/utils.js", + "development/lib/build-type.js", + "development/lib/get-version.js", + "development/stream-flat-map.js", + "shared/constants/alerts.js", + "shared/constants/app.js", + "shared/constants/gas.js", + "shared/constants/hardware-wallets.js", + "shared/constants/labels.js", + "shared/constants/metametrics.js", + "shared/constants/network.js", + "shared/constants/permissions.js", + "shared/constants/permissions.test.js", + "shared/constants/phishing.js", + "shared/constants/smartTransactions.js", + "shared/constants/swaps.js", + "shared/constants/time.js", + "shared/constants/transaction.js", + "shared/modules/buffer-utils.js", + "shared/modules/buffer-utils.test.js", + "shared/modules/contract-utils.js", + "shared/modules/contract-utils.test.js", + "shared/modules/conversion.utils.js", + "shared/modules/conversion.utils.test.js", + "shared/modules/fetch-with-timeout.js", + "shared/modules/fetch-with-timeout.test.js", + "shared/modules/gas.utils.js", + "shared/modules/gas.utils.test.js", + "shared/modules/hexstring-utils.js", + "shared/modules/hexstring-utils.test.js", + "shared/modules/mv3.utils.js", + "shared/modules/network.utils.js", + "shared/modules/object.utils.js", + "shared/modules/random-id.js", + "shared/modules/rpc.utils.js", + "shared/modules/siwe.js", + "shared/modules/string-utils.js", + "shared/modules/swaps.utils.js", + "shared/modules/transaction.utils.js", + "shared/modules/transaction.utils.test.js", + "shared/notifications/index.js", + "test/helpers/protect-intrinsics-helpers.js", + "test/jest/background.js", + "test/jest/constants.js", + "test/jest/index.js", + "test/jest/mock-store.js", + "test/jest/mocks.js", + "test/jest/rendering.js", + "test/lib/createTxMeta.js", + "test/lib/mock-encryptor.js", + "test/lib/render-helpers.js", + "test/lib/tick.js", + "test/lib/wait-until-called.js", + "test/mocks/permissions.js", + "test/stub/provider.js", + "test/stub/tx-meta-stub.js", + "test/unit-global/balance-formatter.test.js", + "test/unit-global/protect-intrinsics.test.js", + "ui/components/app/account-list-item/account-list-item-component.test.js", + "ui/components/app/account-list-item/account-list-item.js", + "ui/components/app/account-list-item/account-list-item.stories.js", + "ui/components/app/account-list-item/index.js", + "ui/components/app/account-menu/account-menu.component.js", + "ui/components/app/account-menu/account-menu.container.js", + "ui/components/app/account-menu/account-menu.test.js", + "ui/components/app/account-menu/index.js", + "ui/components/app/account-menu/keyring-label.js", + "ui/components/app/add-network/add-network.js", + "ui/components/app/add-network/add-network.stories.js", + "ui/components/app/add-network/add-network.test.js", + "ui/components/app/advanced-gas-controls/advanced-gas-controls.component.js", + "ui/components/app/advanced-gas-controls/advanced-gas-controls.stories.js", + "ui/components/app/advanced-gas-controls/advanced-gas-controls.test.js", + "ui/components/app/advanced-gas-controls/index.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-defaults/advanced-gas-fee-defaults.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-defaults/advanced-gas-fee-defaults.test.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-defaults/index.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-gas-limit/advanced-gas-fee-gas-limit.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-gas-limit/advanced-gas-fee-gas-limit.test.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-gas-limit/index.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-input-subtext/advanced-gas-fee-input-subtext.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-input-subtext/advanced-gas-fee-input-subtext.test.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-input-subtext/index.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-inputs/advanced-gas-fee-inputs.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-inputs/base-fee-input/base-fee-input.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-inputs/base-fee-input/base-fee-input.test.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-inputs/base-fee-input/index.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-inputs/index.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-inputs/priority-fee-input/index.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-inputs/priority-fee-input/priority-fee-input.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-inputs/priority-fee-input/priority-fee-input.test.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-popover.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-popover.test.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-save/advanced-gas-fee-save.js", + "ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-save/index.js", + "ui/components/app/advanced-gas-fee-popover/context/advancedGasFeePopover.js", + "ui/components/app/advanced-gas-fee-popover/context/index.js", + "ui/components/app/advanced-gas-fee-popover/index.js", + "ui/components/app/alerts/alerts.js", + "ui/components/app/alerts/index.js", + "ui/components/app/alerts/invalid-custom-network-alert/index.js", + "ui/components/app/alerts/invalid-custom-network-alert/invalid-custom-network-alert.js", + "ui/components/app/alerts/unconnected-account-alert/index.js", + "ui/components/app/alerts/unconnected-account-alert/unconnected-account-alert.js", + "ui/components/app/alerts/unconnected-account-alert/unconnected-account-alert.test.js", + "ui/components/app/app-header/app-header.component.js", + "ui/components/app/app-header/app-header.container.js", + "ui/components/app/app-header/app-header.stories.js", + "ui/components/app/app-header/app-header.test.js", + "ui/components/app/app-header/index.js", + "ui/components/app/app-loading-spinner/app-loading-spinner.js", + "ui/components/app/app-loading-spinner/app-loading-spinner.test.js", + "ui/components/app/app-loading-spinner/index.js", + "ui/components/app/asset-list-item/asset-list-item.js", + "ui/components/app/asset-list-item/index.js", + "ui/components/app/asset-list/asset-list.js", + "ui/components/app/asset-list/detetcted-tokens-link/detected-tokens-link.js", + "ui/components/app/asset-list/detetcted-tokens-link/detected-tokens-link.stories.js", + "ui/components/app/asset-list/detetcted-tokens-link/detected-tokens-link.test.js", + "ui/components/app/asset-list/index.js", + "ui/components/app/cancel-button/cancel-button.js", + "ui/components/app/cancel-button/index.js", + "ui/components/app/cancel-speedup-popover/cancel-speedup-popover.js", + "ui/components/app/cancel-speedup-popover/cancel-speedup-popover.test.js", + "ui/components/app/cancel-speedup-popover/index.js", + "ui/components/app/collectible-default-image/collectible-default-image.js", + "ui/components/app/collectible-default-image/collectible-default-image.stories.js", + "ui/components/app/collectible-default-image/index.js", + "ui/components/app/collectible-details/collectible-details.js", + "ui/components/app/collectible-details/collectible-details.stories.js", + "ui/components/app/collectible-options/collectible-options.js", + "ui/components/app/collectibles-detection-notice/collectibles-detection-notice.js", + "ui/components/app/collectibles-detection-notice/index.js", + "ui/components/app/collectibles-items/collectibles-items.js", + "ui/components/app/collectibles-items/index.js", + "ui/components/app/collectibles-tab/collectibles-tab.js", + "ui/components/app/collectibles-tab/collectibles-tab.test.js", + "ui/components/app/collectibles-tab/index.js", + "ui/components/app/confirm-page-container/confirm-detail-row/confirm-detail-row.component.js", + "ui/components/app/confirm-page-container/confirm-detail-row/confirm-detail-row.component.test.js", + "ui/components/app/confirm-page-container/confirm-detail-row/confirm-detail-row.stories.js", + "ui/components/app/confirm-page-container/confirm-detail-row/index.js", + "ui/components/app/confirm-page-container/confirm-page-container-container.test.js", + "ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.js", + "ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.test.js", + "ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.component.js", + "ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/index.js", + "ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-warning/confirm-page-container-warning.component.js", + "ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-warning/confirm-page-container-warning.stories.js", + "ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-warning/index.js", + "ui/components/app/confirm-page-container/confirm-page-container-content/index.js", + "ui/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.js", + "ui/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.test.js", + "ui/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.stories.js", + "ui/components/app/confirm-page-container/confirm-page-container-header/index.js", + "ui/components/app/confirm-page-container/confirm-page-container-navigation/confirm-page-container-navigation.component.js", + "ui/components/app/confirm-page-container/confirm-page-container-navigation/index.js", + "ui/components/app/confirm-page-container/confirm-page-container.component.js", + "ui/components/app/confirm-page-container/confirm-page-container.container.js", + "ui/components/app/confirm-page-container/enableEIP1559V2-notice/enableEIP1559V2-notice.js", + "ui/components/app/confirm-page-container/enableEIP1559V2-notice/index.js", + "ui/components/app/confirm-page-container/index.js", + "ui/components/app/connected-accounts-list/connected-accounts-list-item/connected-accounts-list-item.component.js", + "ui/components/app/connected-accounts-list/connected-accounts-list-item/index.js", + "ui/components/app/connected-accounts-list/connected-accounts-list-options/connected-accounts-list-options.component.js", + "ui/components/app/connected-accounts-list/connected-accounts-list-options/index.js", + "ui/components/app/connected-accounts-list/connected-accounts-list.component.js", + "ui/components/app/connected-accounts-list/connected-accounts-list.stories.js", + "ui/components/app/connected-accounts-list/index.js", + "ui/components/app/connected-accounts-permissions/connected-accounts-permissions.js", + "ui/components/app/connected-accounts-permissions/index.js", + "ui/components/app/connected-sites-list/connected-sites-list.component.js", + "ui/components/app/connected-sites-list/index.js", + "ui/components/app/connected-status-indicator/connected-status-indicator.js", + "ui/components/app/connected-status-indicator/index.js", + "ui/components/app/contact-list/contact-list.component.js", + "ui/components/app/contact-list/contact-list.test.js", + "ui/components/app/contact-list/index.js", + "ui/components/app/contact-list/recipient-group/recipient-group.component.js", + "ui/components/app/create-new-vault/create-new-vault.js", + "ui/components/app/create-new-vault/create-new-vault.stories.js", + "ui/components/app/create-new-vault/index.js", + "ui/components/app/currency-input/currency-input.js", + "ui/components/app/currency-input/currency-input.stories.js", + "ui/components/app/currency-input/currency-input.test.js", + "ui/components/app/currency-input/index.js", + "ui/components/app/detected-token/detected-token-address/detected-token-address.js", + "ui/components/app/detected-token/detected-token-address/detected-token-address.stories.js", + "ui/components/app/detected-token/detected-token-address/detected-token-address.test.js", + "ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.js", + "ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.stories.js", + "ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.test.js", + "ui/components/app/detected-token/detected-token-details/detected-token-details.js", + "ui/components/app/detected-token/detected-token-details/detected-token-details.stories.js", + "ui/components/app/detected-token/detected-token-details/detected-token-details.test.js", + "ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.js", + "ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.stories.js", + "ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.js", + "ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.stories.js", + "ui/components/app/detected-token/detected-token-values/detected-token-values.js", + "ui/components/app/detected-token/detected-token-values/detected-token-values.stories.js", + "ui/components/app/detected-token/detected-token-values/detected-token-values.test.js", + "ui/components/app/detected-token/detected-token.js", + "ui/components/app/detected-token/detected-token.test.js", + "ui/components/app/dropdowns/dropdown.js", + "ui/components/app/dropdowns/dropdown.test.js", + "ui/components/app/dropdowns/network-dropdown.js", + "ui/components/app/dropdowns/network-dropdown.test.js", + "ui/components/app/edit-gas-display-education/edit-gas-display-education.component.js", + "ui/components/app/edit-gas-display-education/edit-gas-display-education.stories.js", + "ui/components/app/edit-gas-display-education/index.js", + "ui/components/app/edit-gas-display/edit-gas-display.component.js", + "ui/components/app/edit-gas-display/edit-gas-display.stories.js", + "ui/components/app/edit-gas-display/edit-gas-display.test.js", + "ui/components/app/edit-gas-display/index.js", + "ui/components/app/edit-gas-fee-button/edit-gas-fee-button.js", + "ui/components/app/edit-gas-fee-button/edit-gas-fee-button.test.js", + "ui/components/app/edit-gas-fee-button/index.js", + "ui/components/app/edit-gas-fee-popover/edit-gas-fee-popover.js", + "ui/components/app/edit-gas-fee-popover/edit-gas-fee-popover.test.js", + "ui/components/app/edit-gas-fee-popover/edit-gas-item/edit-gas-item.js", + "ui/components/app/edit-gas-fee-popover/edit-gas-item/edit-gas-item.test.js", + "ui/components/app/edit-gas-fee-popover/edit-gas-item/index.js", + "ui/components/app/edit-gas-fee-popover/edit-gas-item/useCustomTimeEstimate.js", + "ui/components/app/edit-gas-fee-popover/edit-gas-item/useGasItemFeeDetails.js", + "ui/components/app/edit-gas-fee-popover/edit-gas-tooltip/edit-gas-tooltip.js", + "ui/components/app/edit-gas-fee-popover/edit-gas-tooltip/edit-gas-tooltip.test.js", + "ui/components/app/edit-gas-fee-popover/index.js", + "ui/components/app/edit-gas-fee-popover/network-statistics/index.js", + "ui/components/app/edit-gas-fee-popover/network-statistics/network-statistics.js", + "ui/components/app/edit-gas-fee-popover/network-statistics/network-statistics.test.js", + "ui/components/app/edit-gas-fee-popover/network-statistics/status-slider/index.js", + "ui/components/app/edit-gas-fee-popover/network-statistics/status-slider/status-slider.js", + "ui/components/app/edit-gas-fee-popover/network-statistics/status-slider/status-slider.test.js", + "ui/components/app/edit-gas-fee-popover/network-statistics/tooltips.js", + "ui/components/app/edit-gas-popover/edit-gas-popover.component.js", + "ui/components/app/edit-gas-popover/edit-gas-popover.stories.js", + "ui/components/app/edit-gas-popover/index.js", + "ui/components/app/flask/experimental-area/experimental-area.js", + "ui/components/app/flask/experimental-area/experimental-area.stories.js", + "ui/components/app/flask/experimental-area/index.js", + "ui/components/app/flask/snap-install-warning/index.js", + "ui/components/app/flask/snap-install-warning/snap-install-warning.js", + "ui/components/app/flask/snap-remove-warning/index.js", + "ui/components/app/flask/snap-remove-warning/snap-remove-warning.js", + "ui/components/app/flask/snap-settings-card/index.js", + "ui/components/app/flask/snap-settings-card/snap-settings-card.js", + "ui/components/app/flask/snap-settings-card/snap-settings-card.stories.js", + "ui/components/app/flask/snap-settings-card/snap-settings-card.test.js", + "ui/components/app/flask/snaps-authorship-pill/index.js", + "ui/components/app/flask/snaps-authorship-pill/snaps-authorship-pill.js", + "ui/components/app/flask/snaps-authorship-pill/snaps-authorship-pill.stories.js", + "ui/components/app/flask/update-snap-permission-list/index.js", + "ui/components/app/flask/update-snap-permission-list/update-snap-permission-list.js", + "ui/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.component.js", + "ui/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.container.js", + "ui/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.test.js", + "ui/components/app/gas-customization/advanced-gas-inputs/index.js", + "ui/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content-component.test.js", + "ui/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js", + "ui/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/index.js", + "ui/components/app/gas-customization/gas-modal-page-container/basic-tab-content/basic-tab-content-component.test.js", + "ui/components/app/gas-customization/gas-modal-page-container/basic-tab-content/basic-tab-content.component.js", + "ui/components/app/gas-customization/gas-modal-page-container/basic-tab-content/index.js", + "ui/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container-component.test.js", + "ui/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container-container.test.js", + "ui/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js", + "ui/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js", + "ui/components/app/gas-customization/gas-modal-page-container/index.js", + "ui/components/app/gas-customization/gas-price-button-group/gas-price-button-group-component.test.js", + "ui/components/app/gas-customization/gas-price-button-group/gas-price-button-group.component.js", + "ui/components/app/gas-customization/gas-price-button-group/gas-price-button-group.stories.js", + "ui/components/app/gas-customization/gas-price-button-group/index.js", + "ui/components/app/gas-customization/gas-slider/gas-slider.component.js", + "ui/components/app/gas-customization/gas-slider/gas-slider.stories.js", + "ui/components/app/gas-customization/gas-slider/index.js", + "ui/components/app/gas-details-item/gas-details-item-title/gas-details-item-title.js", + "ui/components/app/gas-details-item/gas-details-item-title/gas-details-item-title.test.js", + "ui/components/app/gas-details-item/gas-details-item-title/index.js", + "ui/components/app/gas-details-item/gas-details-item.js", + "ui/components/app/gas-details-item/gas-details-item.test.js", + "ui/components/app/gas-details-item/index.js", + "ui/components/app/gas-timing/gas-timing.component.js", + "ui/components/app/gas-timing/gas-timing.component.test.js", + "ui/components/app/gas-timing/index.js", + "ui/components/app/hold-to-reveal-button/hold-to-reveal-button.js", + "ui/components/app/hold-to-reveal-button/hold-to-reveal-button.stories.js", + "ui/components/app/hold-to-reveal-button/hold-to-reveal-button.test.js", + "ui/components/app/home-notification/home-notification.component.js", + "ui/components/app/home-notification/home-notification.stories.js", + "ui/components/app/home-notification/index.js", + "ui/components/app/import-token-link/import-token-link.component.js", + "ui/components/app/import-token-link/index.js", + "ui/components/app/info-box/index.js", + "ui/components/app/info-box/info-box.component.js", + "ui/components/app/info-box/info-box.stories.js", + "ui/components/app/info-box/info-box.test.js", + "ui/components/app/ledger-instruction-field/index.js", + "ui/components/app/ledger-instruction-field/ledger-instruction-field.js", + "ui/components/app/loading-network-screen/index.js", + "ui/components/app/loading-network-screen/loading-network-screen.component.js", + "ui/components/app/loading-network-screen/loading-network-screen.container.js", + "ui/components/app/menu-bar/account-options-menu.js", + "ui/components/app/menu-bar/accoutn-options-menu.stories.js", + "ui/components/app/menu-bar/index.js", + "ui/components/app/menu-bar/menu-bar.js", + "ui/components/app/menu-bar/menu-bar.test.js", + "ui/components/app/menu-droppo.js", + "ui/components/app/metamask-template-renderer/index.js", + "ui/components/app/metamask-template-renderer/metamask-template-renderer.js", + "ui/components/app/metamask-template-renderer/metamask-template-renderer.stories.js", + "ui/components/app/metamask-template-renderer/safe-component-list.js", + "ui/components/app/metamask-translation/index.js", + "ui/components/app/metamask-translation/metamask-translation.js", + "ui/components/app/metamask-translation/metamask-translation.stories.js", + "ui/components/app/modal/index.js", + "ui/components/app/modal/modal-content/index.js", + "ui/components/app/modal/modal-content/modal-content.component.js", + "ui/components/app/modal/modal-content/modal-content.component.test.js", + "ui/components/app/modal/modal.component.js", + "ui/components/app/modal/modal.component.test.js", + "ui/components/app/modals/account-details-modal/account-details-modal.component.js", + "ui/components/app/modals/account-details-modal/account-details-modal.container.js", + "ui/components/app/modals/account-details-modal/account-details-modal.test.js", + "ui/components/app/modals/account-details-modal/index.js", + "ui/components/app/modals/account-modal-container/account-modal-container.component.js", + "ui/components/app/modals/account-modal-container/account-modal-container.container.js", + "ui/components/app/modals/account-modal-container/index.js", + "ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/cancel-transaction-gas-fee.component.js", + "ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/cancel-transaction-gas-fee.component.test.js", + "ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/index.js", + "ui/components/app/modals/cancel-transaction/cancel-transaction.component.js", + "ui/components/app/modals/cancel-transaction/cancel-transaction.component.test.js", + "ui/components/app/modals/cancel-transaction/cancel-transaction.container.js", + "ui/components/app/modals/cancel-transaction/index.js", + "ui/components/app/modals/confirm-delete-network/confirm-delete-network.component.js", + "ui/components/app/modals/confirm-delete-network/confirm-delete-network.container.js", + "ui/components/app/modals/confirm-delete-network/confirm-delete-network.test.js", + "ui/components/app/modals/confirm-delete-network/index.js", + "ui/components/app/modals/confirm-remove-account/confirm-remove-account.component.js", + "ui/components/app/modals/confirm-remove-account/confirm-remove-account.container.js", + "ui/components/app/modals/confirm-remove-account/confirm-remove-account.stories.js", + "ui/components/app/modals/confirm-remove-account/confirm-remove-account.test.js", + "ui/components/app/modals/confirm-remove-account/index.js", + "ui/components/app/modals/confirm-reset-account/confirm-reset-account.component.js", + "ui/components/app/modals/confirm-reset-account/confirm-reset-account.container.js", + "ui/components/app/modals/confirm-reset-account/confirm-reset-account.test.js", + "ui/components/app/modals/confirm-reset-account/index.js", + "ui/components/app/modals/convert-token-to-nft-modal/convert-token-to-nft-modal.js", + "ui/components/app/modals/customize-nonce/customize-nonce.component.js", + "ui/components/app/modals/customize-nonce/index.js", + "ui/components/app/modals/deposit-ether-modal/deposit-ether-modal.component.js", + "ui/components/app/modals/deposit-ether-modal/deposit-ether-modal.container.js", + "ui/components/app/modals/deposit-ether-modal/index.js", + "ui/components/app/modals/edit-approval-permission/edit-approval-permission.component.js", + "ui/components/app/modals/edit-approval-permission/edit-approval-permission.container.js", + "ui/components/app/modals/edit-approval-permission/index.js", + "ui/components/app/modals/export-private-key-modal/export-private-key-modal.component.js", + "ui/components/app/modals/export-private-key-modal/export-private-key-modal.container.js", + "ui/components/app/modals/export-private-key-modal/export-private-key-modal.stories.js", + "ui/components/app/modals/export-private-key-modal/index.js", + "ui/components/app/modals/fade-modal.js", + "ui/components/app/modals/hide-token-confirmation-modal/hide-token-confirmation-modal.js", + "ui/components/app/modals/hide-token-confirmation-modal/hide-token-confirmation.stories.js", + "ui/components/app/modals/hide-token-confirmation-modal/index.js", + "ui/components/app/modals/index.js", + "ui/components/app/modals/metametrics-opt-in-modal/index.js", + "ui/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.component.js", + "ui/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.container.js", + "ui/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.test.js", + "ui/components/app/modals/modal.js", + "ui/components/app/modals/new-account-modal/index.js", + "ui/components/app/modals/new-account-modal/new-account-modal.component.js", + "ui/components/app/modals/new-account-modal/new-account-modal.container.js", + "ui/components/app/modals/new-account-modal/new-account-modal.stories.js", + "ui/components/app/modals/nickname-popovers/index.js", + "ui/components/app/modals/nickname-popovers/nickname-popovers.component.js", + "ui/components/app/modals/qr-scanner/index.js", + "ui/components/app/modals/qr-scanner/qr-scanner.component.js", + "ui/components/app/modals/qr-scanner/qr-scanner.container.js", + "ui/components/app/modals/reject-transactions/index.js", + "ui/components/app/modals/reject-transactions/reject-transactions.component.js", + "ui/components/app/modals/reject-transactions/reject-transactions.container.js", + "ui/components/app/modals/reject-transactions/reject-transactions.test.js", + "ui/components/app/modals/transaction-confirmed/index.js", + "ui/components/app/modals/transaction-confirmed/transaction-confirmed.component.js", + "ui/components/app/modals/transaction-confirmed/transaction-confirmed.container.js", + "ui/components/app/modals/transaction-confirmed/transaction-confirmed.stories.js", + "ui/components/app/modals/transaction-confirmed/transaction-confirmed.test.js", + "ui/components/app/multilayer-fee-message/index.js", + "ui/components/app/multilayer-fee-message/multi-layer-fee-message.js", + "ui/components/app/multiple-notifications/index.js", + "ui/components/app/multiple-notifications/multiple-notifications.component.js", + "ui/components/app/network-display/index.js", + "ui/components/app/network-display/network-display.js", + "ui/components/app/network-display/network-display.stories.js", + "ui/components/app/permission-page-container/index.js", + "ui/components/app/permission-page-container/permission-page-container-content/index.js", + "ui/components/app/permission-page-container/permission-page-container-content/permission-page-container-content.component.js", + "ui/components/app/permission-page-container/permission-page-container.component.js", + "ui/components/app/permission-page-container/permission-page-container.container.js", + "ui/components/app/permissions-connect-footer/index.js", + "ui/components/app/permissions-connect-footer/permissions-connect-footer.component.js", + "ui/components/app/permissions-connect-header/index.js", + "ui/components/app/permissions-connect-header/permissions-connect-header.component.js", + "ui/components/app/permissions-connect-permission-list/index.js", + "ui/components/app/permissions-connect-permission-list/permissions-connect-permission-list.js", + "ui/components/app/permissions-connect-permission-list/permissions-connect-permission-list.stories.js", + "ui/components/app/qr-hardware-popover/base-reader.js", + "ui/components/app/qr-hardware-popover/enhanced-reader.js", + "ui/components/app/qr-hardware-popover/index.js", + "ui/components/app/qr-hardware-popover/qr-hardware-popover.js", + "ui/components/app/qr-hardware-popover/qr-hardware-sign-request/index.js", + "ui/components/app/qr-hardware-popover/qr-hardware-sign-request/player.js", + "ui/components/app/qr-hardware-popover/qr-hardware-sign-request/qr-hardware-sign-request.component.js", + "ui/components/app/qr-hardware-popover/qr-hardware-sign-request/reader.js", + "ui/components/app/qr-hardware-popover/qr-hardware-wallet-importer/index.js", + "ui/components/app/qr-hardware-popover/qr-hardware-wallet-importer/qr-hardware-wallet-importer.component.js", + "ui/components/app/recovery-phrase-reminder/index.js", + "ui/components/app/recovery-phrase-reminder/recovery-phrase-reminder.js", + "ui/components/app/selected-account/index.js", + "ui/components/app/selected-account/selected-account-component.test.js", + "ui/components/app/selected-account/selected-account.component.js", + "ui/components/app/selected-account/selected-account.container.js", + "ui/components/app/signature-request-original/index.js", + "ui/components/app/signature-request-original/signature-request-original.component.js", + "ui/components/app/signature-request-original/signature-request-original.container.js", + "ui/components/app/signature-request-original/signature-request-original.stories.js", + "ui/components/app/signature-request-siwe/index.js", + "ui/components/app/signature-request-siwe/signature-request-siwe-header/index.js", + "ui/components/app/signature-request-siwe/signature-request-siwe-header/signature-request-siwe-header.js", + "ui/components/app/signature-request-siwe/signature-request-siwe-header/signature-request-siwe-header.stories.js", + "ui/components/app/signature-request-siwe/signature-request-siwe-message/index.js", + "ui/components/app/signature-request-siwe/signature-request-siwe-message/signature-request-siwe-message.js", + "ui/components/app/signature-request-siwe/signature-request-siwe-message/signature-request-siwe-message.stories.js", + "ui/components/app/signature-request-siwe/signature-request-siwe.js", + "ui/components/app/signature-request-siwe/signature-request-siwe.stories.js", + "ui/components/app/signature-request/index.js", + "ui/components/app/signature-request/signature-request-footer/index.js", + "ui/components/app/signature-request/signature-request-footer/signature-request-footer.component.js", + "ui/components/app/signature-request/signature-request-header/index.js", + "ui/components/app/signature-request/signature-request-header/signature-request-header.component.js", + "ui/components/app/signature-request/signature-request-header/signature-request-header.stories.js", + "ui/components/app/signature-request/signature-request-message/index.js", + "ui/components/app/signature-request/signature-request-message/signature-request-message.component.js", + "ui/components/app/signature-request/signature-request.component.js", + "ui/components/app/signature-request/signature-request.component.test.js", + "ui/components/app/signature-request/signature-request.container.js", + "ui/components/app/signature-request/signature-request.container.test.js", + "ui/components/app/signature-request/signature-request.stories.js", + "ui/components/app/srp-input/index.js", + "ui/components/app/srp-input/parse-secret-recovery-phrase.js", + "ui/components/app/srp-input/parse-secret-recovery-phrase.test.js", + "ui/components/app/srp-input/srp-input.js", + "ui/components/app/srp-input/srp-input.stories.js", + "ui/components/app/srp-input/srp-input.test.js", + "ui/components/app/step-progress-bar/index.js", + "ui/components/app/step-progress-bar/step-progress-bar.js", + "ui/components/app/tab-bar/index.js", + "ui/components/app/tab-bar/tab-bar.js", + "ui/components/app/tab-bar/tab-bar.stories.js", + "ui/components/app/token-cell/index.js", + "ui/components/app/token-cell/token-cell.js", + "ui/components/app/token-cell/token-cell.test.js", + "ui/components/app/token-list-display/index.js", + "ui/components/app/token-list-display/token-list-display.js", + "ui/components/app/token-list/index.js", + "ui/components/app/token-list/token-list.js", + "ui/components/app/transaction-activity-log/index.js", + "ui/components/app/transaction-activity-log/transaction-activity-log-icon/index.js", + "ui/components/app/transaction-activity-log/transaction-activity-log-icon/transaction-activity-log-icon.component.js", + "ui/components/app/transaction-activity-log/transaction-activity-log-icon/transaction-activity-log-icon.stories.js", + "ui/components/app/transaction-activity-log/transaction-activity-log.component.js", + "ui/components/app/transaction-activity-log/transaction-activity-log.component.test.js", + "ui/components/app/transaction-activity-log/transaction-activity-log.constants.js", + "ui/components/app/transaction-activity-log/transaction-activity-log.container.js", + "ui/components/app/transaction-activity-log/transaction-activity-log.container.test.js", + "ui/components/app/transaction-activity-log/transaction-activity-log.util.js", + "ui/components/app/transaction-activity-log/transaction-activity-log.util.test.js", + "ui/components/app/transaction-breakdown/index.js", + "ui/components/app/transaction-breakdown/transaction-breakdown-row/index.js", + "ui/components/app/transaction-breakdown/transaction-breakdown-row/transaction-breakdown-row.component.js", + "ui/components/app/transaction-breakdown/transaction-breakdown-row/transaction-breakdown-row.component.test.js", + "ui/components/app/transaction-breakdown/transaction-breakdown.component.js", + "ui/components/app/transaction-breakdown/transaction-breakdown.container.js", + "ui/components/app/transaction-breakdown/transaction-breakdown.test.js", + "ui/components/app/transaction-decoding/components/decoding/address/address.component.js", + "ui/components/app/transaction-decoding/components/decoding/address/index.js", + "ui/components/app/transaction-decoding/components/ui/accreditation/accreditation.component.js", + "ui/components/app/transaction-decoding/components/ui/accreditation/index.js", + "ui/components/app/transaction-decoding/components/ui/copy-raw-data/copy-raw-data.component.js", + "ui/components/app/transaction-decoding/components/ui/copy-raw-data/index.js", + "ui/components/app/transaction-decoding/constants.js", + "ui/components/app/transaction-decoding/index.js", + "ui/components/app/transaction-decoding/transaction-decoding.component.js", + "ui/components/app/transaction-decoding/transaction-decoding.util.js", + "ui/components/app/transaction-detail-item/index.js", + "ui/components/app/transaction-detail-item/transaction-detail-item.component.js", + "ui/components/app/transaction-detail-item/transaction-detail-item.stories.js", + "ui/components/app/transaction-detail/index.js", + "ui/components/app/transaction-detail/transaction-detail.component.js", + "ui/components/app/transaction-detail/transaction-detail.component.test.js", + "ui/components/app/transaction-detail/transaction-detail.stories.js", + "ui/components/app/transaction-icon/index.js", + "ui/components/app/transaction-icon/transaction-icon.js", + "ui/components/app/transaction-list-item-details/index.js", + "ui/components/app/transaction-list-item-details/transaction-list-item-details.component.js", + "ui/components/app/transaction-list-item-details/transaction-list-item-details.component.test.js", + "ui/components/app/transaction-list-item-details/transaction-list-item-details.container.js", + "ui/components/app/transaction-list-item/index.js", + "ui/components/app/transaction-list-item/smart-transaction-list-item.component.js", + "ui/components/app/transaction-list-item/transaction-list-item.component.js", + "ui/components/app/transaction-list-item/transaction-list-item.component.test.js", + "ui/components/app/transaction-list-item/transaction-list-item.stories.js", + "ui/components/app/transaction-list/index.js", + "ui/components/app/transaction-list/transaction-list.component.js", + "ui/components/app/transaction-list/transaction-list.stories.js", + "ui/components/app/transaction-status/transaction-status.component.js", + "ui/components/app/transaction-status/transaction-status.component.test.js", + "ui/components/app/transaction-total-banner/index.js", + "ui/components/app/transaction-total-banner/transaction-total-banner.component.js", + "ui/components/app/transaction-total-banner/transaction-total-banner.stories.js", + "ui/components/app/transaction-total-banner/transaction-total-banner.stories.test.js", + "ui/components/app/user-preferenced-currency-display/index.js", + "ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.js", + "ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.test.js", + "ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.stories.js", + "ui/components/app/user-preferenced-currency-input/index.js", + "ui/components/app/user-preferenced-currency-input/user-preferenced-currency-input.component.js", + "ui/components/app/user-preferenced-currency-input/user-preferenced-currency-input.component.test.js", + "ui/components/app/user-preferenced-currency-input/user-preferenced-currency-input.container.js", + "ui/components/app/user-preferenced-currency-input/user-preferenced-currency-input.container.test.js", + "ui/components/app/user-preferenced-token-input/index.js", + "ui/components/app/user-preferenced-token-input/user-preferenced-token-input.component.js", + "ui/components/app/user-preferenced-token-input/user-preferenced-token-input.component.test.js", + "ui/components/app/user-preferenced-token-input/user-preferenced-token-input.container.js", + "ui/components/app/user-preferenced-token-input/user-preferenced-token-input.container.test.js", + "ui/components/app/wallet-overview/eth-overview.js", + "ui/components/app/wallet-overview/index.js", + "ui/components/app/wallet-overview/token-overview.js", + "ui/components/app/wallet-overview/token-overview.test.js", + "ui/components/app/wallet-overview/wallet-overview.js", + "ui/components/app/whats-new-popup/index.js", + "ui/components/app/whats-new-popup/whats-new-popup.js", + "ui/components/component-library/base-avatar/base-avatar.js", + "ui/components/component-library/base-avatar/base-avatar.stories.js", + "ui/components/component-library/base-avatar/base-avatar.test.js", + "ui/components/ui/account-list/account-list.js", + "ui/components/ui/account-list/account-list.stories.js", + "ui/components/ui/account-list/index.js", + "ui/components/ui/account-mismatch-warning/acccount-mismatch-warning.component.test.js", + "ui/components/ui/account-mismatch-warning/account-mismatch-warning.component.js", + "ui/components/ui/actionable-message/actionable-message.js", + "ui/components/ui/actionable-message/actionable-message.stories.js", + "ui/components/ui/actionable-message/actionable-message.test.js", + "ui/components/ui/actionable-message/index.js", + "ui/components/ui/alert/alert.stories.js", + "ui/components/ui/alert/index.js", + "ui/components/ui/alert/index.test.js", + "ui/components/ui/box/box.js", + "ui/components/ui/box/box.stories.js", + "ui/components/ui/box/box.test.js", + "ui/components/ui/box/index.js", + "ui/components/ui/breadcrumbs/breadcrumbs.component.js", + "ui/components/ui/breadcrumbs/breadcrumbs.component.test.js", + "ui/components/ui/breadcrumbs/breadcrumbs.stories.js", + "ui/components/ui/button-group/button-group-component.test.js", + "ui/components/ui/button-group/button-group.component.js", + "ui/components/ui/button-group/button-group.stories.js", + "ui/components/ui/button-group/index.js", + "ui/components/ui/button/button.component.js", + "ui/components/ui/button/button.stories.js", + "ui/components/ui/button/button.stories.test.js", + "ui/components/ui/button/index.js", + "ui/components/ui/callout/callout.js", + "ui/components/ui/callout/callout.stories.js", + "ui/components/ui/callout/index.js", + "ui/components/ui/card/card.js", + "ui/components/ui/card/card.stories.js", + "ui/components/ui/card/card.test.js", + "ui/components/ui/card/index.js", + "ui/components/ui/check-box/check-box.component.js", + "ui/components/ui/check-box/check-box.stories.js", + "ui/components/ui/check-box/index.js", + "ui/components/ui/chip/chip-with-input.js", + "ui/components/ui/chip/chip.js", + "ui/components/ui/chip/chip.stories.js", + "ui/components/ui/chip/index.js", + "ui/components/ui/color-indicator/color-indicator.js", + "ui/components/ui/color-indicator/color-indicator.stories.js", + "ui/components/ui/color-indicator/index.js", + "ui/components/ui/confusable/confusable.component.js", + "ui/components/ui/confusable/confusable.component.test.js", + "ui/components/ui/confusable/confusable.stories.js", + "ui/components/ui/confusable/index.js", + "ui/components/ui/currency-display/currency-display.component.js", + "ui/components/ui/currency-display/currency-display.component.test.js", + "ui/components/ui/currency-display/index.js", + "ui/components/ui/definition-list/definition-list.js", + "ui/components/ui/definition-list/definition-list.stories.js", + "ui/components/ui/definition-list/index.js", + "ui/components/ui/dialog/dialog.stories.js", + "ui/components/ui/dialog/index.js", + "ui/components/ui/disclosure/disclosure.js", + "ui/components/ui/disclosure/disclosure.stories.js", + "ui/components/ui/disclosure/index.js", + "ui/components/ui/dropdown/dropdown.js", + "ui/components/ui/dropdown/dropdown.stories.js", + "ui/components/ui/dropdown/index.js", + "ui/components/ui/editable-label/editable-label.js", + "ui/components/ui/editable-label/editable-label.stories.js", + "ui/components/ui/editable-label/index.js", + "ui/components/ui/error-message/error-message.component.js", + "ui/components/ui/error-message/error-message.component.test.js", + "ui/components/ui/error-message/error-message.stories.js", + "ui/components/ui/error-message/index.js", + "ui/components/ui/export-text-container/export-text-container.component.js", + "ui/components/ui/export-text-container/export-text.stories.js", + "ui/components/ui/export-text-container/index.js", + "ui/components/ui/form-field/form-field.js", + "ui/components/ui/form-field/form-field.stories.js", + "ui/components/ui/form-field/index.js", + "ui/components/ui/hex-to-decimal/hex-to-decimal.component.js", + "ui/components/ui/hex-to-decimal/hex-to-decimal.component.test.js", + "ui/components/ui/hex-to-decimal/hex-to-decimal.stories.js", + "ui/components/ui/hex-to-decimal/index.js", + "ui/components/ui/icon-border/icon-border.js", + "ui/components/ui/icon-border/index.js", + "ui/components/ui/icon-button/icon-button.js", + "ui/components/ui/icon-button/index.js", + "ui/components/ui/icon-with-fallback/icon-with-fallback.component.js", + "ui/components/ui/icon-with-fallback/icon-with-fallback.stories.js", + "ui/components/ui/icon-with-fallback/icon-with-fallback.test.js", + "ui/components/ui/icon-with-fallback/index.js", + "ui/components/ui/icon/approve-icon.component.js", + "ui/components/ui/icon/copy-icon.component.js", + "ui/components/ui/icon/icon-caret-down.js", + "ui/components/ui/icon/icon-caret-left.js", + "ui/components/ui/icon/icon-caret-right.js", + "ui/components/ui/icon/icon-caret-up.js", + "ui/components/ui/icon/icon-check.js", + "ui/components/ui/icon/icon-cog.js", + "ui/components/ui/icon/icon-connect.js", + "ui/components/ui/icon/icon-eye-slash.js", + "ui/components/ui/icon/icon-eye.js", + "ui/components/ui/icon/icon-import.js", + "ui/components/ui/icon/icon-plus.js", + "ui/components/ui/icon/icon-speech-bubbles.js", + "ui/components/ui/icon/icon-token-search.js", + "ui/components/ui/icon/icon.stories.js", + "ui/components/ui/icon/info-icon-inverted.component.js", + "ui/components/ui/icon/info-icon.component.js", + "ui/components/ui/icon/interaction-icon.component.js", + "ui/components/ui/icon/overview-buy-icon.component.js", + "ui/components/ui/icon/overview-send-icon.component.js", + "ui/components/ui/icon/preloader/index.js", + "ui/components/ui/icon/preloader/preloader-icon.component.js", + "ui/components/ui/icon/receive-icon.component.js", + "ui/components/ui/icon/search-icon.js", + "ui/components/ui/icon/send-icon.component.js", + "ui/components/ui/icon/sign-icon.component.js", + "ui/components/ui/icon/sun-check-icon.component.js", + "ui/components/ui/icon/swap-icon-for-list.component.js", + "ui/components/ui/icon/swap-icon.component.js", + "ui/components/ui/identicon/blockieIdenticon/blockieIdenticon.component.js", + "ui/components/ui/identicon/blockieIdenticon/index.js", + "ui/components/ui/identicon/identicon.component.js", + "ui/components/ui/identicon/identicon.component.test.js", + "ui/components/ui/identicon/identicon.container.js", + "ui/components/ui/identicon/identicon.stories.js", + "ui/components/ui/identicon/index.js", + "ui/components/ui/info-tooltip/index.js", + "ui/components/ui/info-tooltip/info-tooltip-icon.js", + "ui/components/ui/info-tooltip/info-tooltip.js", + "ui/components/ui/info-tooltip/info-tooltip.stories.js", + "ui/components/ui/jazzicon/index.js", + "ui/components/ui/jazzicon/jazzicon.component.js", + "ui/components/ui/list-item/index.js", + "ui/components/ui/list-item/list-item.component.js", + "ui/components/ui/list-item/list-item.component.test.js", + "ui/components/ui/list-item/list-item.stories.js", + "ui/components/ui/loading-heartbeat/index.js", + "ui/components/ui/loading-indicator/index.js", + "ui/components/ui/loading-indicator/loading-indicator.js", + "ui/components/ui/loading-screen/index.js", + "ui/components/ui/loading-screen/loading-screen.component.js", + "ui/components/ui/lock-icon/index.js", + "ui/components/ui/lock-icon/lock-icon.component.js", + "ui/components/ui/logo/logo-coinbasepay.js", + "ui/components/ui/logo/logo-deposit-eth.js", + "ui/components/ui/logo/logo-lattice.js", + "ui/components/ui/logo/logo-ledger.js", + "ui/components/ui/logo/logo-moonpay.js", + "ui/components/ui/logo/logo-moonpay.test.js", + "ui/components/ui/logo/logo-qr-based.js", + "ui/components/ui/logo/logo-transak.js", + "ui/components/ui/logo/logo-trezor.js", + "ui/components/ui/logo/logo-wyre.js", + "ui/components/ui/logo/logo.stories.js", + "ui/components/ui/mascot/index.js", + "ui/components/ui/mascot/mascot.component.js", + "ui/components/ui/mascot/mascot.stories.js", + "ui/components/ui/menu/index.js", + "ui/components/ui/menu/menu-item.js", + "ui/components/ui/menu/menu.js", + "ui/components/ui/menu/menu.stories.js", + "ui/components/ui/metafox-logo/horizontal-logo.js", + "ui/components/ui/metafox-logo/index.js", + "ui/components/ui/metafox-logo/metafox-logo.component.js", + "ui/components/ui/metafox-logo/metafox-logo.component.test.js", + "ui/components/ui/nickname-popover/index.js", + "ui/components/ui/nickname-popover/nickname-popover.component.js", + "ui/components/ui/nickname-popover/nickname-popover.stories.js", + "ui/components/ui/numeric-input/index.js", + "ui/components/ui/numeric-input/numeric-input.component.js", + "ui/components/ui/numeric-input/numeric-input.stories.js", + "ui/components/ui/page-container/index.js", + "ui/components/ui/page-container/page-container-content.component.js", + "ui/components/ui/page-container/page-container-footer/index.js", + "ui/components/ui/page-container/page-container-footer/page-container-footer.component.js", + "ui/components/ui/page-container/page-container-footer/page-container-footer.component.test.js", + "ui/components/ui/page-container/page-container-header/index.js", + "ui/components/ui/page-container/page-container-header/page-container-header.component.js", + "ui/components/ui/page-container/page-container-header/page-container-header.component.test.js", + "ui/components/ui/page-container/page-container.component.js", + "ui/components/ui/page-container/page-container.stories.js", + "ui/components/ui/popover/index.js", + "ui/components/ui/popover/popover.component.js", + "ui/components/ui/popover/popover.stories.js", + "ui/components/ui/pulse-loader/index.js", + "ui/components/ui/pulse-loader/pulse-loader.js", + "ui/components/ui/pulse-loader/pulse-loader.stories.js", + "ui/components/ui/qr-code/index.js", + "ui/components/ui/qr-code/qr-code.js", + "ui/components/ui/qr-code/qr-code.stories.js", + "ui/components/ui/radio-group/index.js", + "ui/components/ui/radio-group/radio-group.component.js", + "ui/components/ui/radio-group/radio-group.stories.js", + "ui/components/ui/sender-to-recipient/index.js", + "ui/components/ui/sender-to-recipient/sender-to-recipient.component.js", + "ui/components/ui/sender-to-recipient/sender-to-recipient.constants.js", + "ui/components/ui/sender-to-recipient/sender-to-recipient.stories.js", + "ui/components/ui/show-hide-toggle/index.js", + "ui/components/ui/show-hide-toggle/show-hide-toggle.js", + "ui/components/ui/show-hide-toggle/show-hide-toggle.stories.js", + "ui/components/ui/show-hide-toggle/show-hide-toggle.test.js", + "ui/components/ui/site-icon/index.js", + "ui/components/ui/site-icon/site-icon.js", + "ui/components/ui/site-icon/site-icon.stories.js", + "ui/components/ui/site-icon/site-icon.test.js", + "ui/components/ui/site-origin/index.js", + "ui/components/ui/site-origin/site-origin.js", + "ui/components/ui/site-origin/site-origin.stories.js", + "ui/components/ui/slider/index.js", + "ui/components/ui/slider/slider.component.js", + "ui/components/ui/slider/slider.component.test.js", + "ui/components/ui/slider/slider.stories.js", + "ui/components/ui/snackbar/index.js", + "ui/components/ui/snackbar/snackbar.component.js", + "ui/components/ui/spinner/index.js", + "ui/components/ui/spinner/spinner.component.js", + "ui/components/ui/spinner/spinner.stories.js", + "ui/components/ui/tabs/index.js", + "ui/components/ui/tabs/tab/index.js", + "ui/components/ui/tabs/tab/tab.component.js", + "ui/components/ui/tabs/tabs.component.js", + "ui/components/ui/tabs/tabs.stories.js", + "ui/components/ui/text-field/index.js", + "ui/components/ui/text-field/text-field.component.js", + "ui/components/ui/text-field/text-field.stories.js", + "ui/components/ui/textarea/index.js", + "ui/components/ui/textarea/textarea.js", + "ui/components/ui/textarea/textarea.stories.js", + "ui/components/ui/textarea/textarea.test.js", + "ui/components/ui/toggle-button/index.js", + "ui/components/ui/toggle-button/toggle-button.component.js", + "ui/components/ui/toggle-button/toggle-button.stories.js", + "ui/components/ui/token-balance/index.js", + "ui/components/ui/token-balance/token-balance.js", + "ui/components/ui/token-input/index.js", + "ui/components/ui/token-input/token-input.component.js", + "ui/components/ui/token-input/token-input.component.test.js", + "ui/components/ui/token-input/token-input.container.js", + "ui/components/ui/tooltip/index.js", + "ui/components/ui/tooltip/tooltip.js", + "ui/components/ui/tooltip/tooltip.stories.js", + "ui/components/ui/truncated-definition-list/index.js", + "ui/components/ui/truncated-definition-list/truncated-definition-list.js", + "ui/components/ui/truncated-definition-list/truncated-definition-list.stories.js", + "ui/components/ui/typography/index.js", + "ui/components/ui/typography/typography.js", + "ui/components/ui/typography/typography.stories.js", + "ui/components/ui/typography/typography.test.js", + "ui/components/ui/unit-input/index.js", + "ui/components/ui/unit-input/unit-input.component.js", + "ui/components/ui/unit-input/unit-input.component.test.js", + "ui/components/ui/update-nickname-popover/index.js", + "ui/components/ui/update-nickname-popover/update-nickname-popover.js", + "ui/components/ui/update-nickname-popover/update-nickname-popover.stories.js", + "ui/components/ui/url-icon/index.js", + "ui/components/ui/url-icon/url-icon.js", + "ui/components/ui/url-icon/url-icon.stories.js", + "ui/contexts/gasFee.js", + "ui/contexts/i18n.js", + "ui/contexts/metametrics.js", + "ui/contexts/transaction-modal.js", + "ui/ducks/alerts/enums.js", + "ui/ducks/alerts/index.js", + "ui/ducks/alerts/invalid-custom-network.js", + "ui/ducks/alerts/unconnected-account.js", + "ui/ducks/app/app.js", + "ui/ducks/app/app.test.js", + "ui/ducks/confirm-transaction/confirm-transaction.duck.js", + "ui/ducks/confirm-transaction/confirm-transaction.duck.test.js", + "ui/ducks/ens.js", + "ui/ducks/gas/gas-action-constants.js", + "ui/ducks/gas/gas-duck.test.js", + "ui/ducks/gas/gas.duck.js", + "ui/ducks/history/history.js", + "ui/ducks/index.js", + "ui/ducks/locale/locale.js", + "ui/ducks/metamask/metamask.js", + "ui/ducks/metamask/metamask.test.js", + "ui/ducks/send/helpers.js", + "ui/ducks/send/helpers.test.js", + "ui/ducks/send/index.js", + "ui/ducks/send/send.js", + "ui/ducks/send/send.test.js", + "ui/ducks/swaps/swaps.js", + "ui/ducks/swaps/swaps.test.js", + "ui/helpers/constants/common.js", + "ui/helpers/constants/connected-sites.js", + "ui/helpers/constants/critical-error.js", + "ui/helpers/constants/design-system.js", + "ui/helpers/constants/error-keys.js", + "ui/helpers/constants/gas.js", + "ui/helpers/constants/notifications.js", + "ui/helpers/constants/onboarding.js", + "ui/helpers/constants/routes.js", + "ui/helpers/constants/settings.js", + "ui/helpers/constants/transactions.js", + "ui/helpers/constants/zendesk-url.js", + "ui/helpers/higher-order-components/authenticated/authenticated.component.js", + "ui/helpers/higher-order-components/authenticated/authenticated.container.js", + "ui/helpers/higher-order-components/authenticated/index.js", + "ui/helpers/higher-order-components/feature-toggled-route.js", + "ui/helpers/higher-order-components/initialized/index.js", + "ui/helpers/higher-order-components/initialized/initialized.component.js", + "ui/helpers/higher-order-components/initialized/initialized.container.js", + "ui/helpers/higher-order-components/with-modal-props/index.js", + "ui/helpers/higher-order-components/with-modal-props/with-modal-props.js", + "ui/helpers/higher-order-components/with-modal-props/with-modal-props.test.js", + "ui/helpers/utils/build-types.js", + "ui/helpers/utils/common.util.js", + "ui/helpers/utils/common.util.test.js", + "ui/helpers/utils/confirm-tx.util.js", + "ui/helpers/utils/confirm-tx.util.test.js", + "ui/helpers/utils/conversions.util.js", + "ui/helpers/utils/conversions.util.test.js", + "ui/helpers/utils/error-utils.js", + "ui/helpers/utils/error-utils.test.js", + "ui/helpers/utils/fetch-with-cache.js", + "ui/helpers/utils/fetch-with-cache.test.js", + "ui/helpers/utils/formatters.js", + "ui/helpers/utils/gas.js", + "ui/helpers/utils/gas.test.js", + "ui/helpers/utils/hardware.js", + "ui/helpers/utils/i18n-helper.js", + "ui/helpers/utils/i18n-helper.test.js", + "ui/helpers/utils/icon-factory.js", + "ui/helpers/utils/is-mobile-view.js", + "ui/helpers/utils/metric.test.js", + "ui/helpers/utils/metrics.js", + "ui/helpers/utils/optimism/buildUnserializedTransaction.js", + "ui/helpers/utils/optimism/buildUnserializedTransaction.test.js", + "ui/helpers/utils/optimism/fetchEstimatedL1Fee.js", + "ui/helpers/utils/permission.js", + "ui/helpers/utils/settings-search.js", + "ui/helpers/utils/settings-search.test.js", + "ui/helpers/utils/storage-helpers.js", + "ui/helpers/utils/switch-direction.js", + "ui/helpers/utils/token-util.js", + "ui/helpers/utils/transactions.util.js", + "ui/helpers/utils/transactions.util.test.js", + "ui/helpers/utils/tx-helper.js", + "ui/helpers/utils/tx-helper.test.js", + "ui/helpers/utils/util.js", + "ui/helpers/utils/util.test.js", + "ui/helpers/utils/webcam-utils.js", + "ui/hooks/gasFeeInput/test-utils.js", + "ui/hooks/gasFeeInput/useGasEstimates.js", + "ui/hooks/gasFeeInput/useGasEstimates.test.js", + "ui/hooks/gasFeeInput/useGasFeeErrors.js", + "ui/hooks/gasFeeInput/useGasFeeErrors.test.js", + "ui/hooks/gasFeeInput/useGasFeeInputs.js", + "ui/hooks/gasFeeInput/useGasFeeInputs.test.js", + "ui/hooks/gasFeeInput/useGasPriceInput.js", + "ui/hooks/gasFeeInput/useGasPriceInput.test.js", + "ui/hooks/gasFeeInput/useMaxFeePerGasInput.js", + "ui/hooks/gasFeeInput/useMaxFeePerGasInput.test.js", + "ui/hooks/gasFeeInput/useMaxPriorityFeePerGasInput.js", + "ui/hooks/gasFeeInput/useMaxPriorityFeePerGasInput.test.js", + "ui/hooks/gasFeeInput/useTransactionFunction.test.js", + "ui/hooks/gasFeeInput/useTransactionFunctions.js", + "ui/hooks/gasFeeInput/utils.js", + "ui/hooks/useAddressDetails.js", + "ui/hooks/useAddressDetails.test.js", + "ui/hooks/useApproveTransaction.js", + "ui/hooks/useAssetDetails.js", + "ui/hooks/useAssetDetails.test.js", + "ui/hooks/useCollectiblesCollections.js", + "ui/hooks/useCopyToClipboard.js", + "ui/hooks/useCurrencyDisplay.js", + "ui/hooks/useCurrencyDisplay.test.js", + "ui/hooks/useCurrentAsset.js", + "ui/hooks/useEqualityCheck.js", + "ui/hooks/useEthFiatAmount.js", + "ui/hooks/useEventFragment.js", + "ui/hooks/useEventFragment.test.js", + "ui/hooks/useGasFeeErrors.js", + "ui/hooks/useGasFeeErrors.test.js", + "ui/hooks/useGasFeeEstimates.js", + "ui/hooks/useGasFeeEstimates.test.js", + "ui/hooks/useI18nContext.js", + "ui/hooks/useIncrementedGasFees.js", + "ui/hooks/useOriginMetadata.js", + "ui/hooks/usePrevious.js", + "ui/hooks/useSafeGasEstimatePolling.js", + "ui/hooks/useSegmentContext.js", + "ui/hooks/useShouldAnimateGasEstimations.js", + "ui/hooks/useShouldShowSpeedUp.js", + "ui/hooks/useSwappedTokenValue.js", + "ui/hooks/useTimeout.js", + "ui/hooks/useTokenData.js", + "ui/hooks/useTokenData.test.js", + "ui/hooks/useTokenDisplayValue.js", + "ui/hooks/useTokenDisplayValue.test.js", + "ui/hooks/useTokenFiatAmount.js", + "ui/hooks/useTokenTracker.js", + "ui/hooks/useTokensToSearch.js", + "ui/hooks/useTransactionDisplayData.js", + "ui/hooks/useTransactionDisplayData.test.js", + "ui/hooks/useTransactionEventFragment.js", + "ui/hooks/useUserPreferencedCurrency.js", + "ui/hooks/useUserPreferencedCurrency.test.js", + "ui/index.js", + "ui/index.test.js", + "ui/pages/add-collectible/add-collectible.js", + "ui/pages/add-collectible/add-collectible.test.js", + "ui/pages/add-collectible/index.js", + "ui/pages/asset/asset.js", + "ui/pages/asset/components/asset-breadcrumb.js", + "ui/pages/asset/components/asset-navigation.js", + "ui/pages/asset/components/asset-options.js", + "ui/pages/asset/components/native-asset.js", + "ui/pages/asset/components/token-asset.js", + "ui/pages/asset/index.js", + "ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.js", + "ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.stories.js", + "ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.test.js", + "ui/pages/confirm-add-suggested-token/index.js", + "ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js", + "ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.test.js", + "ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.stories.js", + "ui/pages/confirm-approve/confirm-approve-content/index.js", + "ui/pages/confirm-approve/confirm-approve.js", + "ui/pages/confirm-approve/confirm-approve.stories.js", + "ui/pages/confirm-approve/confirm-approve.util.js", + "ui/pages/confirm-approve/index.js", + "ui/pages/confirm-decrypt-message/confirm-decrypt-message.component.js", + "ui/pages/confirm-decrypt-message/confirm-decrypt-message.container.js", + "ui/pages/confirm-decrypt-message/index.js", + "ui/pages/confirm-deploy-contract/confirm-deploy-contract.component.js", + "ui/pages/confirm-deploy-contract/confirm-deploy-contract.container.js", + "ui/pages/confirm-deploy-contract/confirm-deploy-contract.stories.js", + "ui/pages/confirm-deploy-contract/index.js", + "ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js", + "ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.container.js", + "ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.stories.js", + "ui/pages/confirm-encryption-public-key/index.js", + "ui/pages/confirm-import-token/confirm-import-token.js", + "ui/pages/confirm-import-token/confirm-import-token.stories.js", + "ui/pages/confirm-import-token/confirm-import-token.test.js", + "ui/pages/confirm-import-token/index.js", + "ui/pages/confirm-send-ether/confirm-send-ether.component.js", + "ui/pages/confirm-send-ether/confirm-send-ether.container.js", + "ui/pages/confirm-send-ether/confirm-send-ether.stories.js", + "ui/pages/confirm-send-ether/index.js", + "ui/pages/confirm-send-token/confirm-send-token.component.js", + "ui/pages/confirm-send-token/confirm-send-token.js", + "ui/pages/confirm-send-token/confirm-send-token.stories.js", + "ui/pages/confirm-send-token/index.js", + "ui/pages/confirm-token-transaction-base/confirm-token-transaction-base.js", + "ui/pages/confirm-token-transaction-base/confirm-token-transaction-base.stories.js", + "ui/pages/confirm-token-transaction-base/index.js", + "ui/pages/confirm-transaction-base/confirm-transaction-base.component.js", + "ui/pages/confirm-transaction-base/confirm-transaction-base.container.js", + "ui/pages/confirm-transaction-base/confirm-transaction-base.stories.js", + "ui/pages/confirm-transaction-base/index.js", + "ui/pages/confirm-transaction-base/transaction-alerts/index.js", + "ui/pages/confirm-transaction-base/transaction-alerts/transaction-alerts.js", + "ui/pages/confirm-transaction-base/transaction-alerts/transaction-alerts.test.js", + "ui/pages/confirm-transaction-switch/confirm-transaction-switch.component.js", + "ui/pages/confirm-transaction-switch/confirm-transaction-switch.container.js", + "ui/pages/confirm-transaction-switch/index.js", + "ui/pages/confirm-transaction/conf-tx.js", + "ui/pages/confirm-transaction/confirm-token-transaction-switch.js", + "ui/pages/confirm-transaction/confirm-transaction.component.js", + "ui/pages/confirm-transaction/confirm-transaction.container.js", + "ui/pages/confirm-transaction/index.js", + "ui/pages/confirmation/components/confirmation-footer/confirmation-footer.js", + "ui/pages/confirmation/components/confirmation-footer/index.js", + "ui/pages/confirmation/components/confirmation-network-switch/confirmation-network-switch.js", + "ui/pages/confirmation/components/confirmation-network-switch/confirmation-network-switch.stories.js", + "ui/pages/confirmation/components/confirmation-network-switch/index.js", + "ui/pages/confirmation/confirmation.js", + "ui/pages/confirmation/index.js", + "ui/pages/confirmation/templates/add-ethereum-chain.js", + "ui/pages/confirmation/templates/flask/snap-confirm/snap-confirm.js", + "ui/pages/confirmation/templates/index.js", + "ui/pages/confirmation/templates/switch-ethereum-chain.js", + "ui/pages/connected-accounts/connected-accounts.component.js", + "ui/pages/connected-accounts/connected-accounts.container.js", + "ui/pages/connected-accounts/connected-accounts.stories.js", + "ui/pages/connected-accounts/index.js", + "ui/pages/connected-sites/connected-sites.component.js", + "ui/pages/connected-sites/connected-sites.container.js", + "ui/pages/connected-sites/connected-sites.stories.js", + "ui/pages/connected-sites/index.js", + "ui/pages/create-account/connect-hardware/account-list.js", + "ui/pages/create-account/connect-hardware/account-list.stories.js", + "ui/pages/create-account/connect-hardware/index.js", + "ui/pages/create-account/connect-hardware/select-hardware.js", + "ui/pages/create-account/connect-hardware/select-hardware.stories.js", + "ui/pages/create-account/create-account.component.js", + "ui/pages/create-account/import-account/index.js", + "ui/pages/create-account/import-account/json.js", + "ui/pages/create-account/import-account/private-key.js", + "ui/pages/create-account/index.js", + "ui/pages/create-account/new-account.component.js", + "ui/pages/create-account/new-account.container.js", + "ui/pages/create-account/new-account.stories.js", + "ui/pages/error/error.component.js", + "ui/pages/error/index.js", + "ui/pages/first-time-flow/create-password/create-password.component.js", + "ui/pages/first-time-flow/create-password/create-password.container.js", + "ui/pages/first-time-flow/create-password/create-password.stories.js", + "ui/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js", + "ui/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.container.js", + "ui/pages/first-time-flow/create-password/import-with-seed-phrase/index.js", + "ui/pages/first-time-flow/create-password/index.js", + "ui/pages/first-time-flow/create-password/new-account/index.js", + "ui/pages/first-time-flow/create-password/new-account/new-account.component.js", + "ui/pages/first-time-flow/end-of-flow/end-of-flow.component.js", + "ui/pages/first-time-flow/end-of-flow/end-of-flow.container.js", + "ui/pages/first-time-flow/end-of-flow/end-of-flow.stories.js", + "ui/pages/first-time-flow/end-of-flow/end-of-flow.test.js", + "ui/pages/first-time-flow/end-of-flow/index.js", + "ui/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.component.js", + "ui/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.container.js", + "ui/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.test.js", + "ui/pages/first-time-flow/first-time-flow-switch/index.js", + "ui/pages/first-time-flow/first-time-flow.component.js", + "ui/pages/first-time-flow/first-time-flow.container.js", + "ui/pages/first-time-flow/index.js", + "ui/pages/first-time-flow/metametrics-opt-in/index.js", + "ui/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.component.js", + "ui/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.container.js", + "ui/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.stories.js", + "ui/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.test.js", + "ui/pages/first-time-flow/onboarding-initiator-util.js", + "ui/pages/first-time-flow/seed-phrase/confirm-seed-phrase-component.test.js", + "ui/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.component.js", + "ui/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.container.js", + "ui/pages/first-time-flow/seed-phrase/confirm-seed-phrase/draggable-seed.component.js", + "ui/pages/first-time-flow/seed-phrase/confirm-seed-phrase/index.js", + "ui/pages/first-time-flow/seed-phrase/index.js", + "ui/pages/first-time-flow/seed-phrase/reveal-seed-phrase/index.js", + "ui/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.component.js", + "ui/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.container.js", + "ui/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.stories.js", + "ui/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.test.js", + "ui/pages/first-time-flow/seed-phrase/seed-phrase-intro/index.js", + "ui/pages/first-time-flow/seed-phrase/seed-phrase-intro/seed-phrase-intro.component.js", + "ui/pages/first-time-flow/seed-phrase/seed-phrase.component.js", + "ui/pages/first-time-flow/select-action/index.js", + "ui/pages/first-time-flow/select-action/select-action.component.js", + "ui/pages/first-time-flow/select-action/select-action.container.js", + "ui/pages/first-time-flow/select-action/select-action.stories.js", + "ui/pages/first-time-flow/select-action/select-action.test.js", + "ui/pages/first-time-flow/welcome/beta-welcome-footer.component.js", + "ui/pages/first-time-flow/welcome/index.js", + "ui/pages/first-time-flow/welcome/welcome-footer.component.js", + "ui/pages/first-time-flow/welcome/welcome.component.js", + "ui/pages/first-time-flow/welcome/welcome.container.js", + "ui/pages/first-time-flow/welcome/welcome.stories.js", + "ui/pages/first-time-flow/welcome/welcome.test.js", + "ui/pages/home/beta/beta-home-footer.component.js", + "ui/pages/home/flask/flask-home-footer.component.js", + "ui/pages/home/home.component.js", + "ui/pages/home/home.container.js", + "ui/pages/home/index.js", + "ui/pages/import-token/import-token.component.js", + "ui/pages/import-token/import-token.container.js", + "ui/pages/import-token/import-token.stories.js", + "ui/pages/import-token/import-token.test.js", + "ui/pages/import-token/index.js", + "ui/pages/import-token/token-list/index.js", + "ui/pages/import-token/token-list/token-list-placeholder/index.js", + "ui/pages/import-token/token-list/token-list-placeholder/token-list-placeholder.component.js", + "ui/pages/import-token/token-list/token-list-placeholder/token-list-placeholder.stories.js", + "ui/pages/import-token/token-list/token-list.component.js", + "ui/pages/import-token/token-list/token-list.container.js", + "ui/pages/import-token/token-search/index.js", + "ui/pages/import-token/token-search/token-search.component.js", + "ui/pages/import-token/token-search/token-search.stories.js", + "ui/pages/index.js", + "ui/pages/keychains/restore-vault.js", + "ui/pages/keychains/restore-vault.test.js", + "ui/pages/keychains/reveal-seed.js", + "ui/pages/keychains/reveal-seed.stories.js", + "ui/pages/keychains/reveal-seed.test.js", + "ui/pages/lock/index.js", + "ui/pages/lock/lock.component.js", + "ui/pages/lock/lock.container.js", + "ui/pages/lock/lock.test.js", + "ui/pages/mobile-sync/index.js", + "ui/pages/mobile-sync/mobile-sync.component.js", + "ui/pages/mobile-sync/mobile-sync.container.js", + "ui/pages/mobile-sync/mobile-sync.stories.js", + "ui/pages/notifications/index.js", + "ui/pages/notifications/notification.test.js", + "ui/pages/notifications/notifications.js", + "ui/pages/onboarding-flow/create-password/create-password.js", + "ui/pages/onboarding-flow/creation-successful/creation-successful.js", + "ui/pages/onboarding-flow/creation-successful/creation-successful.stories.js", + "ui/pages/onboarding-flow/creation-successful/creation-successful.test.js", + "ui/pages/onboarding-flow/import-srp/import-srp.js", + "ui/pages/onboarding-flow/metametrics/metametrics.js", + "ui/pages/onboarding-flow/metametrics/metametrics.stories.js", + "ui/pages/onboarding-flow/onboarding-app-header/onboarding-app-header.js", + "ui/pages/onboarding-flow/onboarding-flow-switch/onboarding-flow-switch.js", + "ui/pages/onboarding-flow/onboarding-flow.js", + "ui/pages/onboarding-flow/pin-extension/pin-billboard.js", + "ui/pages/onboarding-flow/pin-extension/pin-extension.js", + "ui/pages/onboarding-flow/pin-extension/pin-extension.stories.js", + "ui/pages/onboarding-flow/privacy-settings/privacy-settings.js", + "ui/pages/onboarding-flow/privacy-settings/privacy-settings.stories.js", + "ui/pages/onboarding-flow/privacy-settings/privacy-settings.test.js", + "ui/pages/onboarding-flow/privacy-settings/setting.js", + "ui/pages/onboarding-flow/recovery-phrase/confirm-recovery-phrase.js", + "ui/pages/onboarding-flow/recovery-phrase/recovery-phrase-chips.js", + "ui/pages/onboarding-flow/recovery-phrase/review-recovery-phrase.js", + "ui/pages/onboarding-flow/secure-your-wallet/secure-your-wallet.js", + "ui/pages/onboarding-flow/secure-your-wallet/secure-your-wallet.stories.js", + "ui/pages/onboarding-flow/secure-your-wallet/secure-your-wallet.test.js", + "ui/pages/onboarding-flow/secure-your-wallet/skip-srp-backup-popover.js", + "ui/pages/onboarding-flow/welcome/welcome.js", + "ui/pages/onboarding-flow/welcome/welcome.stories.js", + "ui/pages/permissions-connect/choose-account/choose-account.js", + "ui/pages/permissions-connect/choose-account/index.js", + "ui/pages/permissions-connect/flask/snap-install/index.js", + "ui/pages/permissions-connect/flask/snap-install/snap-install.js", + "ui/pages/permissions-connect/flask/snap-update/index.js", + "ui/pages/permissions-connect/flask/snap-update/snap-update.js", + "ui/pages/permissions-connect/index.js", + "ui/pages/permissions-connect/permissions-connect.component.js", + "ui/pages/permissions-connect/permissions-connect.container.js", + "ui/pages/permissions-connect/permissions-connect.stories.js", + "ui/pages/permissions-connect/redirect/index.js", + "ui/pages/permissions-connect/redirect/permissions-redirect.component.js", + "ui/pages/permissions-connect/redirect/permissions-redirect.stories.js", + "ui/pages/routes/index.js", + "ui/pages/routes/routes.component.js", + "ui/pages/routes/routes.container.js", + "ui/pages/send/index.js", + "ui/pages/send/send-content/add-recipient/add-recipient.component.js", + "ui/pages/send/send-content/add-recipient/add-recipient.component.test.js", + "ui/pages/send/send-content/add-recipient/add-recipient.container.js", + "ui/pages/send/send-content/add-recipient/add-recipient.container.test.js", + "ui/pages/send/send-content/add-recipient/add-recipient.stories.js", + "ui/pages/send/send-content/add-recipient/ens-input.component.js", + "ui/pages/send/send-content/add-recipient/ens-input.container.js", + "ui/pages/send/send-content/add-recipient/ens-input.js", + "ui/pages/send/send-content/add-recipient/index.js", + "ui/pages/send/send-content/index.js", + "ui/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.js", + "ui/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.test.js", + "ui/pages/send/send-content/send-amount-row/amount-max-button/index.js", + "ui/pages/send/send-content/send-amount-row/index.js", + "ui/pages/send/send-content/send-amount-row/send-amount-row.component.js", + "ui/pages/send/send-content/send-amount-row/send-amount-row.component.test.js", + "ui/pages/send/send-content/send-amount-row/send-amount-row.container.js", + "ui/pages/send/send-content/send-amount-row/send-amount-row.container.test.js", + "ui/pages/send/send-content/send-asset-row/index.js", + "ui/pages/send/send-content/send-asset-row/send-asset-row.component.js", + "ui/pages/send/send-content/send-asset-row/send-asset-row.container.js", + "ui/pages/send/send-content/send-asset-row/send-asset-row.stories.js", + "ui/pages/send/send-content/send-content.component.js", + "ui/pages/send/send-content/send-content.component.test.js", + "ui/pages/send/send-content/send-content.container.js", + "ui/pages/send/send-content/send-content.stories.js", + "ui/pages/send/send-content/send-gas-row/index.js", + "ui/pages/send/send-content/send-gas-row/send-gas-row.component.js", + "ui/pages/send/send-content/send-gas-row/send-gas-row.component.test.js", + "ui/pages/send/send-content/send-gas-row/send-gas-row.container.js", + "ui/pages/send/send-content/send-gas-row/send-gas-row.container.test.js", + "ui/pages/send/send-content/send-gas-row/send-gas-row.stories.js", + "ui/pages/send/send-content/send-hex-data-row/index.js", + "ui/pages/send/send-content/send-hex-data-row/send-hex-data-row.component.js", + "ui/pages/send/send-content/send-hex-data-row/send-hex-data-row.container.js", + "ui/pages/send/send-content/send-hex-data-row/send-hex-data-row.stories.js", + "ui/pages/send/send-content/send-row-wrapper/index.js", + "ui/pages/send/send-content/send-row-wrapper/send-row-error-message/index.js", + "ui/pages/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.component.js", + "ui/pages/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.component.test.js", + "ui/pages/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.container.js", + "ui/pages/send/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.container.test.js", + "ui/pages/send/send-content/send-row-wrapper/send-row-wrapper.component.js", + "ui/pages/send/send-content/send-row-wrapper/send-row-wrapper.component.test.js", + "ui/pages/send/send-footer/index.js", + "ui/pages/send/send-footer/send-footer.component.js", + "ui/pages/send/send-footer/send-footer.component.test.js", + "ui/pages/send/send-footer/send-footer.container.js", + "ui/pages/send/send-footer/send-footer.container.test.js", + "ui/pages/send/send-footer/send-footer.stories.js", + "ui/pages/send/send-header/index.js", + "ui/pages/send/send-header/send-header.component.js", + "ui/pages/send/send-header/send-header.component.test.js", + "ui/pages/send/send-header/send-header.stories.js", + "ui/pages/send/send.constants.js", + "ui/pages/send/send.js", + "ui/pages/send/send.test.js", + "ui/pages/send/send.utils.js", + "ui/pages/send/send.utils.test.js", + "ui/pages/settings/advanced-tab/advanced-tab.component.js", + "ui/pages/settings/advanced-tab/advanced-tab.component.test.js", + "ui/pages/settings/advanced-tab/advanced-tab.container.js", + "ui/pages/settings/advanced-tab/advanced-tab.stories.js", + "ui/pages/settings/advanced-tab/index.js", + "ui/pages/settings/alerts-tab/alerts-tab.js", + "ui/pages/settings/alerts-tab/alerts-tab.test.js", + "ui/pages/settings/alerts-tab/index.js", + "ui/pages/settings/contact-list-tab/add-contact/add-contact.component.js", + "ui/pages/settings/contact-list-tab/add-contact/add-contact.container.js", + "ui/pages/settings/contact-list-tab/add-contact/index.js", + "ui/pages/settings/contact-list-tab/contact-list-tab.component.js", + "ui/pages/settings/contact-list-tab/contact-list-tab.container.js", + "ui/pages/settings/contact-list-tab/contact-list-tab.stories.js", + "ui/pages/settings/contact-list-tab/edit-contact/edit-contact.component.js", + "ui/pages/settings/contact-list-tab/edit-contact/edit-contact.container.js", + "ui/pages/settings/contact-list-tab/edit-contact/index.js", + "ui/pages/settings/contact-list-tab/index.js", + "ui/pages/settings/contact-list-tab/view-contact/index.js", + "ui/pages/settings/contact-list-tab/view-contact/view-contact.component.js", + "ui/pages/settings/contact-list-tab/view-contact/view-contact.container.js", + "ui/pages/settings/experimental-tab/experimental-tab.component.js", + "ui/pages/settings/experimental-tab/experimental-tab.component.test.js", + "ui/pages/settings/experimental-tab/experimental-tab.constant.js", + "ui/pages/settings/experimental-tab/experimental-tab.container.js", + "ui/pages/settings/experimental-tab/index.js", + "ui/pages/settings/flask/snaps-list-tab/index.js", + "ui/pages/settings/flask/snaps-list-tab/snap-list-tab.js", + "ui/pages/settings/flask/snaps-list-tab/snap-list-tab.stories.js", + "ui/pages/settings/flask/view-snap/index.js", + "ui/pages/settings/flask/view-snap/view-snap.js", + "ui/pages/settings/index.js", + "ui/pages/settings/info-tab/index.js", + "ui/pages/settings/info-tab/info-tab.component.js", + "ui/pages/settings/info-tab/info-tab.stories.js", + "ui/pages/settings/networks-tab/custom-content-search/custom-content-search.js", + "ui/pages/settings/networks-tab/custom-content-search/custom-content-search.stories.js", + "ui/pages/settings/networks-tab/custom-content-search/custom-content-search.test.js", + "ui/pages/settings/networks-tab/custom-content-search/index.js", + "ui/pages/settings/networks-tab/index.js", + "ui/pages/settings/networks-tab/networks-form/index.js", + "ui/pages/settings/networks-tab/networks-form/networks-form.js", + "ui/pages/settings/networks-tab/networks-form/networks-form.test.js", + "ui/pages/settings/networks-tab/networks-list-item/index.js", + "ui/pages/settings/networks-tab/networks-list-item/networks-list-item.js", + "ui/pages/settings/networks-tab/networks-list-item/networks-list-item.stories.js", + "ui/pages/settings/networks-tab/networks-list-item/networks-list-item.test.js", + "ui/pages/settings/networks-tab/networks-list/index.js", + "ui/pages/settings/networks-tab/networks-list/network-list.stories.js", + "ui/pages/settings/networks-tab/networks-list/networks-list.js", + "ui/pages/settings/networks-tab/networks-list/networks-list.test.js", + "ui/pages/settings/networks-tab/networks-tab-content/index.js", + "ui/pages/settings/networks-tab/networks-tab-content/networks-tab-content.js", + "ui/pages/settings/networks-tab/networks-tab-content/networks-tab-content.test.js", + "ui/pages/settings/networks-tab/networks-tab-subheader/index.js", + "ui/pages/settings/networks-tab/networks-tab-subheader/networks-tab-subheader.js", + "ui/pages/settings/networks-tab/networks-tab-subheader/networks-tab-subheader.test.js", + "ui/pages/settings/networks-tab/networks-tab.constants.js", + "ui/pages/settings/networks-tab/networks-tab.js", + "ui/pages/settings/networks-tab/networks-tab.test.js", + "ui/pages/settings/security-tab/index.js", + "ui/pages/settings/security-tab/security-tab.component.js", + "ui/pages/settings/security-tab/security-tab.container.js", + "ui/pages/settings/security-tab/security-tab.container.test.js", + "ui/pages/settings/settings-search-list/index.js", + "ui/pages/settings/settings-search-list/settings-search-list.js", + "ui/pages/settings/settings-search/index.js", + "ui/pages/settings/settings-search/settings-search.js", + "ui/pages/settings/settings-search/settings-search.stories.js", + "ui/pages/settings/settings-tab/index.js", + "ui/pages/settings/settings-tab/settings-tab.component.js", + "ui/pages/settings/settings-tab/settings-tab.component.test.js", + "ui/pages/settings/settings-tab/settings-tab.container.js", + "ui/pages/settings/settings.component.js", + "ui/pages/settings/settings.component.test.js", + "ui/pages/settings/settings.container.js", + "ui/pages/settings/settings.stories.js", + "ui/pages/swaps/awaiting-signatures/awaiting-signatures.js", + "ui/pages/swaps/awaiting-signatures/awaiting-signatures.stories.js", + "ui/pages/swaps/awaiting-signatures/awaiting-signatures.test.js", + "ui/pages/swaps/awaiting-signatures/index.js", + "ui/pages/swaps/awaiting-signatures/swap-step-icon.js", + "ui/pages/swaps/awaiting-signatures/swap-step-icon.test.js", + "ui/pages/swaps/awaiting-swap/awaiting-swap.js", + "ui/pages/swaps/awaiting-swap/awaiting-swap.test.js", + "ui/pages/swaps/awaiting-swap/index.js", + "ui/pages/swaps/awaiting-swap/quotes-timeout-icon.js", + "ui/pages/swaps/awaiting-swap/quotes-timeout-icon.test.js", + "ui/pages/swaps/awaiting-swap/swap-failure-icon.js", + "ui/pages/swaps/awaiting-swap/swap-failure-icon.test.js", + "ui/pages/swaps/awaiting-swap/swap-success-icon.js", + "ui/pages/swaps/awaiting-swap/swap-success-icon.test.js", + "ui/pages/swaps/build-quote/build-quote.js", + "ui/pages/swaps/build-quote/build-quote.stories.js", + "ui/pages/swaps/build-quote/build-quote.test.js", + "ui/pages/swaps/build-quote/index.js", + "ui/pages/swaps/countdown-timer/countdown-timer.js", + "ui/pages/swaps/countdown-timer/countdown-timer.stories.js", + "ui/pages/swaps/countdown-timer/countdown-timer.test.js", + "ui/pages/swaps/countdown-timer/index.js", + "ui/pages/swaps/countdown-timer/timer-icon.js", + "ui/pages/swaps/countdown-timer/timer-icon.test.js", + "ui/pages/swaps/create-new-swap/create-new-swap.js", + "ui/pages/swaps/create-new-swap/create-new-swap.test.js", + "ui/pages/swaps/create-new-swap/index.js", + "ui/pages/swaps/dropdown-input-pair/dropdown-input-pair.js", + "ui/pages/swaps/dropdown-input-pair/dropdown-input-pair.stories.js", + "ui/pages/swaps/dropdown-input-pair/dropdown-input-pair.test.js", + "ui/pages/swaps/dropdown-input-pair/index.js", + "ui/pages/swaps/dropdown-search-list/dropdown-search-list.js", + "ui/pages/swaps/dropdown-search-list/dropdown-search-list.stories.js", + "ui/pages/swaps/dropdown-search-list/dropdown-search-list.test.js", + "ui/pages/swaps/dropdown-search-list/index.js", + "ui/pages/swaps/exchange-rate-display/exchange-rate-display.js", + "ui/pages/swaps/exchange-rate-display/exchange-rate-display.stories.js", + "ui/pages/swaps/exchange-rate-display/exchange-rate-display.test.js", + "ui/pages/swaps/exchange-rate-display/index.js", + "ui/pages/swaps/fee-card/fee-card.js", + "ui/pages/swaps/fee-card/fee-card.stories.js", + "ui/pages/swaps/fee-card/fee-card.test.js", + "ui/pages/swaps/fee-card/index.js", + "ui/pages/swaps/fee-card/pig-icon.js", + "ui/pages/swaps/fee-card/pig-icon.test.js", + "ui/pages/swaps/import-token/import-token.js", + "ui/pages/swaps/import-token/import-token.stories.js", + "ui/pages/swaps/import-token/import-token.test.js", + "ui/pages/swaps/import-token/index.js", + "ui/pages/swaps/index.js", + "ui/pages/swaps/index.test.js", + "ui/pages/swaps/loading-swaps-quotes/background-animation.js", + "ui/pages/swaps/loading-swaps-quotes/background-animation.test.js", + "ui/pages/swaps/loading-swaps-quotes/index.js", + "ui/pages/swaps/loading-swaps-quotes/loading-swap-quotes.stories.js", + "ui/pages/swaps/loading-swaps-quotes/loading-swaps-quotes-stories-metadata.js", + "ui/pages/swaps/loading-swaps-quotes/loading-swaps-quotes-stories-metadata.test.js", + "ui/pages/swaps/loading-swaps-quotes/loading-swaps-quotes.js", + "ui/pages/swaps/loading-swaps-quotes/loading-swaps-quotes.test.js", + "ui/pages/swaps/main-quote-summary/index.js", + "ui/pages/swaps/main-quote-summary/main-quote-summary.js", + "ui/pages/swaps/main-quote-summary/main-quote-summary.stories.js", + "ui/pages/swaps/main-quote-summary/main-quote-summary.test.js", + "ui/pages/swaps/main-quote-summary/quote-backdrop.js", + "ui/pages/swaps/main-quote-summary/quote-backdrop.test.js", + "ui/pages/swaps/searchable-item-list/index.js", + "ui/pages/swaps/searchable-item-list/item-list/index.js", + "ui/pages/swaps/searchable-item-list/item-list/item-list.component.js", + "ui/pages/swaps/searchable-item-list/list-item-search/index.js", + "ui/pages/swaps/searchable-item-list/list-item-search/list-item-search.component.js", + "ui/pages/swaps/searchable-item-list/list-item-search/list-item-search.stories.js", + "ui/pages/swaps/searchable-item-list/searchable-item-list.js", + "ui/pages/swaps/searchable-item-list/searchable-item-list.test.js", + "ui/pages/swaps/select-quote-popover/index.js", + "ui/pages/swaps/select-quote-popover/mock-quote-data.js", + "ui/pages/swaps/select-quote-popover/mock-quote-data.test.js", + "ui/pages/swaps/select-quote-popover/quote-details/index.js", + "ui/pages/swaps/select-quote-popover/quote-details/quote-details.js", + "ui/pages/swaps/select-quote-popover/select-quote-popover-constants.js", + "ui/pages/swaps/select-quote-popover/select-quote-popover.js", + "ui/pages/swaps/select-quote-popover/select-quote-popover.stories.js", + "ui/pages/swaps/select-quote-popover/select-quote-popover.test.js", + "ui/pages/swaps/select-quote-popover/sort-list/index.js", + "ui/pages/swaps/select-quote-popover/sort-list/sort-list.js", + "ui/pages/swaps/select-quote-popover/sort-list/sort-list.test.js", + "ui/pages/swaps/slippage-buttons/index.js", + "ui/pages/swaps/slippage-buttons/slippage-buttons.js", + "ui/pages/swaps/slippage-buttons/slippage-buttons.stories.js", + "ui/pages/swaps/slippage-buttons/slippage-buttons.test.js", + "ui/pages/swaps/smart-transaction-status/arrow-icon.js", + "ui/pages/swaps/smart-transaction-status/arrow-icon.test.js", + "ui/pages/swaps/smart-transaction-status/canceled-icon.js", + "ui/pages/swaps/smart-transaction-status/canceled-icon.test.js", + "ui/pages/swaps/smart-transaction-status/index.js", + "ui/pages/swaps/smart-transaction-status/reverted-icon.js", + "ui/pages/swaps/smart-transaction-status/reverted-icon.test.js", + "ui/pages/swaps/smart-transaction-status/smart-transaction-status.js", + "ui/pages/swaps/smart-transaction-status/smart-transaction-status.stories.js", + "ui/pages/swaps/smart-transaction-status/smart-transaction-status.test.js", + "ui/pages/swaps/smart-transaction-status/success-icon.js", + "ui/pages/swaps/smart-transaction-status/success-icon.test.js", + "ui/pages/swaps/smart-transaction-status/timer-icon.js", + "ui/pages/swaps/smart-transaction-status/timer-icon.test.js", + "ui/pages/swaps/smart-transaction-status/unknown-icon.js", + "ui/pages/swaps/smart-transaction-status/unknown-icon.test.js", + "ui/pages/swaps/swaps-footer/index.js", + "ui/pages/swaps/swaps-footer/swaps-footer.js", + "ui/pages/swaps/swaps-footer/swaps-footer.test.js", + "ui/pages/swaps/swaps-util-test-constants.js", + "ui/pages/swaps/swaps.util.js", + "ui/pages/swaps/swaps.util.test.js", + "ui/pages/swaps/view-on-block-explorer/index.js", + "ui/pages/swaps/view-on-block-explorer/view-on-block-explorer.js", + "ui/pages/swaps/view-on-block-explorer/view-on-block-explorer.test.js", + "ui/pages/swaps/view-quote/index.js", + "ui/pages/swaps/view-quote/view-quote-price-difference.js", + "ui/pages/swaps/view-quote/view-quote-price-difference.test.js", + "ui/pages/swaps/view-quote/view-quote.js", + "ui/pages/swaps/view-quote/view-quote.test.js", + "ui/pages/token-details/index.js", + "ui/pages/token-details/token-details-page.js", + "ui/pages/token-details/token-details-page.test.js", + "ui/pages/unlock-page/index.js", + "ui/pages/unlock-page/unlock-page.component.js", + "ui/pages/unlock-page/unlock-page.component.test.js", + "ui/pages/unlock-page/unlock-page.container.js", + "ui/pages/unlock-page/unlock-page.container.test.js", + "ui/pages/unlock-page/unlock-page.stories.js", + "ui/selectors/confirm-transaction.js", + "ui/selectors/confirm-transaction.test.js", + "ui/selectors/custom-gas.js", + "ui/selectors/custom-gas.test.js", + "ui/selectors/first-time-flow.js", + "ui/selectors/index.js", + "ui/selectors/metametrics.js", + "ui/selectors/metametrics.test.js", + "ui/selectors/nonce-sorted-transactions-selector.test.js", + "ui/selectors/permissions.js", + "ui/selectors/permissions.test.js", + "ui/selectors/selectors.js", + "ui/selectors/selectors.test.js", + "ui/selectors/transactions.js", + "ui/selectors/transactions.test.js", + "ui/store/actionConstants.js", + "ui/store/actionConstants.test.js", + "ui/store/actions.js", + "ui/store/actions.test.js", + "ui/store/store.js" +] diff --git a/development/ts-migration-dashboard/scripts/build-module-partitions.ts b/development/ts-migration-dashboard/scripts/build-module-partitions.ts new file mode 100644 index 000000000..4d4bcc5d8 --- /dev/null +++ b/development/ts-migration-dashboard/scripts/build-module-partitions.ts @@ -0,0 +1,336 @@ +import fs from 'fs'; +import path from 'path'; +import fg from 'fast-glob'; +import madge from 'madge'; +import { + BASE_DIRECTORY, + ENTRYPOINT_PATTERNS, + FILES_TO_CONVERT_PATH, +} from './constants'; + +/** + * Represents a module that has been imported somewhere in the codebase. + * + * @property id - The name of a file or NPM module. + * @property dependents - The modules which are imported by this module. + * @property level - How many modules it takes to import this module (from the + * root of the dependency tree). + * @property isExternal - Whether the module refers to a NPM module. + * @property hasBeenConverted - Whether the module was one of the files we + * wanted to convert to TypeScript and has been converted. + */ +type Module = { + id: string; + dependents: Module[]; + level: number; + isExternal: boolean; + hasBeenConverted: boolean; +}; + +/** + * Represents a set of modules that sit at a certain level within the final + * dependency tree. + * + * @property level - How many modules it takes to import this module (from the + * root of the dependency tree). + * @property children - The modules that share this same level. + * @property children[].name - The name of the item being imported. + * @property children[].hasBeenConverted - Whether or not the module (assuming + * that it is a file in our codebase) has been converted to TypeScript. + */ +export type ModulePartition = { + level: number; + children: { + name: string; + hasBeenConverted: boolean; + }[]; +}; + +/** + * Uses the `madge` package to traverse the dependency graphs assembled from a + * set of entrypoints (a combination of the entrypoints that the build script + * uses to build the extension as well as a manually picked list), builds a + * combined dependency tree, then arranges the nodes of that tree by level, + * which is the number of files it takes to reach a file within the whole tree. + * + * @returns An array of objects which can be used to render the dashboard, where + * each object represents a group of files at a certain level in the dependency + * tree. + */ +export default async function buildModulePartitions(): Promise< + ModulePartition[] +> { + const allowedFilePaths = readFilesToConvert(); + + const possibleEntryFilePaths = ( + await Promise.all( + ENTRYPOINT_PATTERNS.map((entrypointPattern) => { + return fg( + path.resolve(BASE_DIRECTORY, `${entrypointPattern}.{js,ts,tsx}`), + ); + }), + ) + ).flat(); + + const entryFilePaths = filterFilePaths( + possibleEntryFilePaths.map((possibleEntrypoint) => + path.relative(BASE_DIRECTORY, possibleEntrypoint), + ), + allowedFilePaths, + ); + + const result = await madge(entryFilePaths, { + baseDir: BASE_DIRECTORY, + tsConfig: path.join(BASE_DIRECTORY, 'tsconfig.json'), + }); + const dependenciesByFilePath = result.obj(); + const modulesById = buildModulesWithLevels( + dependenciesByFilePath, + entryFilePaths, + allowedFilePaths, + ); + return partitionModulesByLevel(modulesById); +} + +/** + * Returns the contents of a JSON file that stores the names of the files that + * we plan on converting to TypeScript. All of the dependency information + * will be filtered through this list. + */ +function readFilesToConvert(): string[] { + try { + return JSON.parse(fs.readFileSync(FILES_TO_CONVERT_PATH, 'utf-8')); + } catch (error: unknown) { + throw new Error( + 'Could not read or parse list of files to convert. ' + + 'Have you tried running the following command?\n\n' + + ' yarn ts-migration:enumerate\n\n' + + `Original error: ${error}`, + ); + } +} + +/** + * Filters the given set of file paths according to the given allow list. As the + * entry file paths could refer to TypeScript files, and the allow list is + * guaranteed to be JavaScript files, the entry file paths are normalized to end + * in `.js` before being filtered. + * + * @param filePaths - A set of file paths. + * @param allowedFilePaths - A set of allowed file paths. + * @returns The filtered file paths. + */ +function filterFilePaths(filePaths: string[], allowedFilePaths: string[]) { + return filePaths.filter((filePath) => + allowedFilePaths.includes(filePath.replace(/\.tsx?$/u, '.js')), + ); +} + +/** + * This function takes a flat data structure that represents the dependency + * graph of a system. It traverses the graph, converting it to a tree (i.e., + * resolving circular dependencies), but where any node of the tree is + * accessible immediately. The "level" of a dependency — how many other + * dependencies it takes to reach that dependency — is also recorded. + * + * @param dependenciesByModuleId - An object that maps a file path in the + * dependency graph to the dependencies that it imports. This information is + * provided by the `madge` package. + * @param entryModuleIds - File paths which will initiate the traversal through + * the dependency graph. These file paths will always be level 0. + * @param allowedFilePaths - The list of original JavaScript files to + * convert to TypeScript; governs which files will end up in the final + * dependency graph. + * @returns A data structure that maps the id of a module in the dependency + * graph to an object that represents that module. + */ +function buildModulesWithLevels( + dependenciesByModuleId: Record, + entryModuleIds: string[], + allowedFilePaths: string[], +): Record { + // Our overall goal is that we want to partition the graph into different + // sections. We want to find the leaves of the graph — that is, files that + // depend on no other files — then the dependents of the leaves — those files + // that depend on the leaves — then the dependents of the dependents, etc. We + // can derive this information by traversing the graph, and for each module we + // encounter, recording the number of modules it takes to reach that module. + // We call this number the **level**. + // + // We will discuss a couple of optimizations we've made to ensure that graph + // traversal is performant. + // + // Naively, in order to calculate the level of each module, we need to follow + // that module's dependencies, then the dependencies of the dependencies, + // etc., until we hit leaves. Essentially, we need to follow each connection + // in the graph. However, this creates a performance problem, because in a + // large system a file could get imported multiple ways (this is the nature of + // a graph: each node can have multiple incoming connections and multiple + // outgoing connections). For instance: + // + // - `foo.js` could import `bar.js` which could import `baz.js` + // - `foo.js` could also import `baz.js` directly + // - `foo.js` could also import `bar.js` which imports `qux.js` which imports `baz.js` + // + // In this case, even if there are few modules in a system, a subset of those + // modules may be visited multiple times in the course of traversing + // connections between all of them. This is costly and unnecessary. + // + // To address this, as we are traversing the graph, we record modules we've + // visited along with the level when we visited it. If we encounter a module + // again through some other path, and the level this time is less than the + // level we've already recorded, then we know we don't need to revisit that + // module or — crucially — any of its dependencies. Therefore we can skip + // whole sections of the graph. + // + // In addition, in a large enough system, some files could import files that end + // up importing themselves later on: + // + // - `foo.js` could import `bar.js`, which imports `baz.js`, which imports `foo.js`, which... + // + // These are called circular dependencies, and we detect them by tracking the + // files that depend on a file (dependents) in addition to the files on which + // that file depends (dependencies). In the example above, `baz.js` has a + // dependency `foo.js`, and its chain of dependents is `bar.js` -> `foo.js` + // (working backward from `baz.js`). The chain of dependents of `baz.js` + // includes `foo.js`, so we say `foo.js` is a circular dependency of `baz.js`, + // and we don't need to follow it. + + const modulesToFill: Module[] = entryModuleIds.map((moduleId) => { + return { + id: moduleId, + dependents: [], + level: 0, + isExternal: false, + hasBeenConverted: /\.tsx?$/u.test(moduleId), + }; + }); + const modulesById: Record = {}; + + while (modulesToFill.length > 0) { + const currentModule = modulesToFill.shift() as Module; + const childModulesToFill: Module[] = []; + (dependenciesByModuleId[currentModule.id] ?? []).forEach( + (givenChildModuleId) => { + const npmPackageMatch = givenChildModuleId.match( + /^node_modules\/(?:(@[^/]+)\/)?([^/]+)\/.+$/u, + ); + + let childModuleId; + if (npmPackageMatch) { + childModuleId = + npmPackageMatch[1] === undefined + ? `${npmPackageMatch[2]}` + : `${npmPackageMatch[1]}/${npmPackageMatch[2]}`; + } else { + childModuleId = givenChildModuleId; + } + + // Skip circular dependencies + if ( + findDirectAndIndirectDependentIdsOf(currentModule).has(childModuleId) + ) { + return; + } + + // Skip files that weren't on the original list of JavaScript files to + // convert, as we don't want them to show up on the status dashboard + if ( + !npmPackageMatch && + !allowedFilePaths.includes(childModuleId.replace(/\.tsx?$/u, '.js')) + ) { + return; + } + + const existingChildModule = modulesById[childModuleId]; + + if (existingChildModule === undefined) { + const childModule: Module = { + id: childModuleId, + dependents: [currentModule], + level: currentModule.level + 1, + isExternal: Boolean(npmPackageMatch), + hasBeenConverted: /\.tsx?$/u.test(childModuleId), + }; + childModulesToFill.push(childModule); + } else { + if (currentModule.level + 1 > existingChildModule.level) { + existingChildModule.level = currentModule.level + 1; + // Update descendant modules' levels + childModulesToFill.push(existingChildModule); + } else { + // There is no point in descending into dependencies of this module + // if the new level of the module would be <= the existing level, + // because all of the dependencies from this point on are guaranteed + // to have a higher level and are therefore already at the right + // level. + } + + if (!existingChildModule.dependents.includes(currentModule)) { + existingChildModule.dependents.push(currentModule); + } + } + }, + ); + if (childModulesToFill.length > 0) { + modulesToFill.push(...childModulesToFill); + } + if (!(currentModule.id in modulesById)) { + modulesById[currentModule.id] = currentModule; + } + } + + return modulesById; +} + +/** + * Given a file in the dependency graph, returns all of the names of the files + * which import that file directly or through some other file. + * + * @param module - A module in the graph. + * @returns The ids of the modules which are incoming connections to + * the module. + */ +function findDirectAndIndirectDependentIdsOf(module: Module): Set { + const modulesToProcess = [module]; + const allDependentIds = new Set(); + while (modulesToProcess.length > 0) { + const currentModule = modulesToProcess.shift() as Module; + currentModule.dependents.forEach((dependent) => { + if (!allDependentIds.has(dependent.id)) { + allDependentIds.add(dependent.id); + modulesToProcess.push(dependent); + } + }); + } + return allDependentIds; +} + +/** + * Partitions modules in the dependency graph by level (see {@link buildModulesWithLevels} + * for an explanation). This will be used to render those modules on the + * dashboard in groups. + * + * @param modulesById - An object that maps the id of a module to an object that + * represents that module. + * @returns An array where each item represents a level and is the module ids + * that match that level, sorted by largest level (leaves) to smallest level + * (roots). + */ +function partitionModulesByLevel( + modulesById: Record, +): ModulePartition[] { + const levels = Object.values(modulesById).map((module) => module.level); + const maxLevel = Math.max(...levels); + const modulePartitions: ModulePartition[] = []; + for (let i = 0; i <= maxLevel; i++) { + modulePartitions[i] = { level: i + 1, children: [] }; + } + Object.values(modulesById).forEach((module) => { + modulePartitions[module.level].children.push({ + name: module.id, + hasBeenConverted: module.hasBeenConverted, + }); + }); + return modulePartitions.reverse(); +} diff --git a/development/ts-migration-dashboard/scripts/build.ts b/development/ts-migration-dashboard/scripts/build.ts new file mode 100644 index 000000000..ebf0bec70 --- /dev/null +++ b/development/ts-migration-dashboard/scripts/build.ts @@ -0,0 +1,227 @@ +import path from 'path'; +import fs from 'fs-extra'; +import yargs from 'yargs/yargs'; +import { hideBin } from 'yargs/helpers'; +import chokidar from 'chokidar'; +import browserify from 'browserify'; +import pify from 'pify'; +import endOfStream from 'end-of-stream'; +import pump from 'pump'; +import gulp from 'gulp'; +import gulpDartSass from 'gulp-dart-sass'; +import sourcemaps from 'gulp-sourcemaps'; +import autoprefixer from 'gulp-autoprefixer'; +import fg from 'fast-glob'; +import buildModulePartitions from './build-module-partitions'; + +const promisifiedPump = pify(pump); +const projectDirectoryPath = path.resolve(__dirname, '../'); +const sourceDirectoryPath = path.join(projectDirectoryPath, 'src'); +const intermediateDirectoryPath = path.join( + projectDirectoryPath, + 'intermediate', +); +const buildDirectoryPath = path.join(projectDirectoryPath, 'build'); + +main().catch((error) => { + console.error(error); + process.exit(1); +}); + +/** + * Compiles a set of files that we want to convert to TypeScript, divided by + * level in the dependency tree. + * + * @param dest - The directory in which to hold the file. + */ +async function generateIntermediateFiles(dest: string) { + const partitions = await buildModulePartitions(); + const partitionsFile = path.resolve(dest, 'partitions.json'); + await pify(fs.writeFile)( + partitionsFile, + JSON.stringify(partitions, null, ' '), + ); + + console.log( + `- Wrote intermediate partitions file: ${path.relative( + projectDirectoryPath, + partitionsFile, + )}`, + ); +} + +/** + * Compiles the JavaScript code for the dashboard. + * + * @param src - The path to the JavaScript entrypoint. + * @param dest - The path to the compiled and bundled JavaScript file. + */ +async function compileScripts(src: string, dest: string) { + const extensions = ['.js', '.ts', '.tsx']; + const browserifyOptions: Record = { + extensions, + // Use entryFilepath for moduleIds, easier to determine origin file + fullPaths: true, + // For sourcemaps + debug: true, + }; + const bundler = browserify(browserifyOptions); + bundler.add(src); + // Run TypeScript files through Babel + bundler.transform('babelify', { extensions }); + // Inline `fs.readFileSync` files + bundler.transform('brfs'); + + const bundleStream = bundler.bundle(); + bundleStream.pipe(fs.createWriteStream(dest)); + bundleStream.on('error', (error: Error) => { + throw error; + }); + await pify(endOfStream(bundleStream)); + + console.log( + `- Compiled scripts: ${path.relative( + projectDirectoryPath, + src, + )} -> ${path.relative(projectDirectoryPath, dest)}`, + ); +} + +/** + * Compiles the CSS code for the dashboard. + * + * @param src - The path to the CSS file. + * @param dest - The path to the compiled CSS file. + */ +async function compileStylesheets(src: string, dest: string): Promise { + await promisifiedPump( + gulp.src(src), + sourcemaps.init(), + gulpDartSass().on('error', (error: unknown) => { + throw error; + }), + autoprefixer(), + sourcemaps.write(), + gulp.dest(dest), + ); + console.log( + `- Compiled stylesheets: ${path.relative( + projectDirectoryPath, + src, + )} -> ${path.relative(projectDirectoryPath, dest)}`, + ); +} + +/** + * Copies static files (images and the index HTML file) to the build directory. + * + * @param src - The path to the directory that holds the static files. + * @param dest - The path where they should be copied. + */ +async function copyStaticFiles(src: string, dest: string): Promise { + const entries = await fg([path.join(src, '*')], { + onlyFiles: false, + }); + await Promise.all( + entries.map(async (srcEntry) => { + const destEntry = path.join(dest, path.basename(srcEntry)); + await fs.copy(srcEntry, destEntry); + console.log( + `- Copied static files: ${path.relative( + projectDirectoryPath, + srcEntry, + )} -> ${path.relative(projectDirectoryPath, destEntry)}`, + ); + }), + ); +} + +/** + * Generates a compiled and bundled version of the dashboard ready for + * distribution. + * + * @param options - The options. + * @param options.isInitial - Whether this is the first time this function has + * been called (if we are watching for file changes, we may call this function + * multiple times). + * @param options.isOnly - Whether this will be the only time this function will + * be called (if we are not watching for file changes, then this will never be + * called again). + */ +async function rebuild({ + isInitial = false, + isOnly = false, +} = {}): Promise { + if (isInitial && !isOnly) { + console.log('Running initial build, please wait (may take a bit)...'); + } + + if (!isInitial) { + console.log('Detected change, rebuilding...'); + } + + await fs.emptyDir(buildDirectoryPath); + + try { + if (isInitial) { + await fs.emptyDir(intermediateDirectoryPath); + await generateIntermediateFiles(intermediateDirectoryPath); + } + + await compileScripts( + path.join(sourceDirectoryPath, 'index.tsx'), + path.join(buildDirectoryPath, 'index.js'), + ); + await compileStylesheets( + path.join(sourceDirectoryPath, 'index.scss'), + path.join(buildDirectoryPath), + ); + await copyStaticFiles( + path.join(sourceDirectoryPath, 'public'), + path.join(buildDirectoryPath), + ); + } catch (error: unknown) { + console.error(error); + } +} + +/** + * The entrypoint to this script. Parses command-line arguments, then, depending + * on whether `--watch` was given, either starts a file watcher, after which the + * dashboard will be built on file changes, or builds the dashboard immediately. + */ +async function main() { + const opts = yargs(hideBin(process.argv)) + .usage('Usage: $0 [options]') + .option('watch', { + alias: 'w', + type: 'boolean', + description: 'Automatically build when there are changes', + }) + .help('h') + .alias('h', 'help') + .parseSync(); + + console.log(`Working directory: ${projectDirectoryPath}`); + + if (opts.watch) { + const rebuildIgnoringErrors = () => { + rebuild().catch((error: Error) => { + console.error(error); + }); + }; + chokidar + .watch(path.join(sourceDirectoryPath, '**/*.{html,ts,tsx,scss}'), { + ignoreInitial: true, + }) + .on('add', rebuildIgnoringErrors) + .on('change', rebuildIgnoringErrors) + .on('unlink', rebuildIgnoringErrors) + .on('error', (error: unknown) => { + console.error(error); + }); + await rebuild({ isInitial: true, isOnly: false }); + } else { + await rebuild({ isInitial: true, isOnly: true }); + } +} diff --git a/development/ts-migration-dashboard/scripts/constants.ts b/development/ts-migration-dashboard/scripts/constants.ts new file mode 100644 index 000000000..a283fd8e0 --- /dev/null +++ b/development/ts-migration-dashboard/scripts/constants.ts @@ -0,0 +1,19 @@ +import path from 'path'; + +export const BASE_DIRECTORY = path.resolve(__dirname, '../../..'); +export const ENTRYPOINT_PATTERNS = [ + 'app/scripts/background', + 'app/scripts/contentscript', + 'app/scripts/disable-console', + 'app/scripts/inpage', + 'app/scripts/phishing-detect', + 'app/scripts/sentry-install', + 'app/scripts/ui', + 'development/build/index', + '**/*.stories', + '**/*.test', +]; +export const FILES_TO_CONVERT_PATH = path.join( + __dirname, + '../files-to-convert.json', +); diff --git a/development/ts-migration-dashboard/scripts/write-list-of-files-to-convert.ts b/development/ts-migration-dashboard/scripts/write-list-of-files-to-convert.ts new file mode 100644 index 000000000..cd375ca9d --- /dev/null +++ b/development/ts-migration-dashboard/scripts/write-list-of-files-to-convert.ts @@ -0,0 +1,59 @@ +import path from 'path'; +import fs from 'fs'; +import fg from 'fast-glob'; +import madge from 'madge'; +import { + BASE_DIRECTORY, + ENTRYPOINT_PATTERNS, + FILES_TO_CONVERT_PATH, +} from './constants'; + +main().catch((error) => { + console.error(error); + process.exit(1); +}); + +/** + * The entrypoint to this script. + * + * Uses the `madge` package to traverse the dependency graph of a set of + * entrypoints (a combination of the ones that the build script uses to build + * the extension as well as a manually picked list), outputting a JSON array + * containing all JavaScript files that need to be converted to TypeScript. + */ +async function main(): Promise { + const entrypoints = ( + await Promise.all( + ENTRYPOINT_PATTERNS.map((entrypointPattern) => { + return fg( + path.resolve(BASE_DIRECTORY, `${entrypointPattern}.{js,ts,tsx}`), + ); + }), + ) + ).flat(); + console.log( + `Traversing dependency trees for ${entrypoints.length} entrypoints, please wait...`, + ); + const result = await madge(entrypoints, { + baseDir: BASE_DIRECTORY, + }); + const dependenciesByFilePath = result.obj(); + const sortedFilePaths = Object.keys(dependenciesByFilePath) + .sort() + .filter((filePath) => { + return ( + /\.(?:js|tsx?)$/u.test(filePath) && + !/^(?:\.storybook|node_modules)\//u.test(filePath) + ); + }); + + fs.writeFileSync( + FILES_TO_CONVERT_PATH, + JSON.stringify(sortedFilePaths, null, ' '), + ); + console.log( + `${path.relative(process.cwd(), FILES_TO_CONVERT_PATH)} written with ${ + sortedFilePaths.length + } modules.`, + ); +} diff --git a/development/ts-migration-dashboard/src/App.tsx b/development/ts-migration-dashboard/src/App.tsx new file mode 100644 index 000000000..d799815b4 --- /dev/null +++ b/development/ts-migration-dashboard/src/App.tsx @@ -0,0 +1,157 @@ +import React from 'react'; +import classnames from 'classnames'; +import { Tooltip as ReactTippy } from 'react-tippy'; +import { ModulePartition } from '../scripts/build-module-partitions'; + +// The `brfs` transform for browserify calls `fs.readLineSync` and +// `path.resolve` at build time and inlines file contents into the source code. +// To accomplish this we have to bring in `fs` and `path` using `require` and +// not `import`. This is weird in a TypeScript file, and typescript-eslint +// (rightly) complains about this, but it's actually okay because the above +// `import` lines will actually get turned into `require`s anyway before passing +// through the rest of browserify. However, `brfs` should handle this. There is +// an active bug for this, but there isn't a known workaround yet: +// +/* eslint-disable-next-line @typescript-eslint/no-require-imports,@typescript-eslint/no-var-requires */ +const fs = require('fs'); +/* eslint-disable-next-line @typescript-eslint/no-require-imports,@typescript-eslint/no-var-requires */ +const path = require('path'); + +type Summary = { + numConvertedFiles: number; + numFiles: number; +}; + +function calculatePercentageComplete(summary: Summary) { + return ((summary.numConvertedFiles / summary.numFiles) * 100).toFixed(1); +} + +export default function App() { + const partitions = JSON.parse( + fs.readFileSync( + path.resolve(__dirname, '../intermediate/partitions.json'), + { + encoding: 'utf-8', + }, + ), + ) as ModulePartition[]; + + const allFiles = partitions.flatMap((partition) => { + return partition.children; + }); + const overallTotal = { + numConvertedFiles: allFiles.filter((file) => file.hasBeenConverted).length, + numFiles: allFiles.length, + }; + + return ( + <> +

+ + Extension TypeScript Migration Status +

+

+ OVERALL: {overallTotal.numConvertedFiles}/{overallTotal.numFiles} ( + {calculatePercentageComplete(overallTotal)}%) +

+
+ What is this? +
+

+ This is a dashboard that tracks the status of converting the + extension codebase from JavaScript to TypeScript. It is updated + whenever a new commit is pushed to the codebase, so it always + represents the current work. +

+ +

+ Each box +

+   +
+ on this page represents a file that either we want to convert or + we've already converted to TypeScript (hover over a box to see the + filename). Boxes that are +
+   +
+ greyed out are test or Storybook files. +

+ +

+ These boxes are further partitioned by level. The level of + a file is how many files you have to import before you reach that + file in the whole codebase. For instance, if we have a file{' '} + foo.js, and that file imports bar.js and{' '} + baz.js, and baz.js imports{' '} + qux.js, then: +

+ +
    +
  • + foo.js would be at level 1 +
  • +
  • + bar.js and baz.js would be at{' '} + level 2 +
  • +
  • + qux.js would be at level 3 +
  • +
+ +

+ This level assignment can be used to determine a priority for + converting the remaining JavaScript files. Files which have fewer + dependencies should in theory be easier to convert, so files with a + higher level should be converted first. In other words,{' '} + + you should be able to start from the top and go down + + . +

+
+
+
+ {partitions.map((partition) => { + return ( +
+
level {partition.level}
+
+ {partition.children.map(({ name, hasBeenConverted }) => { + const isTest = /\.test\.(?:js|tsx?)/u.test(name); + const isStorybookFile = /\.stories\.(?:js|tsx?)/u.test(name); + return ( + +
+ + ); + })} +
+
+ ); + })} +
+ + ); +} diff --git a/development/ts-migration-dashboard/src/index.scss b/development/ts-migration-dashboard/src/index.scss new file mode 100644 index 000000000..863fb52c2 --- /dev/null +++ b/development/ts-migration-dashboard/src/index.scss @@ -0,0 +1,191 @@ +@import '../../../ui/css/reset'; +@import './tippy'; + +/* Native elements */ + +* { + box-sizing: border-box; +} + +html { + font-family: + -apple-system, + BlinkMacSystemFont, + "Segoe UI", + Helvetica, + Arial, + sans-serif, + "Apple Color Emoji", + "Segoe UI Emoji"; + font-size: 16px; +} + +body { + padding: 2rem; +} + +p:not(:last-child) { + margin-bottom: 1rem; +} + +code { + font-size: 0.85em; + font-family: + ui-monospace, + SFMono-Regular, + SF Mono, + Menlo, + Consolas, + Liberation Mono, + monospace; +} + +strong { + font-weight: bold; +} + +em { + font-style: italic; +} + +ul { + list-style: disc; + margin-bottom: 1rem; + margin-left: 1rem; +} + +/* Custom elements */ + +:root { + --blue-gray-350: hsl(209deg 13.7% 62.4%); + --blue-gray-100: hsl(209.8deg 16.5% 89%); + --green: hsl(113deg 100% 38%); +} + +.page-header { + font-size: 2rem; + font-weight: bold; + display: flex; + align-items: center; + + &__icon { + height: 1em; + margin-right: 0.5em; + } +} + +.overall-summary { + font-size: 1.5rem; + line-height: 1.5rem; + padding: 1rem; + margin: 2rem 0; + background: linear-gradient(90deg, var(--green) 0% var(--progress), var(--blue-gray-350) var(--progress) 100%) no-repeat; + border: 2px solid rgb(0 0 0 / 50%); + color: white; + font-weight: bold; +} + +.help { + margin-bottom: 2rem; + color: black; + line-height: 1.5rem; + background-color: #ffffc8; + border: 1px solid rgb(0 0 0 / 25%); + max-width: 40rem; + + [open] { + padding: 1rem; + } + + &__question { + font-weight: bold; + cursor: pointer; + font-size: 1.1rem; + padding: 1rem; + } + + &__answer { + padding: 0 1rem 1rem; + } +} + +.section-header { + font-size: 1.25rem; + line-height: 1.25rem; + padding: 0.75rem; + color: white; + background: linear-gradient(90deg, var(--green) 0% var(--progress), var(--blue-gray-350) var(--progress) 100%) no-repeat; + border-bottom: 1px solid rgb(0 0 0 / 50%); + + &--primary { + font-weight: bold; + } +} + +.section { + margin-bottom: 2rem; + border: 1px solid rgb(0 0 0 / 50%); +} + +.level { + display: flex; + gap: 0.5rem; + margin-bottom: 1rem; + + &__name { + writing-mode: vertical-rl; + font-size: 0.75rem; + padding: 0.75rem 0; + } + + &__children { + display: flex; + flex-wrap: wrap; + gap: 0.75rem; + padding: 1rem; + border: 1px dotted gray; + border-radius: 0.5rem; + height: fit-content; + } +} + +.file { + width: 1.5rem; + height: 1.5rem; + border: 1px solid rgba(0 0 0 / 25%); + border-radius: 0.25rem; + + &--inline { + display: inline-block; + margin: 0 0.5rem; + vertical-align: middle; + } + + &__tooltipped { + width: 1.5rem; + height: 1.5rem; + } + + &--has-been-converted { + background-color: var(--green); + } + + &--to-be-converted { + background-color: var(--blue-gray-100); + } + + &--test, + &--storybook { + opacity: 0.3; + } +} + +/* Package overrides */ + +.tippy-tooltip { + padding: 0.4rem 0.6rem; +} + +.tippy-tooltip-content { + font-size: 0.8rem; +} diff --git a/development/ts-migration-dashboard/src/index.tsx b/development/ts-migration-dashboard/src/index.tsx new file mode 100644 index 000000000..5c458b5ae --- /dev/null +++ b/development/ts-migration-dashboard/src/index.tsx @@ -0,0 +1,7 @@ +import * as React from 'react'; +import ReactDOM from 'react-dom'; +import App from './App'; + +const appElement = document.querySelector('#app'); + +ReactDOM.render(, appElement); diff --git a/development/ts-migration-dashboard/src/public/images/metamask-fox.svg b/development/ts-migration-dashboard/src/public/images/metamask-fox.svg new file mode 100644 index 000000000..a6cffef03 --- /dev/null +++ b/development/ts-migration-dashboard/src/public/images/metamask-fox.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/development/ts-migration-dashboard/src/public/index.html b/development/ts-migration-dashboard/src/public/index.html new file mode 100644 index 000000000..9e72685b3 --- /dev/null +++ b/development/ts-migration-dashboard/src/public/index.html @@ -0,0 +1,13 @@ + + + + + + Extension TypeScript Migration Status + + + +
+ + + diff --git a/development/ts-migration-dashboard/src/tippy.scss b/development/ts-migration-dashboard/src/tippy.scss new file mode 100644 index 000000000..0ce28c5ea --- /dev/null +++ b/development/ts-migration-dashboard/src/tippy.scss @@ -0,0 +1,655 @@ +.tippy-touch { + cursor: pointer !important; +} + +.tippy-notransition { + transition: none !important; +} + +.tippy-popper { + max-width: 400px; + -webkit-perspective: 800px; + perspective: 800px; + z-index: 9999; + outline: 0; + transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1); + pointer-events: none; +} + +.tippy-popper.html-template { + max-width: 96%; + max-width: calc(100% - 20px); +} + +.tippy-popper[x-placement^='top'] [x-arrow] { + border-top: 7px solid #333; + border-right: 7px solid transparent; + border-left: 7px solid transparent; + bottom: -7px; + margin: 0 9px; +} + +.tippy-popper[x-placement^='top'] [x-arrow].arrow-small { + border-top: 5px solid #333; + border-right: 5px solid transparent; + border-left: 5px solid transparent; + bottom: -5px; +} + +.tippy-popper[x-placement^='top'] [x-arrow].arrow-big { + border-top: 10px solid #333; + border-right: 10px solid transparent; + border-left: 10px solid transparent; + bottom: -10px; +} + +.tippy-popper[x-placement^='top'] [x-circle] { + -webkit-transform-origin: 0 33%; + transform-origin: 0 33%; +} + +.tippy-popper[x-placement^='top'] [x-circle].enter { + -webkit-transform: scale(1) translate(-50%, -55%); + transform: scale(1) translate(-50%, -55%); + opacity: 1; +} + +.tippy-popper[x-placement^='top'] [x-circle].leave { + -webkit-transform: scale(0.15) translate(-50%, -50%); + transform: scale(0.15) translate(-50%, -50%); + opacity: 0; +} + +.tippy-popper[x-placement^='top'] .tippy-tooltip.light-theme [x-circle] { + background-color: #fff; +} + +.tippy-popper[x-placement^='top'] .tippy-tooltip.light-theme [x-arrow] { + border-top: 7px solid #fff; + border-right: 7px solid transparent; + border-left: 7px solid transparent; +} + +.tippy-popper[x-placement^='top'] .tippy-tooltip.light-theme [x-arrow].arrow-small { + border-top: 5px solid #fff; + border-right: 5px solid transparent; + border-left: 5px solid transparent; +} + +.tippy-popper[x-placement^='top'] .tippy-tooltip.light-theme [x-arrow].arrow-big { + border-top: 10px solid #fff; + border-right: 10px solid transparent; + border-left: 10px solid transparent; +} + +.tippy-popper[x-placement^='top'] .tippy-tooltip.transparent-theme [x-circle] { + background-color: rgba(0, 0, 0, 0.7); +} + +.tippy-popper[x-placement^='top'] .tippy-tooltip.transparent-theme [x-arrow] { + border-top: 7px solid rgba(0, 0, 0, 0.7); + border-right: 7px solid transparent; + border-left: 7px solid transparent; +} + +.tippy-popper[x-placement^='top'] .tippy-tooltip.transparent-theme [x-arrow].arrow-small { + border-top: 5px solid rgba(0, 0, 0, 0.7); + border-right: 5px solid transparent; + border-left: 5px solid transparent; +} + +.tippy-popper[x-placement^='top'] .tippy-tooltip.transparent-theme [x-arrow].arrow-big { + border-top: 10px solid rgba(0, 0, 0, 0.7); + border-right: 10px solid transparent; + border-left: 10px solid transparent; +} + +.tippy-popper[x-placement^='top'] [data-animation='perspective'] { + -webkit-transform-origin: bottom; + transform-origin: bottom; +} + +.tippy-popper[x-placement^='top'] [data-animation='perspective'].enter { + opacity: 1; + -webkit-transform: translateY(-10px) rotateX(0); + transform: translateY(-10px) rotateX(0); +} + +.tippy-popper[x-placement^='top'] [data-animation='perspective'].leave { + opacity: 0; + -webkit-transform: translateY(0) rotateX(90deg); + transform: translateY(0) rotateX(90deg); +} + +.tippy-popper[x-placement^='top'] [data-animation='fade'].enter { + opacity: 1; + -webkit-transform: translateY(-10px); + transform: translateY(-10px); +} + +.tippy-popper[x-placement^='top'] [data-animation='fade'].leave { + opacity: 0; + -webkit-transform: translateY(-10px); + transform: translateY(-10px); +} + +.tippy-popper[x-placement^='top'] [data-animation='shift'].enter { + opacity: 1; + -webkit-transform: translateY(-10px); + transform: translateY(-10px); +} + +.tippy-popper[x-placement^='top'] [data-animation='shift'].leave { + opacity: 0; + -webkit-transform: translateY(0); + transform: translateY(0); +} + +.tippy-popper[x-placement^='top'] [data-animation='scale'].enter { + opacity: 1; + -webkit-transform: translateY(-10px) scale(1); + transform: translateY(-10px) scale(1); +} + +.tippy-popper[x-placement^='top'] [data-animation='scale'].leave { + opacity: 0; + -webkit-transform: translateY(0) scale(0); + transform: translateY(0) scale(0); +} + +.tippy-popper[x-placement^='bottom'] [x-arrow] { + border-bottom: 7px solid #333; + border-right: 7px solid transparent; + border-left: 7px solid transparent; + top: -7px; + margin: 0 9px; +} + +.tippy-popper[x-placement^='bottom'] [x-arrow].arrow-small { + border-bottom: 5px solid #333; + border-right: 5px solid transparent; + border-left: 5px solid transparent; + top: -5px; +} + +.tippy-popper[x-placement^='bottom'] [x-arrow].arrow-big { + border-bottom: 10px solid #333; + border-right: 10px solid transparent; + border-left: 10px solid transparent; + top: -10px; +} + +.tippy-popper[x-placement^='bottom'] [x-circle] { + -webkit-transform-origin: 0 -50%; + transform-origin: 0 -50%; +} + +.tippy-popper[x-placement^='bottom'] [x-circle].enter { + -webkit-transform: scale(1) translate(-50%, -45%); + transform: scale(1) translate(-50%, -45%); + opacity: 1; +} + +.tippy-popper[x-placement^='bottom'] [x-circle].leave { + -webkit-transform: scale(0.15) translate(-50%, -5%); + transform: scale(0.15) translate(-50%, -5%); + opacity: 0; +} + +.tippy-popper[x-placement^='bottom'] .tippy-tooltip.light-theme [x-circle] { + background-color: #fff; +} + +.tippy-popper[x-placement^='bottom'] .tippy-tooltip.light-theme [x-arrow] { + border-bottom: 7px solid #fff; + border-right: 7px solid transparent; + border-left: 7px solid transparent; +} + +.tippy-popper[x-placement^='bottom'] .tippy-tooltip.light-theme [x-arrow].arrow-small { + border-bottom: 5px solid #fff; + border-right: 5px solid transparent; + border-left: 5px solid transparent; +} + +.tippy-popper[x-placement^='bottom'] .tippy-tooltip.light-theme [x-arrow].arrow-big { + border-bottom: 10px solid #fff; + border-right: 10px solid transparent; + border-left: 10px solid transparent; +} + +.tippy-popper[x-placement^='bottom'] .tippy-tooltip.transparent-theme [x-circle] { + background-color: rgba(0, 0, 0, 0.7); +} + +.tippy-popper[x-placement^='bottom'] .tippy-tooltip.transparent-theme [x-arrow] { + border-bottom: 7px solid rgba(0, 0, 0, 0.7); + border-right: 7px solid transparent; + border-left: 7px solid transparent; +} + +.tippy-popper[x-placement^='bottom'] .tippy-tooltip.transparent-theme [x-arrow].arrow-small { + border-bottom: 5px solid rgba(0, 0, 0, 0.7); + border-right: 5px solid transparent; + border-left: 5px solid transparent; +} + +.tippy-popper[x-placement^='bottom'] .tippy-tooltip.transparent-theme [x-arrow].arrow-big { + border-bottom: 10px solid rgba(0, 0, 0, 0.7); + border-right: 10px solid transparent; + border-left: 10px solid transparent; +} + +.tippy-popper[x-placement^='bottom'] [data-animation='perspective'] { + -webkit-transform-origin: top; + transform-origin: top; +} + +.tippy-popper[x-placement^='bottom'] [data-animation='perspective'].enter { + opacity: 1; + -webkit-transform: translateY(10px) rotateX(0); + transform: translateY(10px) rotateX(0); +} + +.tippy-popper[x-placement^='bottom'] [data-animation='perspective'].leave { + opacity: 0; + -webkit-transform: translateY(0) rotateX(-90deg); + transform: translateY(0) rotateX(-90deg); +} + +.tippy-popper[x-placement^='bottom'] [data-animation='fade'].enter { + opacity: 1; + -webkit-transform: translateY(10px); + transform: translateY(10px); +} + +.tippy-popper[x-placement^='bottom'] [data-animation='fade'].leave { + opacity: 0; + -webkit-transform: translateY(10px); + transform: translateY(10px); +} + +.tippy-popper[x-placement^='bottom'] [data-animation='shift'].enter { + opacity: 1; + -webkit-transform: translateY(10px); + transform: translateY(10px); +} + +.tippy-popper[x-placement^='bottom'] [data-animation='shift'].leave { + opacity: 0; + -webkit-transform: translateY(0); + transform: translateY(0); +} + +.tippy-popper[x-placement^='bottom'] [data-animation='scale'].enter { + opacity: 1; + -webkit-transform: translateY(10px) scale(1); + transform: translateY(10px) scale(1); +} + +.tippy-popper[x-placement^='bottom'] [data-animation='scale'].leave { + opacity: 0; + -webkit-transform: translateY(0) scale(0); + transform: translateY(0) scale(0); +} + +.tippy-popper[x-placement^='left'] [x-arrow] { + border-left: 7px solid #333; + border-top: 7px solid transparent; + border-bottom: 7px solid transparent; + right: -7px; + margin: 6px 0; +} + +.tippy-popper[x-placement^='left'] [x-arrow].arrow-small { + border-left: 5px solid #333; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + right: -5px; +} + +.tippy-popper[x-placement^='left'] [x-arrow].arrow-big { + border-left: 10px solid #333; + border-top: 10px solid transparent; + border-bottom: 10px solid transparent; + right: -10px; +} + +.tippy-popper[x-placement^='left'] [x-circle] { + -webkit-transform-origin: 50% 0; + transform-origin: 50% 0; +} + +.tippy-popper[x-placement^='left'] [x-circle].enter { + -webkit-transform: scale(1) translate(-50%, -50%); + transform: scale(1) translate(-50%, -50%); + opacity: 1; +} + +.tippy-popper[x-placement^='left'] [x-circle].leave { + -webkit-transform: scale(0.15) translate(-50%, -50%); + transform: scale(0.15) translate(-50%, -50%); + opacity: 0; +} + +.tippy-popper[x-placement^='left'] .tippy-tooltip.light-theme [x-circle] { + background-color: #fff; +} + +.tippy-popper[x-placement^='left'] .tippy-tooltip.light-theme [x-arrow] { + border-left: 7px solid #fff; + border-top: 7px solid transparent; + border-bottom: 7px solid transparent; +} + +.tippy-popper[x-placement^='left'] .tippy-tooltip.light-theme [x-arrow].arrow-small { + border-left: 5px solid #fff; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; +} + +.tippy-popper[x-placement^='left'] .tippy-tooltip.light-theme [x-arrow].arrow-big { + border-left: 10px solid #fff; + border-top: 10px solid transparent; + border-bottom: 10px solid transparent; +} + +.tippy-popper[x-placement^='left'] .tippy-tooltip.transparent-theme [x-circle] { + background-color: rgba(0, 0, 0, 0.7); +} + +.tippy-popper[x-placement^='left'] .tippy-tooltip.transparent-theme [x-arrow] { + border-left: 7px solid rgba(0, 0, 0, 0.7); + border-top: 7px solid transparent; + border-bottom: 7px solid transparent; +} + +.tippy-popper[x-placement^='left'] .tippy-tooltip.transparent-theme [x-arrow].arrow-small { + border-left: 5px solid rgba(0, 0, 0, 0.7); + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; +} + +.tippy-popper[x-placement^='left'] .tippy-tooltip.transparent-theme [x-arrow].arrow-big { + border-left: 10px solid rgba(0, 0, 0, 0.7); + border-top: 10px solid transparent; + border-bottom: 10px solid transparent; +} + +.tippy-popper[x-placement^='left'] [data-animation='perspective'] { + -webkit-transform-origin: right; + transform-origin: right; +} + +.tippy-popper[x-placement^='left'] [data-animation='perspective'].enter { + opacity: 1; + -webkit-transform: translateX(-10px) rotateY(0); + transform: translateX(-10px) rotateY(0); +} + +.tippy-popper[x-placement^='left'] [data-animation='perspective'].leave { + opacity: 0; + -webkit-transform: translateX(0) rotateY(-90deg); + transform: translateX(0) rotateY(-90deg); +} + +.tippy-popper[x-placement^='left'] [data-animation='fade'].enter { + opacity: 1; + -webkit-transform: translateX(-10px); + transform: translateX(-10px); +} + +.tippy-popper[x-placement^='left'] [data-animation='fade'].leave { + opacity: 0; + -webkit-transform: translateX(-10px); + transform: translateX(-10px); +} + +.tippy-popper[x-placement^='left'] [data-animation='shift'].enter { + opacity: 1; + -webkit-transform: translateX(-10px); + transform: translateX(-10px); +} + +.tippy-popper[x-placement^='left'] [data-animation='shift'].leave { + opacity: 0; + -webkit-transform: translateX(0); + transform: translateX(0); +} + +.tippy-popper[x-placement^='left'] [data-animation='scale'].enter { + opacity: 1; + -webkit-transform: translateX(-10px) scale(1); + transform: translateX(-10px) scale(1); +} + +.tippy-popper[x-placement^='left'] [data-animation='scale'].leave { + opacity: 0; + -webkit-transform: translateX(0) scale(0); + transform: translateX(0) scale(0); +} + +.tippy-popper[x-placement^='right'] [x-arrow] { + border-right: 7px solid #333; + border-top: 7px solid transparent; + border-bottom: 7px solid transparent; + left: -7px; + margin: 6px 0; +} + +.tippy-popper[x-placement^='right'] [x-arrow].arrow-small { + border-right: 5px solid #333; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + left: -5px; +} + +.tippy-popper[x-placement^='right'] [x-arrow].arrow-big { + border-right: 10px solid #333; + border-top: 10px solid transparent; + border-bottom: 10px solid transparent; + left: -10px; +} + +.tippy-popper[x-placement^='right'] [x-circle] { + -webkit-transform-origin: -50% 0; + transform-origin: -50% 0; +} + +.tippy-popper[x-placement^='right'] [x-circle].enter { + -webkit-transform: scale(1) translate(-50%, -50%); + transform: scale(1) translate(-50%, -50%); + opacity: 1; +} + +.tippy-popper[x-placement^='right'] [x-circle].leave { + -webkit-transform: scale(0.15) translate(-50%, -50%); + transform: scale(0.15) translate(-50%, -50%); + opacity: 0; +} + +.tippy-popper[x-placement^='right'] .tippy-tooltip.light-theme [x-circle] { + background-color: #fff; +} + +.tippy-popper[x-placement^='right'] .tippy-tooltip.light-theme [x-arrow] { + border-right: 7px solid #fff; + border-top: 7px solid transparent; + border-bottom: 7px solid transparent; +} + +.tippy-popper[x-placement^='right'] .tippy-tooltip.light-theme [x-arrow].arrow-small { + border-right: 5px solid #fff; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; +} + +.tippy-popper[x-placement^='right'] .tippy-tooltip.light-theme [x-arrow].arrow-big { + border-right: 10px solid #fff; + border-top: 10px solid transparent; + border-bottom: 10px solid transparent; +} + +.tippy-popper[x-placement^='right'] .tippy-tooltip.transparent-theme [x-circle] { + background-color: rgba(0, 0, 0, 0.7); +} + +.tippy-popper[x-placement^='right'] .tippy-tooltip.transparent-theme [x-arrow] { + border-right: 7px solid rgba(0, 0, 0, 0.7); + border-top: 7px solid transparent; + border-bottom: 7px solid transparent; +} + +.tippy-popper[x-placement^='right'] .tippy-tooltip.transparent-theme [x-arrow].arrow-small { + border-right: 5px solid rgba(0, 0, 0, 0.7); + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; +} + +.tippy-popper[x-placement^='right'] .tippy-tooltip.transparent-theme [x-arrow].arrow-big { + border-right: 10px solid rgba(0, 0, 0, 0.7); + border-top: 10px solid transparent; + border-bottom: 10px solid transparent; +} + +.tippy-popper[x-placement^='right'] [data-animation='perspective'] { + -webkit-transform-origin: left; + transform-origin: left; +} + +.tippy-popper[x-placement^='right'] [data-animation='perspective'].enter { + opacity: 1; + -webkit-transform: translateX(10px) rotateY(0); + transform: translateX(10px) rotateY(0); +} + +.tippy-popper[x-placement^='right'] [data-animation='perspective'].leave { + opacity: 0; + -webkit-transform: translateX(0) rotateY(90deg); + transform: translateX(0) rotateY(90deg); +} + +.tippy-popper[x-placement^='right'] [data-animation='fade'].enter { + opacity: 1; + -webkit-transform: translateX(10px); + transform: translateX(10px); +} + +.tippy-popper[x-placement^='right'] [data-animation='fade'].leave { + opacity: 0; + -webkit-transform: translateX(10px); + transform: translateX(10px); +} + +.tippy-popper[x-placement^='right'] [data-animation='shift'].enter { + opacity: 1; + -webkit-transform: translateX(10px); + transform: translateX(10px); +} + +.tippy-popper[x-placement^='right'] [data-animation='shift'].leave { + opacity: 0; + -webkit-transform: translateX(0); + transform: translateX(0); +} + +.tippy-popper[x-placement^='right'] [data-animation='scale'].enter { + opacity: 1; + -webkit-transform: translateX(10px) scale(1); + transform: translateX(10px) scale(1); +} + +.tippy-popper[x-placement^='right'] [data-animation='scale'].leave { + opacity: 0; + -webkit-transform: translateX(0) scale(0); + transform: translateX(0) scale(0); +} + +.tippy-popper .tippy-tooltip.transparent-theme { + background-color: rgba(0, 0, 0, 0.7); +} + +.tippy-popper .tippy-tooltip.transparent-theme[data-animatefill] { + background-color: transparent; +} + +.tippy-popper .tippy-tooltip.light-theme { + color: #26323d; + box-shadow: + 0 4px 20px 4px rgba(0, 20, 60, 0.1), + 0 4px 80px -8px rgba(0, 20, 60, 0.2); + background-color: #fff; +} + +.tippy-popper .tippy-tooltip.light-theme[data-animatefill] { + background-color: transparent; +} + +.tippy-tooltip { + position: relative; + color: #fff; + border-radius: 4px; + font-size: 0.95rem; + padding: 0.4rem 0.8rem; + text-align: center; + will-change: transform; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + background-color: #333; +} + +.tippy-tooltip--small { + padding: 0.25rem 0.5rem; + font-size: 0.8rem; +} + +.tippy-tooltip--big { + padding: 0.6rem 1.2rem; + font-size: 1.2rem; +} + +.tippy-tooltip[data-animatefill] { + overflow: hidden; + background-color: transparent; +} + +.tippy-tooltip[data-interactive] { + pointer-events: auto; +} + +.tippy-tooltip[data-inertia] { + transition-timing-function: cubic-bezier(0.53, 2, 0.36, 0.85); +} + +.tippy-tooltip [x-arrow] { + position: absolute; + width: 0; + height: 0; +} + +.tippy-tooltip [x-circle] { + position: absolute; + will-change: transform; + background-color: #333; + border-radius: 50%; + width: 130%; + width: calc(110% + 2rem); + left: 50%; + top: 50%; + z-index: -1; + overflow: hidden; + transition: all ease; +} + +.tippy-tooltip [x-circle]::before { + content: ''; + padding-top: 90%; + float: left; +} + +@media (max-width: 450px) { + .tippy-popper { + max-width: 96%; + max-width: calc(100% - 20px); + } +} diff --git a/development/verify-locale-strings.js b/development/verify-locale-strings.js old mode 100644 new mode 100755 index 04d889de5..26b01ad89 --- a/development/verify-locale-strings.js +++ b/development/verify-locale-strings.js @@ -1,3 +1,4 @@ +#!/usr/bin/env node // ////////////////////////////////////////////////////////////////////////////// // // Locale verification script @@ -95,6 +96,7 @@ async function main() { } } +// eslint-disable-next-line consistent-return async function writeLocale(code, locale) { try { const localeFilePath = getLocalePath(code); @@ -182,7 +184,8 @@ async function verifyEnglishLocale() { ignore: [testGlob], }); - const strictSearchRegex = /\bt\(\s*'(\w+)'\s*\)|\btranslationKey:\s*'(\w+)'/gu; + const strictSearchRegex = + /\bt\(\s*'(\w+)'\s*\)|\btranslationKey:\s*'(\w+)'/gu; // match "t(`...`)" because constructing message keys from template strings // prevents this script from finding the messages, and then inappropriately // deletes them diff --git a/docs/QA_Guide.md b/docs/QA_Guide.md index 0b7c0e023..dc5b94c40 100644 --- a/docs/QA_Guide.md +++ b/docs/QA_Guide.md @@ -5,7 +5,7 @@ Steps to mark a full pass of QA complete. * OS: Ubuntu, Mac OSX, Windows * Load older version of MetaMask and attempt to simulate updating the extension. * Open Developer Console in background and popup, inspect errors. -* Watch the state logs +* Watch the state logs * Transactions (unapproved txs -> rejected/submitted -> confirmed) * Nonces/LocalNonces * Vault integrity diff --git a/docs/QA_MIGRATIONS_GUIDE.md b/docs/QA_MIGRATIONS_GUIDE.md new file mode 100644 index 000000000..fbd2c38a1 --- /dev/null +++ b/docs/QA_MIGRATIONS_GUIDE.md @@ -0,0 +1,20 @@ +### QA Migrations Guide +Migrations are needed to change top-level state data, this can be found in the browser's storage. This can look like removing specific keys/value pairs from state, changing objects to an array of objects, changing the name of a controller, etc. + +Steps + 1. Create a new MetaMask directory\* folder locally with the source files before the migration, and load it as an unpacked extension in Chrome\*. If the migration is in a pull request, then build the `develop` branch to load. If the migration is already in `develop`, get a commit before the migration was added to build. + + ![Load unpacked extension to chrome](./assets/load-build-chrome.gif) + + ##### \* For migrations targeting specific features behind a feature flag add them appropriately to the `.metamaskrc` file before building. + ##### \* In order for the "Load unpacked" button to be shown developer mode needs to be enabled. + + 2. Once the build has been loaded and state data has been initialized, ensure that the data in question that the migration targets is present in the local storage data. + + ![Chrome storage state](./assets/chrome-storage-local.png) + + 3. To trigger the migration a build with the migration will need to replace the files in the directory where the extension is loaded from, and refresh the extension. + + ![gif of replacing files and reloading the extension](./assets/folder-file-replacement-build.gif) + + 4. Ensure that the data has been changed/deleted/etc. diff --git a/docs/assets/chrome-storage-local.png b/docs/assets/chrome-storage-local.png new file mode 100755 index 000000000..20d7bbcd5 Binary files /dev/null and b/docs/assets/chrome-storage-local.png differ diff --git a/docs/assets/folder-file-replacement-build.gif b/docs/assets/folder-file-replacement-build.gif new file mode 100755 index 000000000..77c533a6e Binary files /dev/null and b/docs/assets/folder-file-replacement-build.gif differ diff --git a/docs/assets/load-build-chrome.gif b/docs/assets/load-build-chrome.gif new file mode 100755 index 000000000..eb7274450 Binary files /dev/null and b/docs/assets/load-build-chrome.gif differ diff --git a/docs/components/account-menu.md b/docs/components/account-menu.md index 464616b75..b65a99360 100644 --- a/docs/components/account-menu.md +++ b/docs/components/account-menu.md @@ -8,13 +8,9 @@ The account menu is the popup menu which contains options such as: - Connecting a HW wallet - Looking up info & help - Adjusting settings - + It can be seen below where it has been outlined with a red box - - ![Screenshot of account menu](https://i.imgur.com/xpkfIuR.png) - - Above screenshot showing the menu bar in MetaMask 6.7.1 - - + ![Screenshot of account menu](https://i.imgur.com/xpkfIuR.png) + Above screenshot showing the menu bar in MetaMask 6.7.1 diff --git a/docs/extension_description/en.txt b/docs/extension_description/en.txt index b52d476cc..d2956d21b 100644 --- a/docs/extension_description/en.txt +++ b/docs/extension_description/en.txt @@ -5,4 +5,4 @@ The extension injects the Ethereum web3 API into every website's javascript cont MetaMask also lets the user create and manage their own identities, so when a Dapp wants to perform a transaction and write to the blockchain, the user gets a secure interface to review the transaction, before approving or rejecting it. Because it adds functionality to the normal browser context, MetaMask requires the permission to read and write to any webpage. You can always "view the source" of MetaMask the way you do any extension, or view the source code on Github: -https://github.com/MetaMask/metamask-extension \ No newline at end of file +https://github.com/MetaMask/metamask-extension diff --git a/docs/publishing.md b/docs/publishing.md index 17192ee8a..fdf1ab185 100644 --- a/docs/publishing.md +++ b/docs/publishing.md @@ -54,4 +54,3 @@ For this reason, when an urgent change is needed in production, its pull request - Should be proposed against the `master` branch. The version and changelog bump should then be made off the `master` branch, and then merged to `develop` to bring the two branches back into sync. Further time can be saved by incorporating the version/changelog bump into the PR against `master`, since we rely on @MetaMaskBot to run tests before merging. - diff --git a/docs/secret-preferences.md b/docs/secret-preferences.md index 58a4554c4..e9c79ca64 100644 --- a/docs/secret-preferences.md +++ b/docs/secret-preferences.md @@ -7,4 +7,3 @@ One example is our "sync with mobile" feature, which didn't make sense to roll o To enable features like this, first open the background console, and then you can use the global method `global.setPreference(key, value)`. For example, if the feature flag was a boolean was called `useNativeCurrencyAsPrimaryCurrency`, you might type `setPreference('useNativeCurrencyAsPrimaryCurrency', true)`. - diff --git a/docs/sensitive-release.md b/docs/sensitive-release.md index 1ebae3932..5c8675f89 100644 --- a/docs/sensitive-release.md +++ b/docs/sensitive-release.md @@ -39,4 +39,3 @@ If a problem is detected, publish the roll-back release to 100% of users, identi ## Summary This protocol is a worst-case scenario, just a way to be incredibly careful about our most sensitive possible changes. - diff --git a/docs/translating-guide.md b/docs/translating-guide.md index 684316e4f..07a37c948 100644 --- a/docs/translating-guide.md +++ b/docs/translating-guide.md @@ -7,10 +7,10 @@ The MetaMask browser extension supports new translations added in the form of ne ## Adding a new Language - Each supported language is represented by a folder in `app/_locales` whose name is that language's subtag (example: `app/_locales/es/`). (look up a language subtag using the [r12a "Find" tool](https://r12a.github.io/app-subtags/) or this [wikipedia list](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)). -- Inside that folder there should be a `messages.json`. +- Inside that folder there should be a `messages.json`. - An easy way to start your translation is to first **make a copy** of `app/_locales/en/messages.json` (the English translation), and then **translate the `message` key** for each in-app message. - **The `description` key** is just to add context for what the translation is about, it **does not need to be translated**. -- Add the language to the [locales index](https://github.com/MetaMask/metamask-extension/blob/master/app/_locales/index.json) `app/_locales/index.json` +- Add the language to the [locales index](https://github.com/MetaMask/metamask-extension/blob/master/app/_locales/index.json) `app/_locales/index.json` That's it! When MetaMask is loaded on a computer with that language set as the system language, they will see your translation instead of the default one. @@ -26,4 +26,3 @@ node development/verify-locale-strings.js $YOUR_LOCALE Where `$YOUR_LOCALE` is your locale string (example: `es`), i.e. the name of your language folder. To verify that your translation works in the app, you will need to [build a local copy](https://github.com/MetaMask/metamask-extension#building-locally) of MetaMask. You will need to change your browser language, your operating system language, and restart your browser (sorry it's so much work!). - diff --git a/jest.config.js b/jest.config.js index ad12bb85b..06d275fb8 100644 --- a/jest.config.js +++ b/jest.config.js @@ -44,8 +44,19 @@ module.exports = { '/app/scripts/lib/createRPCMethodTrackingMiddleware.test.js', ], testTimeout: 2500, - transform: { - '^.+\\.[tj]sx?$': 'babel-jest', - '^.+\\.mdx$': '@storybook/addon-docs/jest-transform-mdx', - }, + // We have to specify the environment we are running in, which is jsdom. The + // default is 'node'. This can be modified *per file* using a comment at the + // head of the file. So it may be worth while to switch to 'node' in any + // background tests. + testEnvironment: 'jsdom', + // Our configuration somehow is calling into the esm folder / files of + // some modules. Jest supports ESM but our code is not set to emit ESM files + // so we are telling jest to use babel to transform the node_modules listed. + // Note: for some reason I could not hammer down to the node_modules + // installed in @metamask/controllers so I had to just blanket specify all + // of the @metamask/controllers folder. + transformIgnorePatterns: [ + '/node_modules/(?!(multiformats|uuid|nanoid|@metamask/controllers|@metamask/snap-controllers)/)', + ], + workerIdleMemoryLimit: '500MB', }; diff --git a/jest.stories.config.js b/jest.stories.config.js index fa66332a3..dd4d5a6cf 100644 --- a/jest.stories.config.js +++ b/jest.stories.config.js @@ -13,4 +13,5 @@ module.exports = { '^.+\\.[tj]sx?$': 'babel-jest', '^.+\\.mdx$': '@storybook/addon-docs/jest-transform-mdx', }, + testEnvironment: 'jsdom', }; diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 2ed8c9610..cf8538172 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -61,11 +61,11 @@ }, "packages": { "3box>3box-orbitdb-plugins>ipfs-log>json-stringify-deterministic": true, + "3box>3box-orbitdb-plugins>ipfs-log>p-each-series": true, "3box>3box-orbitdb-plugins>ipfs-log>p-map": true, "3box>3box-orbitdb-plugins>ipfs-log>p-whilst": true, "3box>orbit-db>orbit-db-io": true, - "browserify>buffer": true, - "jest>@jest/core>p-each-series": true + "browserify>buffer": true } }, "3box>3id-resolver": { @@ -209,7 +209,6 @@ "setTimeout": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>async-iterator-all": true, "3box>ipfs>async-iterator-to-pull-stream": true, "3box>ipfs>async-iterator-to-stream": true, @@ -288,7 +287,8 @@ "browserify>events": true, "browserify>insert-module-globals>is-buffer": true, "browserify>timers-browserify": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs-mini": { @@ -305,17 +305,6 @@ "nanoid": true } }, - "3box>ipfs>async": { - "globals": { - "clearTimeout": true, - "setTimeout": true - }, - "packages": { - "browserify>process": true, - "browserify>timers-browserify": true, - "lodash": true - } - }, "3box>ipfs>async-iterator-to-pull-stream": { "packages": { "3box>ipfs>async-iterator-to-pull-stream>get-iterator": true, @@ -385,11 +374,11 @@ }, "3box>ipfs>datastore-core": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>datastore-core>pull-many": true, "3box>ipfs>interface-datastore": true, "3box>ipfs>pull-stream": true, - "browserify>buffer": true + "browserify>buffer": true, + "gh-pages>async": true } }, "3box>ipfs>datastore-pubsub": { @@ -399,7 +388,7 @@ "3box>ipfs>multibase": true, "browserify>assert": true, "browserify>buffer": true, - "eslint>debug": true + "madge>debug": true } }, "3box>ipfs>dlv": { @@ -421,7 +410,6 @@ }, "3box>ipfs>interface-datastore": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>class-is": true, "3box>ipfs>err-code": true, "3box>ipfs>interface-datastore>uuid": true, @@ -429,7 +417,8 @@ "3box>ipfs>pull-stream": true, "browserify>buffer": true, "browserify>os-browserify": true, - "browserify>path-browserify": true + "browserify>path-browserify": true, + "gh-pages>async": true } }, "3box>ipfs>interface-datastore>uuid": { @@ -446,7 +435,6 @@ "setTimeout": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>cids": true, "3box>ipfs>ipfs-bitswap>bignumber.js": true, "3box>ipfs>ipfs-bitswap>just-debounce-it": true, @@ -461,7 +449,8 @@ "3box>ipfs>pull-stream": true, "browserify>assert": true, "browserify>events": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs>ipfs-bitswap>bignumber.js": { @@ -506,7 +495,7 @@ }, "3box>ipfs>ipfs-block-service": { "packages": { - "3box>ipfs>async": true + "gh-pages>async": true } }, "3box>ipfs>ipfs-mfs": { @@ -531,7 +520,7 @@ "browserify>assert": true, "browserify>browser-resolve": true, "browserify>buffer": true, - "eslint>debug": true + "madge>debug": true } }, "3box>ipfs>ipfs-mfs>hamt-sharding": { @@ -562,7 +551,6 @@ }, "3box>ipfs>ipfs-repo": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>base32.js": true, "3box>ipfs>cids": true, "3box>ipfs>datastore-core": true, @@ -578,7 +566,8 @@ "browserify>buffer": true, "browserify>path-browserify": true, "browserify>timers-browserify": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs>ipfs-repo>bignumber.js": { @@ -699,7 +688,7 @@ "3box>ipfs>multihashes": true, "3box>ipfs>superstruct": true, "browserify>buffer": true, - "rc>deep-extend": true + "madge>rc>deep-extend": true } }, "3box>ipfs>ipfs-unixfs-importer>rabin-wasm": { @@ -822,7 +811,7 @@ "3box>ipfs>protons": true, "base32-encode": true, "browserify>buffer": true, - "eslint>debug": true + "madge>debug": true } }, "3box>ipfs>is-ipfs": { @@ -845,7 +834,6 @@ }, "3box>ipfs>libp2p": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>err-code": true, "3box>ipfs>fsm-event": true, "3box>ipfs>libp2p-websockets": true, @@ -861,7 +849,8 @@ "browserify>events": true, "browserify>insert-module-globals>is-buffer": true, "browserify>process": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -871,13 +860,13 @@ "setInterval": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>mafmt": true, "3box>ipfs>multiaddr": true, "3box>ipfs>peer-id": true, "3box>ipfs>peer-info": true, "browserify>events": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs>libp2p-crypto": { @@ -886,7 +875,6 @@ "msCrypto": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>bs58": true, "3box>ipfs>libp2p-crypto>asn1.js": true, "3box>ipfs>libp2p-crypto>iso-random-stream": true, @@ -896,6 +884,7 @@ "3box>tweetnacl": true, "browserify>buffer": true, "ethereumjs-util>ethereum-cryptography>browserify-aes": true, + "gh-pages>async": true, "mockttp>node-forge": true } }, @@ -918,10 +907,10 @@ }, "3box>ipfs>libp2p-crypto>libp2p-crypto-secp256k1": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>bs58": true, "3box>ipfs>libp2p-crypto>libp2p-crypto-secp256k1>multihashing-async": true, - "eth-trezor-keyring>hdkey>secp256k1": true + "eth-trezor-keyring>hdkey>secp256k1": true, + "gh-pages>async": true } }, "3box>ipfs>libp2p-crypto>libp2p-crypto-secp256k1>multihashing-async": { @@ -962,7 +951,6 @@ "setTimeout": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>base32.js": true, "3box>ipfs>cids": true, "3box>ipfs>err-code": true, @@ -990,7 +978,8 @@ "browserify>buffer": true, "browserify>events": true, "browserify>insert-module-globals>is-buffer": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "promise-to-callback": true } }, @@ -1045,7 +1034,6 @@ "setTimeout": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>err-code": true, "3box>ipfs>interface-datastore": true, "3box>ipfs>libp2p-crypto": true, @@ -1053,6 +1041,7 @@ "3box>ipfs>merge-options": true, "3box>ipfs>pull-stream": true, "browserify>buffer": true, + "gh-pages>async": true, "mockttp>node-forge": true } }, @@ -1068,14 +1057,14 @@ }, "3box>ipfs>libp2p-record": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>err-code": true, "3box>ipfs>libp2p-record>buffer-split": true, "3box>ipfs>libp2p-record>multihashing-async": true, "3box>ipfs>protons": true, "browserify>assert": true, "browserify>buffer": true, - "browserify>insert-module-globals>is-buffer": true + "browserify>insert-module-globals>is-buffer": true, + "gh-pages>async": true } }, "3box>ipfs>libp2p-record>buffer-split": { @@ -1100,7 +1089,6 @@ }, "3box>ipfs>libp2p-secio": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>libp2p-crypto": true, "3box>ipfs>libp2p-secio>multihashing-async": true, "3box>ipfs>libp2p-secio>pull-handshake": true, @@ -1113,7 +1101,8 @@ "3box>ipfs>pull-stream": true, "browserify>assert": true, "browserify>buffer": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -1160,7 +1149,6 @@ }, "3box>ipfs>libp2p-webrtc-star": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>class-is": true, "3box>ipfs>libp2p-webrtc-star>simple-peer": true, "3box>ipfs>libp2p-webrtc-star>socket.io-client": true, @@ -1172,7 +1160,8 @@ "3box>ipfs>pull-mplex>interface-connection": true, "3box>ipfs>stream-to-pull-stream": true, "browserify>events": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -1187,8 +1176,8 @@ "3box>ipfs>libp2p-webrtc-star>simple-peer>get-browser-rtc": true, "3box>ipfs>libp2p-webrtc-star>simple-peer>readable-stream": true, "browserify>buffer": true, - "eslint>debug": true, "ethereumjs-wallet>randombytes": true, + "madge>debug": true, "pumpify>inherits": true } }, @@ -1383,12 +1372,12 @@ "setTimeout": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>libp2p-websocket-star-multi>libp2p-websocket-star": true, "3box>ipfs>mafmt": true, "3box>ipfs>multiaddr": true, "browserify>events": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -1397,7 +1386,6 @@ "console.error": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>class-is": true, "3box>ipfs>libp2p-crypto": true, "3box>ipfs>libp2p-webrtc-star>socket.io-client": true, @@ -1410,7 +1398,8 @@ "3box>ipfs>pull-stream": true, "browserify>buffer": true, "browserify>events": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true, "uuid": true } @@ -1460,7 +1449,7 @@ "3box>ipfs>multiaddr-to-uri": true, "3box>ipfs>pull-mplex>interface-connection": true, "browserify>os-browserify": true, - "eslint>debug": true + "madge>debug": true } }, "3box>ipfs>libp2p-websockets>pull-ws": { @@ -1489,7 +1478,7 @@ "packages": { "3box>ipfs>libp2p>libp2p-connection-manager>latency-monitor": true, "browserify>events": true, - "eslint>debug": true + "madge>debug": true } }, "3box>ipfs>libp2p>libp2p-connection-manager>latency-monitor": { @@ -1524,17 +1513,16 @@ }, "3box>ipfs>libp2p>libp2p-floodsub": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>libp2p-secio>pull-length-prefixed": true, "3box>ipfs>libp2p>libp2p-floodsub>libp2p-pubsub": true, "3box>ipfs>pull-stream": true, "browserify>assert": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs>libp2p>libp2p-floodsub>libp2p-pubsub": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>bs58": true, "3box>ipfs>err-code": true, "3box>ipfs>libp2p-crypto": true, @@ -1546,7 +1534,8 @@ "browserify>buffer": true, "browserify>events": true, "browserify>insert-module-globals>is-buffer": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs>libp2p>libp2p-floodsub>libp2p-pubsub>time-cache": { @@ -1566,12 +1555,11 @@ "3box>ipfs>libp2p-secio>pull-handshake": true, "3box>ipfs>pull-stream": true, "browserify>events": true, - "eslint>debug": true + "madge>debug": true } }, "3box>ipfs>libp2p>libp2p-switch": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>class-is": true, "3box>ipfs>err-code": true, "3box>ipfs>fsm-event": true, @@ -1589,7 +1577,8 @@ "3box>ipfs>pull-stream": true, "browserify>assert": true, "browserify>events": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -1601,7 +1590,6 @@ }, "3box>ipfs>libp2p>libp2p-switch>libp2p-circuit": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>libp2p-secio>pull-handshake": true, "3box>ipfs>libp2p-secio>pull-length-prefixed": true, "3box>ipfs>mafmt": true, @@ -1612,7 +1600,8 @@ "3box>ipfs>pull-mplex>interface-connection": true, "3box>ipfs>pull-stream": true, "browserify>events": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -1632,7 +1621,6 @@ }, "3box>ipfs>libp2p>libp2p-switch>multistream-select": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>err-code": true, "3box>ipfs>libp2p-secio>pull-handshake": true, "3box>ipfs>libp2p-secio>pull-length-prefixed": true, @@ -1642,7 +1630,8 @@ "3box>ipfs>varint": true, "browserify>assert": true, "browserify>buffer": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -1774,12 +1763,12 @@ }, "3box>ipfs>peer-id": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>class-is": true, "3box>ipfs>libp2p-crypto": true, "3box>ipfs>multihashes": true, "browserify>assert": true, - "browserify>buffer": true + "browserify>buffer": true, + "gh-pages>async": true } }, "3box>ipfs>peer-info": { @@ -1807,7 +1796,6 @@ }, "3box>ipfs>pull-mplex": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>pull-abortable": true, "3box>ipfs>pull-mplex>interface-connection": true, "3box>ipfs>pull-mplex>looper": true, @@ -1817,7 +1805,8 @@ "3box>ipfs>varint": true, "browserify>buffer": true, "browserify>events": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs>pull-mplex>interface-connection": { @@ -2201,8 +2190,8 @@ } }, "@babel/runtime": { - "packages": { - "@storybook/api>regenerator-runtime": true + "globals": { + "regeneratorRuntime": "write" } }, "@download/blockies": { @@ -2318,8 +2307,7 @@ }, "@eth-optimism/contracts": { "packages": { - "ethers": true, - "ethers>@ethersproject/abstract-provider": true + "ethers": true } }, "@ethereumjs/common": { @@ -2655,10 +2643,10 @@ "@metamask/controllers>nanoid": true, "@metamask/controllers>web3-provider-engine": true, "@metamask/metamask-eth-abis": true, - "@storybook/api>fast-deep-equal": true, "browserify>buffer": true, "browserify>events": true, "deep-freeze-strict": true, + "eslint>fast-deep-equal": true, "eth-ens-namehash": true, "eth-json-rpc-infura": true, "eth-keyring-controller": true, @@ -2824,7 +2812,6 @@ "setTimeout": true }, "packages": { - "3box>ipfs>async": true, "@ethereumjs/tx": true, "@metamask/controllers>web3-provider-engine>backoff": true, "@metamask/controllers>web3-provider-engine>eth-block-tracker": true, @@ -2838,6 +2825,7 @@ "browserify>util": true, "eth-json-rpc-filters": true, "eth-json-rpc-infura": true, + "gh-pages>async": true, "lavamoat>json-stable-stringify": true, "watchify>xtend": true } @@ -3168,884 +3156,146 @@ "watchify>xtend": true } }, - "@metamask/post-message-stream": { - "globals": { - "addEventListener": true, - "location.origin": true, - "onmessage": "write", - "postMessage": true, - "removeEventListener": true - }, - "packages": { - "@metamask/post-message-stream>readable-stream": true - } - }, - "@metamask/post-message-stream>readable-stream": { - "packages": { - "@metamask/post-message-stream>readable-stream>safe-buffer": true, - "@metamask/post-message-stream>readable-stream>string_decoder": true, - "@storybook/api>util-deprecate": true, - "browserify>browser-resolve": true, - "browserify>events": true, - "browserify>process": true, - "browserify>timers-browserify": true, - "pumpify>inherits": true, - "readable-stream>core-util-is": true, - "readable-stream>isarray": true, - "vinyl>cloneable-readable>process-nextick-args": true - } - }, - "@metamask/post-message-stream>readable-stream>safe-buffer": { - "packages": { - "browserify>buffer": true - } - }, - "@metamask/post-message-stream>readable-stream>string_decoder": { - "packages": { - "@metamask/post-message-stream>readable-stream>safe-buffer": true - } - }, - "@metamask/providers>@metamask/object-multiplex": { - "globals": { - "console.warn": true - }, - "packages": { - "end-of-stream": true, - "pump>once": true, - "readable-stream": true - } - }, - "@metamask/rpc-methods": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers": true, - "@metamask/rpc-methods>@metamask/key-tree": true, - "@metamask/rpc-methods>@metamask/utils": true, - "@metamask/snap-controllers": true, - "eth-rpc-errors": true - } - }, - "@metamask/rpc-methods>@metamask/controllers": { + "@metamask/smart-transactions-controller": { "globals": { - "Headers": true, - "URL": true, + "URLSearchParams": true, "clearInterval": true, - "clearTimeout": true, "console.error": true, "console.log": true, "fetch": true, - "setInterval": true, - "setTimeout": true + "setInterval": true }, "packages": { - "@ethereumjs/common": true, - "@ethereumjs/tx": true, - "@metamask/contract-metadata": true, - "@metamask/controllers>abort-controller": true, - "@metamask/controllers>async-mutex": true, - "@metamask/controllers>eth-phishing-detect": true, + "@metamask/controllers": true, "@metamask/controllers>isomorphic-fetch": true, - "@metamask/controllers>multiformats": true, - "@metamask/controllers>web3-provider-engine": true, - "@metamask/metamask-eth-abis": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry": true, - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet": true, - "@metamask/rpc-methods>@metamask/controllers>nanoid": true, - "@storybook/api>fast-deep-equal": true, - "browserify>buffer": true, - "browserify>events": true, - "deep-freeze-strict": true, - "eth-ens-namehash": true, - "eth-json-rpc-infura": true, - "eth-keyring-controller": true, - "eth-query": true, - "eth-rpc-errors": true, - "eth-sig-util": true, - "ethereumjs-util": true, + "@metamask/smart-transactions-controller>bignumber.js": true, + "@metamask/smart-transactions-controller>fast-json-patch": true, "ethers": true, - "ethjs>ethjs-unit": true, - "immer": true, - "json-rpc-engine": true, - "jsonschema": true, - "punycode": true, - "single-call-balance-checker-abi": true, - "uuid": true, - "web3": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs": true + "lodash": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs": { + "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { "globals": { - "clearInterval": true, - "setInterval": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-provider-http": true, - "ethjs>ethjs-unit": true, - "ethjs>ethjs-util": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "ethjs-query>babel-runtime": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-util": true, - "promise-to-callback": true + "crypto.getRandomValues": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>number-to-bn": true + "@metamask/smart-transactions-controller>bignumber.js": { + "globals": { + "crypto": true, + "define": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { + "@metamask/smart-transactions-controller>fast-json-patch": { "globals": { - "console": true - }, - "packages": { - "ethjs-query>babel-runtime": true, - "ethjs-query>ethjs-format": true, - "ethjs-query>ethjs-rpc": true, - "promise-to-callback": true + "addEventListener": true, + "clearTimeout": true, + "removeEventListener": true, + "setTimeout": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": { - "packages": { - "browserify>process": true + "@metamask/snap-controllers>nanoid": { + "globals": { + "crypto.getRandomValues": true } }, - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet": { + "@ngraveio/bc-ur": { "packages": { - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": true, - "@truffle/codec>utf8": true, + "@ngraveio/bc-ur>@apocentre/alias-sampling": true, + "@ngraveio/bc-ur>bignumber.js": true, + "@ngraveio/bc-ur>crc": true, + "@ngraveio/bc-ur>jsbi": true, + "addons-linter>sha.js": true, + "browserify>assert": true, "browserify>buffer": true, - "browserify>crypto-browserify": true, - "ethereumjs-util": true, - "ethereumjs-util>ethereum-cryptography": true, - "ethereumjs-wallet>aes-js": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, - "ethers>@ethersproject/json-wallets>scrypt-js": true + "pubnub>cbor-sync": true } }, - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": { + "@ngraveio/bc-ur>bignumber.js": { "globals": { "crypto": true, - "msCrypto": true + "define": true } }, - "@metamask/rpc-methods>@metamask/key-tree": { + "@ngraveio/bc-ur>crc": { "packages": { - "@metamask/rpc-methods>@metamask/key-tree>@noble/ed25519": true, - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, - "@metamask/rpc-methods>@metamask/key-tree>@noble/secp256k1": true, - "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true, - "@metamask/rpc-methods>@metamask/key-tree>@scure/bip39": true, "browserify>buffer": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@noble/ed25519": { + "@ngraveio/bc-ur>jsbi": { "globals": { - "crypto": true - }, - "packages": { - "browserify>browser-resolve": true + "define": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": { + "@popperjs/core": { "globals": { - "TextEncoder": true, - "crypto": true, - "setTimeout": true + "Element": true, + "HTMLElement": true, + "ShadowRoot": true, + "console.error": true, + "console.warn": true, + "document": true, + "navigator.userAgent": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@noble/secp256k1": { + "@reduxjs/toolkit": { "globals": { - "crypto": true + "AbortController": true, + "__REDUX_DEVTOOLS_EXTENSION_COMPOSE__": true, + "__REDUX_DEVTOOLS_EXTENSION__": true, + "console.error": true, + "console.info": true, + "console.warn": true }, "packages": { - "browserify>browser-resolve": true + "@reduxjs/toolkit>reselect": true, + "immer": true, + "redux": true, + "redux-thunk": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@scure/base": { + "@sentry/browser": { "globals": { - "TextDecoder": true, - "TextEncoder": true - } - }, - "@metamask/rpc-methods>@metamask/key-tree>@scure/bip39": { + "XMLHttpRequest": true, + "setTimeout": true + }, "packages": { - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, - "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true + "@sentry/browser>@sentry/core": true, + "@sentry/types": true, + "@sentry/utils": true, + "@sentry/utils>tslib": true } }, - "@metamask/rpc-methods>@metamask/utils": { + "@sentry/browser>@sentry/core": { + "globals": { + "clearInterval": true, + "setInterval": true + }, "packages": { - "@storybook/api>fast-deep-equal": true + "@sentry/browser>@sentry/core>@sentry/hub": true, + "@sentry/browser>@sentry/core>@sentry/minimal": true, + "@sentry/types": true, + "@sentry/utils": true, + "@sentry/utils>tslib": true } }, - "@metamask/smart-transactions-controller": { + "@sentry/browser>@sentry/core>@sentry/hub": { "globals": { - "URLSearchParams": true, "clearInterval": true, - "console.error": true, - "console.log": true, - "fetch": true, "setInterval": true }, "packages": { - "@metamask/controllers>isomorphic-fetch": true, - "@metamask/smart-transactions-controller>@metamask/controllers": true, - "@metamask/smart-transactions-controller>bignumber.js": true, - "@metamask/smart-transactions-controller>fast-json-patch": true, - "ethers": true, - "lodash": true + "@sentry/types": true, + "@sentry/utils": true, + "@sentry/utils>tslib": true + } + }, + "@sentry/browser>@sentry/core>@sentry/minimal": { + "packages": { + "@sentry/browser>@sentry/core>@sentry/hub": true, + "@sentry/utils>tslib": true } }, - "@metamask/smart-transactions-controller>@metamask/controllers": { - "globals": { - "Headers": true, - "URL": true, - "clearInterval": true, - "clearTimeout": true, - "console.error": true, - "console.log": true, - "fetch": true, - "setInterval": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/common": true, - "@ethereumjs/tx": true, - "@metamask/contract-metadata": true, - "@metamask/controllers>abort-controller": true, - "@metamask/controllers>async-mutex": true, - "@metamask/controllers>eth-phishing-detect": true, - "@metamask/controllers>isomorphic-fetch": true, - "@metamask/controllers>multiformats": true, - "@metamask/controllers>web3-provider-engine": true, - "@metamask/metamask-eth-abis": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": true, - "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": true, - "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": true, - "@storybook/api>fast-deep-equal": true, - "browserify>buffer": true, - "browserify>events": true, - "deep-freeze-strict": true, - "eth-ens-namehash": true, - "eth-json-rpc-infura": true, - "eth-keyring-controller": true, - "eth-query": true, - "eth-rpc-errors": true, - "eth-sig-util": true, - "ethereumjs-util": true, - "ethers": true, - "ethjs>ethjs-unit": true, - "immer": true, - "json-rpc-engine": true, - "jsonschema": true, - "punycode": true, - "single-call-balance-checker-abi": true, - "uuid": true, - "web3": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": { - "packages": { - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": { - "globals": { - "clearInterval": true, - "setInterval": true - }, - "packages": { - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-provider-http": true, - "ethjs>ethjs-unit": true, - "ethjs>ethjs-util": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { - "packages": { - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { - "packages": { - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "ethjs-query>babel-runtime": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-util": true, - "promise-to-callback": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { - "packages": { - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { - "globals": { - "console": true - }, - "packages": { - "ethjs-query>babel-runtime": true, - "ethjs-query>ethjs-format": true, - "ethjs-query>ethjs-rpc": true, - "promise-to-callback": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": { - "packages": { - "browserify>process": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": { - "packages": { - "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet>uuid": true, - "@truffle/codec>utf8": true, - "browserify>buffer": true, - "browserify>crypto-browserify": true, - "ethereumjs-util": true, - "ethereumjs-util>ethereum-cryptography": true, - "ethereumjs-wallet>aes-js": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, - "ethers>@ethersproject/json-wallets>scrypt-js": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet>uuid": { - "globals": { - "crypto": true, - "msCrypto": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { - "globals": { - "crypto.getRandomValues": true - } - }, - "@metamask/smart-transactions-controller>bignumber.js": { - "globals": { - "crypto": true, - "define": true - } - }, - "@metamask/smart-transactions-controller>fast-json-patch": { - "globals": { - "addEventListener": true, - "clearTimeout": true, - "removeEventListener": true, - "setTimeout": true - } - }, - "@metamask/snap-controllers": { - "globals": { - "URL": true, - "Worker": true, - "clearTimeout": true, - "console.error": true, - "console.info": true, - "console.log": true, - "console.warn": true, - "document.body.appendChild": true, - "document.createElement": true, - "document.getElementById": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@metamask/post-message-stream": true, - "@metamask/providers>@metamask/object-multiplex": true, - "@metamask/rpc-methods>@metamask/utils": true, - "@metamask/snap-controllers>@metamask/browser-passworder": true, - "@metamask/snap-controllers>@metamask/controllers": true, - "@metamask/snap-controllers>@metamask/execution-environments": true, - "@metamask/snap-controllers>@metamask/obs-store": true, - "@metamask/snap-controllers>ajv": true, - "@metamask/snap-controllers>concat-stream": true, - "@metamask/snap-controllers>gunzip-maybe": true, - "@metamask/snap-controllers>json-rpc-middleware-stream": true, - "@metamask/snap-controllers>nanoid": true, - "@metamask/snap-controllers>readable-web-to-node-stream": true, - "@metamask/snap-controllers>tar-stream": true, - "@storybook/api>fast-deep-equal": true, - "browserify>buffer": true, - "browserify>crypto-browserify": true, - "eth-rpc-errors": true, - "json-rpc-engine": true, - "json-rpc-engine>@metamask/safe-event-emitter": true, - "pump": true, - "semver": true - } - }, - "@metamask/snap-controllers>@metamask/browser-passworder": { - "globals": { - "btoa": true, - "crypto.getRandomValues": true, - "crypto.subtle.decrypt": true, - "crypto.subtle.deriveKey": true, - "crypto.subtle.encrypt": true, - "crypto.subtle.importKey": true - }, - "packages": { - "browserify>buffer": true - } - }, - "@metamask/snap-controllers>@metamask/controllers": { - "globals": { - "Headers": true, - "URL": true, - "clearInterval": true, - "clearTimeout": true, - "console.error": true, - "console.log": true, - "fetch": true, - "setInterval": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/common": true, - "@ethereumjs/tx": true, - "@metamask/contract-metadata": true, - "@metamask/controllers>abort-controller": true, - "@metamask/controllers>async-mutex": true, - "@metamask/controllers>eth-phishing-detect": true, - "@metamask/controllers>isomorphic-fetch": true, - "@metamask/controllers>multiformats": true, - "@metamask/controllers>web3-provider-engine": true, - "@metamask/metamask-eth-abis": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry": true, - "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet": true, - "@metamask/snap-controllers>nanoid": true, - "@storybook/api>fast-deep-equal": true, - "browserify>buffer": true, - "browserify>events": true, - "deep-freeze-strict": true, - "eth-ens-namehash": true, - "eth-json-rpc-infura": true, - "eth-keyring-controller": true, - "eth-query": true, - "eth-rpc-errors": true, - "eth-sig-util": true, - "ethereumjs-util": true, - "ethers": true, - "ethjs>ethjs-unit": true, - "immer": true, - "json-rpc-engine": true, - "jsonschema": true, - "punycode": true, - "single-call-balance-checker-abi": true, - "uuid": true, - "web3": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry": { - "packages": { - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs": { - "globals": { - "clearInterval": true, - "setInterval": true - }, - "packages": { - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-provider-http": true, - "ethjs>ethjs-unit": true, - "ethjs>ethjs-util": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { - "packages": { - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { - "packages": { - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "ethjs-query>babel-runtime": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-util": true, - "promise-to-callback": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { - "packages": { - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { - "globals": { - "console": true - }, - "packages": { - "ethjs-query>babel-runtime": true, - "ethjs-query>ethjs-format": true, - "ethjs-query>ethjs-rpc": true, - "promise-to-callback": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": { - "packages": { - "browserify>process": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet": { - "packages": { - "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet>uuid": true, - "@truffle/codec>utf8": true, - "browserify>buffer": true, - "browserify>crypto-browserify": true, - "ethereumjs-util": true, - "ethereumjs-util>ethereum-cryptography": true, - "ethereumjs-wallet>aes-js": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, - "ethers>@ethersproject/json-wallets>scrypt-js": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet>uuid": { - "globals": { - "crypto": true, - "msCrypto": true - } - }, - "@metamask/snap-controllers>@metamask/obs-store": { - "packages": { - "@metamask/snap-controllers>@metamask/obs-store>through2": true, - "browserify>stream-browserify": true, - "json-rpc-engine>@metamask/safe-event-emitter": true - } - }, - "@metamask/snap-controllers>@metamask/obs-store>through2": { - "packages": { - "browserify>process": true, - "browserify>util": true, - "readable-stream": true, - "watchify>xtend": true - } - }, - "@metamask/snap-controllers>ajv": { - "packages": { - "@storybook/api>fast-deep-equal": true - } - }, - "@metamask/snap-controllers>concat-stream": { - "packages": { - "@metamask/snap-controllers>concat-stream>readable-stream": true, - "browserify>buffer": true, - "pumpify>inherits": true - } - }, - "@metamask/snap-controllers>concat-stream>readable-stream": { - "packages": { - "@storybook/api>util-deprecate": true, - "browserify>browser-resolve": true, - "browserify>buffer": true, - "browserify>events": true, - "browserify>process": true, - "browserify>string_decoder": true, - "pumpify>inherits": true - } - }, - "@metamask/snap-controllers>gunzip-maybe": { - "packages": { - "@metamask/snap-controllers>gunzip-maybe>browserify-zlib": true, - "@metamask/snap-controllers>gunzip-maybe>is-deflate": true, - "@metamask/snap-controllers>gunzip-maybe>is-gzip": true, - "@metamask/snap-controllers>gunzip-maybe>peek-stream": true, - "@metamask/snap-controllers>gunzip-maybe>pumpify": true, - "@metamask/snap-controllers>gunzip-maybe>through2": true - } - }, - "@metamask/snap-controllers>gunzip-maybe>browserify-zlib": { - "packages": { - "@metamask/snap-controllers>gunzip-maybe>browserify-zlib>pako": true, - "browserify>assert": true, - "browserify>buffer": true, - "browserify>process": true, - "browserify>util": true, - "readable-stream": true - } - }, - "@metamask/snap-controllers>gunzip-maybe>peek-stream": { - "packages": { - "@metamask/snap-controllers>gunzip-maybe>peek-stream>duplexify": true, - "@metamask/snap-controllers>gunzip-maybe>peek-stream>through2": true, - "browserify>buffer": true, - "terser>source-map-support>buffer-from": true - } - }, - "@metamask/snap-controllers>gunzip-maybe>peek-stream>duplexify": { - "packages": { - "browserify>buffer": true, - "browserify>process": true, - "duplexify>stream-shift": true, - "end-of-stream": true, - "pumpify>inherits": true, - "readable-stream": true - } - }, - "@metamask/snap-controllers>gunzip-maybe>peek-stream>through2": { - "packages": { - "browserify>process": true, - "browserify>util": true, - "readable-stream": true, - "watchify>xtend": true - } - }, - "@metamask/snap-controllers>gunzip-maybe>pumpify": { - "packages": { - "@metamask/snap-controllers>gunzip-maybe>pumpify>duplexify": true, - "@metamask/snap-controllers>gunzip-maybe>pumpify>pump": true, - "pumpify>inherits": true - } - }, - "@metamask/snap-controllers>gunzip-maybe>pumpify>duplexify": { - "packages": { - "browserify>buffer": true, - "browserify>process": true, - "duplexify>stream-shift": true, - "end-of-stream": true, - "pumpify>inherits": true, - "readable-stream": true - } - }, - "@metamask/snap-controllers>gunzip-maybe>pumpify>pump": { - "packages": { - "browserify>browser-resolve": true, - "end-of-stream": true, - "pump>once": true - } - }, - "@metamask/snap-controllers>gunzip-maybe>through2": { - "packages": { - "browserify>process": true, - "browserify>util": true, - "readable-stream": true, - "watchify>xtend": true - } - }, - "@metamask/snap-controllers>json-rpc-middleware-stream": { - "globals": { - "setTimeout": true - }, - "packages": { - "json-rpc-engine>@metamask/safe-event-emitter": true, - "readable-stream": true - } - }, - "@metamask/snap-controllers>nanoid": { - "globals": { - "crypto.getRandomValues": true - } - }, - "@metamask/snap-controllers>readable-web-to-node-stream": { - "packages": { - "@metamask/snap-controllers>readable-web-to-node-stream>readable-stream": true - } - }, - "@metamask/snap-controllers>readable-web-to-node-stream>readable-stream": { - "packages": { - "@storybook/api>util-deprecate": true, - "browserify>browser-resolve": true, - "browserify>buffer": true, - "browserify>events": true, - "browserify>process": true, - "browserify>string_decoder": true, - "pumpify>inherits": true - } - }, - "@metamask/snap-controllers>tar-stream": { - "packages": { - "@metamask/snap-controllers>tar-stream>bl": true, - "@metamask/snap-controllers>tar-stream>fs-constants": true, - "@metamask/snap-controllers>tar-stream>readable-stream": true, - "browserify>buffer": true, - "browserify>process": true, - "browserify>string_decoder": true, - "browserify>util": true, - "end-of-stream": true, - "pumpify>inherits": true - } - }, - "@metamask/snap-controllers>tar-stream>bl": { - "packages": { - "@metamask/snap-controllers>tar-stream>readable-stream": true, - "browserify>buffer": true, - "pumpify>inherits": true - } - }, - "@metamask/snap-controllers>tar-stream>fs-constants": { - "packages": { - "browserify>constants-browserify": true - } - }, - "@metamask/snap-controllers>tar-stream>readable-stream": { - "packages": { - "@storybook/api>util-deprecate": true, - "browserify>browser-resolve": true, - "browserify>buffer": true, - "browserify>events": true, - "browserify>process": true, - "browserify>string_decoder": true, - "pumpify>inherits": true - } - }, - "@ngraveio/bc-ur": { - "packages": { - "@ngraveio/bc-ur>@apocentre/alias-sampling": true, - "@ngraveio/bc-ur>bignumber.js": true, - "@ngraveio/bc-ur>crc": true, - "@ngraveio/bc-ur>jsbi": true, - "addons-linter>sha.js": true, - "browserify>assert": true, - "browserify>buffer": true, - "pubnub>cbor-sync": true - } - }, - "@ngraveio/bc-ur>bignumber.js": { - "globals": { - "crypto": true, - "define": true - } - }, - "@ngraveio/bc-ur>crc": { - "packages": { - "browserify>buffer": true - } - }, - "@ngraveio/bc-ur>jsbi": { - "globals": { - "define": true - } - }, - "@popperjs/core": { - "globals": { - "Element": true, - "HTMLElement": true, - "ShadowRoot": true, - "console.error": true, - "console.warn": true, - "document": true, - "navigator.userAgent": true - } - }, - "@reduxjs/toolkit": { - "globals": { - "AbortController": true, - "__REDUX_DEVTOOLS_EXTENSION_COMPOSE__": true, - "__REDUX_DEVTOOLS_EXTENSION__": true, - "console.error": true, - "console.info": true, - "console.warn": true - }, - "packages": { - "@reduxjs/toolkit>reselect": true, - "immer": true, - "redux": true, - "redux-thunk": true - } - }, - "@sentry/browser": { - "globals": { - "XMLHttpRequest": true, - "setTimeout": true - }, - "packages": { - "@sentry/browser>@sentry/core": true, - "@sentry/types": true, - "@sentry/utils": true, - "@sentry/utils>tslib": true - } - }, - "@sentry/browser>@sentry/core": { - "globals": { - "clearInterval": true, - "setInterval": true - }, - "packages": { - "@sentry/browser>@sentry/core>@sentry/hub": true, - "@sentry/browser>@sentry/core>@sentry/minimal": true, - "@sentry/types": true, - "@sentry/utils": true, - "@sentry/utils>tslib": true - } - }, - "@sentry/browser>@sentry/core>@sentry/hub": { - "globals": { - "clearInterval": true, - "setInterval": true - }, - "packages": { - "@sentry/types": true, - "@sentry/utils": true, - "@sentry/utils>tslib": true - } - }, - "@sentry/browser>@sentry/core>@sentry/minimal": { - "packages": { - "@sentry/browser>@sentry/core>@sentry/hub": true, - "@sentry/utils>tslib": true - } - }, - "@sentry/integrations": { + "@sentry/integrations": { "globals": { "clearTimeout": true, "console.error": true, @@ -4086,6 +3336,24 @@ "define": true } }, + "@spruceid/siwe-parser": { + "globals": { + "console.error": true, + "console.log": true + }, + "packages": { + "@spruceid/siwe-parser>apg-js": true + } + }, + "@spruceid/siwe-parser>apg-js": { + "globals": { + "mode": true + }, + "packages": { + "browserify>buffer": true, + "browserify>insert-module-globals>is-buffer": true + } + }, "@storybook/api>regenerator-runtime": { "globals": { "regeneratorRuntime": "write" @@ -4117,8 +3385,8 @@ "@truffle/codec>web3-utils": true, "browserify>buffer": true, "browserify>util": true, - "eslint>debug": true, "gulp-dart-sass>lodash.clonedeep": true, + "madge>debug": true, "semver": true } }, @@ -4341,7 +3609,7 @@ "@truffle/codec>web3-utils": true, "@truffle/decoder>@truffle/source-map-utils": true, "@truffle/decoder>bn.js": true, - "eslint>debug": true + "madge>debug": true } }, "@truffle/decoder>@truffle/source-map-utils": { @@ -4351,7 +3619,7 @@ "@truffle/decoder>@truffle/source-map-utils>@truffle/code-utils": true, "@truffle/decoder>@truffle/source-map-utils>json-pointer": true, "@truffle/decoder>@truffle/source-map-utils>node-interval-tree": true, - "eslint>debug": true + "madge>debug": true } }, "@truffle/decoder>@truffle/source-map-utils>@truffle/code-utils": { @@ -4898,35 +4166,15 @@ }, "enzyme>is-regex": { "packages": { - "string.prototype.matchall>call-bind": true, - "string.prototype.matchall>has-symbols": true + "enzyme>is-regex>has-tostringtag": true, + "string.prototype.matchall>call-bind": true } }, - "eslint-plugin-react>array-includes>get-intrinsic": { - "globals": { - "AggregateError": true, - "FinalizationRegistry": true, - "WeakRef": true - }, + "enzyme>is-regex>has-tostringtag": { "packages": { - "enzyme>has": true, - "mocha>object.assign>function-bind": true, "string.prototype.matchall>has-symbols": true } }, - "eslint>debug": { - "globals": { - "console": true, - "document": true, - "localStorage": true, - "navigator": true, - "process": true - }, - "packages": { - "browserify>process": true, - "eslint>debug>ms": true - } - }, "eslint>optionator>fast-levenshtein": { "globals": { "Intl": true, @@ -6067,73 +5315,6 @@ "browserify>process": true } }, - "ethjs-ens": { - "packages": { - "ethereum-ens-network-map": true, - "ethjs-ens>eth-ens-namehash": true, - "ethjs-ens>ethjs-contract": true, - "ethjs-ens>ethjs-query": true - } - }, - "ethjs-ens>eth-ens-namehash": { - "globals": { - "name": "write" - }, - "packages": { - "browserify>buffer": true, - "ethjs-ens>eth-ens-namehash>idna-uts46": true, - "ethjs-ens>eth-ens-namehash>js-sha3": true - } - }, - "ethjs-ens>eth-ens-namehash>idna-uts46": { - "globals": { - "define": true - }, - "packages": { - "browserify>punycode": true - } - }, - "ethjs-ens>eth-ens-namehash>js-sha3": { - "packages": { - "browserify>process": true - } - }, - "ethjs-ens>ethjs-contract": { - "packages": { - "ethjs-contract>ethjs-abi": true, - "ethjs-ens>ethjs-contract>ethjs-filter": true, - "ethjs-ens>ethjs-contract>js-sha3": true, - "ethjs>ethjs-util": true - } - }, - "ethjs-ens>ethjs-contract>ethjs-filter": { - "globals": { - "clearInterval": true, - "setInterval": true - } - }, - "ethjs-ens>ethjs-contract>js-sha3": { - "packages": { - "browserify>process": true - } - }, - "ethjs-ens>ethjs-query": { - "globals": { - "console": true - }, - "packages": { - "ethjs-ens>ethjs-query>ethjs-format": true, - "ethjs-ens>ethjs-query>ethjs-rpc": true - } - }, - "ethjs-ens>ethjs-query>ethjs-format": { - "packages": { - "ethjs-ens>ethjs-query>ethjs-format>ethjs-schema": true, - "ethjs>ethjs-util": true, - "ethjs>ethjs-util>strip-hex-prefix": true, - "ethjs>number-to-bn": true - } - }, "ethjs-query": { "globals": { "console": true @@ -6250,11 +5431,28 @@ "define": true } }, + "gh-pages>async": { + "globals": { + "clearTimeout": true, + "setTimeout": true + }, + "packages": { + "browserify>process": true, + "browserify>timers-browserify": true, + "lodash": true + } + }, "globalthis>define-properties": { "packages": { + "globalthis>define-properties>has-property-descriptors": true, "nock>deep-equal>object-keys": true } }, + "globalthis>define-properties>has-property-descriptors": { + "packages": { + "string.prototype.matchall>get-intrinsic": true + } + }, "json-rpc-engine": { "packages": { "eth-rpc-errors": true, @@ -6333,6 +5531,24 @@ "Intl": true } }, + "madge>debug": { + "globals": { + "console": true, + "document": true, + "localStorage": true, + "navigator": true, + "process": true + }, + "packages": { + "browserify>process": true, + "madge>debug>ms": true + } + }, + "madge>rc>deep-extend": { + "packages": { + "browserify>buffer": true + } + }, "mockttp>node-forge": { "globals": { "Blob": true, @@ -6373,6 +5589,11 @@ "string.prototype.matchall>regexp.prototype.flags": true } }, + "nock>deep-equal>is-date-object": { + "packages": { + "enzyme>is-regex>has-tostringtag": true + } + }, "node-fetch": { "globals": { "Headers": true, @@ -6481,11 +5702,6 @@ "react": true } }, - "rc>deep-extend": { - "packages": { - "browserify>buffer": true - } - }, "react": { "globals": { "console": true @@ -6951,12 +6167,25 @@ }, "string.prototype.matchall>call-bind": { "packages": { - "eslint-plugin-react>array-includes>get-intrinsic": true, - "mocha>object.assign>function-bind": true + "mocha>object.assign>function-bind": true, + "string.prototype.matchall>get-intrinsic": true + } + }, + "string.prototype.matchall>get-intrinsic": { + "globals": { + "AggregateError": true, + "FinalizationRegistry": true, + "WeakRef": true + }, + "packages": { + "enzyme>has": true, + "mocha>object.assign>function-bind": true, + "string.prototype.matchall>has-symbols": true } }, "string.prototype.matchall>regexp.prototype.flags": { "packages": { + "enzyme>function.prototype.name>functions-have-names": true, "globalthis>define-properties": true, "string.prototype.matchall>call-bind": true } @@ -6967,11 +6196,6 @@ "jsdom>request>is-typedarray": true } }, - "terser>source-map-support>buffer-from": { - "packages": { - "browserify>buffer": true - } - }, "textarea-caret": { "globals": { "document.body.appendChild": true, @@ -6994,11 +6218,6 @@ "browserify>buffer": true } }, - "vinyl>cloneable-readable>process-nextick-args": { - "packages": { - "browserify>process": true - } - }, "web3": { "globals": { "Web3": "write", diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 2ed8c9610..db3484f25 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -61,11 +61,11 @@ }, "packages": { "3box>3box-orbitdb-plugins>ipfs-log>json-stringify-deterministic": true, + "3box>3box-orbitdb-plugins>ipfs-log>p-each-series": true, "3box>3box-orbitdb-plugins>ipfs-log>p-map": true, "3box>3box-orbitdb-plugins>ipfs-log>p-whilst": true, "3box>orbit-db>orbit-db-io": true, - "browserify>buffer": true, - "jest>@jest/core>p-each-series": true + "browserify>buffer": true } }, "3box>3id-resolver": { @@ -209,7 +209,6 @@ "setTimeout": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>async-iterator-all": true, "3box>ipfs>async-iterator-to-pull-stream": true, "3box>ipfs>async-iterator-to-stream": true, @@ -288,7 +287,8 @@ "browserify>events": true, "browserify>insert-module-globals>is-buffer": true, "browserify>timers-browserify": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs-mini": { @@ -305,17 +305,6 @@ "nanoid": true } }, - "3box>ipfs>async": { - "globals": { - "clearTimeout": true, - "setTimeout": true - }, - "packages": { - "browserify>process": true, - "browserify>timers-browserify": true, - "lodash": true - } - }, "3box>ipfs>async-iterator-to-pull-stream": { "packages": { "3box>ipfs>async-iterator-to-pull-stream>get-iterator": true, @@ -385,11 +374,11 @@ }, "3box>ipfs>datastore-core": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>datastore-core>pull-many": true, "3box>ipfs>interface-datastore": true, "3box>ipfs>pull-stream": true, - "browserify>buffer": true + "browserify>buffer": true, + "gh-pages>async": true } }, "3box>ipfs>datastore-pubsub": { @@ -399,7 +388,7 @@ "3box>ipfs>multibase": true, "browserify>assert": true, "browserify>buffer": true, - "eslint>debug": true + "madge>debug": true } }, "3box>ipfs>dlv": { @@ -421,7 +410,6 @@ }, "3box>ipfs>interface-datastore": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>class-is": true, "3box>ipfs>err-code": true, "3box>ipfs>interface-datastore>uuid": true, @@ -429,7 +417,8 @@ "3box>ipfs>pull-stream": true, "browserify>buffer": true, "browserify>os-browserify": true, - "browserify>path-browserify": true + "browserify>path-browserify": true, + "gh-pages>async": true } }, "3box>ipfs>interface-datastore>uuid": { @@ -446,7 +435,6 @@ "setTimeout": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>cids": true, "3box>ipfs>ipfs-bitswap>bignumber.js": true, "3box>ipfs>ipfs-bitswap>just-debounce-it": true, @@ -461,7 +449,8 @@ "3box>ipfs>pull-stream": true, "browserify>assert": true, "browserify>events": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs>ipfs-bitswap>bignumber.js": { @@ -506,7 +495,7 @@ }, "3box>ipfs>ipfs-block-service": { "packages": { - "3box>ipfs>async": true + "gh-pages>async": true } }, "3box>ipfs>ipfs-mfs": { @@ -531,7 +520,7 @@ "browserify>assert": true, "browserify>browser-resolve": true, "browserify>buffer": true, - "eslint>debug": true + "madge>debug": true } }, "3box>ipfs>ipfs-mfs>hamt-sharding": { @@ -562,7 +551,6 @@ }, "3box>ipfs>ipfs-repo": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>base32.js": true, "3box>ipfs>cids": true, "3box>ipfs>datastore-core": true, @@ -578,7 +566,8 @@ "browserify>buffer": true, "browserify>path-browserify": true, "browserify>timers-browserify": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs>ipfs-repo>bignumber.js": { @@ -699,7 +688,7 @@ "3box>ipfs>multihashes": true, "3box>ipfs>superstruct": true, "browserify>buffer": true, - "rc>deep-extend": true + "madge>rc>deep-extend": true } }, "3box>ipfs>ipfs-unixfs-importer>rabin-wasm": { @@ -822,7 +811,7 @@ "3box>ipfs>protons": true, "base32-encode": true, "browserify>buffer": true, - "eslint>debug": true + "madge>debug": true } }, "3box>ipfs>is-ipfs": { @@ -845,7 +834,6 @@ }, "3box>ipfs>libp2p": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>err-code": true, "3box>ipfs>fsm-event": true, "3box>ipfs>libp2p-websockets": true, @@ -861,7 +849,8 @@ "browserify>events": true, "browserify>insert-module-globals>is-buffer": true, "browserify>process": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -871,13 +860,13 @@ "setInterval": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>mafmt": true, "3box>ipfs>multiaddr": true, "3box>ipfs>peer-id": true, "3box>ipfs>peer-info": true, "browserify>events": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs>libp2p-crypto": { @@ -886,7 +875,6 @@ "msCrypto": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>bs58": true, "3box>ipfs>libp2p-crypto>asn1.js": true, "3box>ipfs>libp2p-crypto>iso-random-stream": true, @@ -896,6 +884,7 @@ "3box>tweetnacl": true, "browserify>buffer": true, "ethereumjs-util>ethereum-cryptography>browserify-aes": true, + "gh-pages>async": true, "mockttp>node-forge": true } }, @@ -918,10 +907,10 @@ }, "3box>ipfs>libp2p-crypto>libp2p-crypto-secp256k1": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>bs58": true, "3box>ipfs>libp2p-crypto>libp2p-crypto-secp256k1>multihashing-async": true, - "eth-trezor-keyring>hdkey>secp256k1": true + "eth-trezor-keyring>hdkey>secp256k1": true, + "gh-pages>async": true } }, "3box>ipfs>libp2p-crypto>libp2p-crypto-secp256k1>multihashing-async": { @@ -962,7 +951,6 @@ "setTimeout": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>base32.js": true, "3box>ipfs>cids": true, "3box>ipfs>err-code": true, @@ -990,7 +978,8 @@ "browserify>buffer": true, "browserify>events": true, "browserify>insert-module-globals>is-buffer": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "promise-to-callback": true } }, @@ -1045,7 +1034,6 @@ "setTimeout": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>err-code": true, "3box>ipfs>interface-datastore": true, "3box>ipfs>libp2p-crypto": true, @@ -1053,6 +1041,7 @@ "3box>ipfs>merge-options": true, "3box>ipfs>pull-stream": true, "browserify>buffer": true, + "gh-pages>async": true, "mockttp>node-forge": true } }, @@ -1068,14 +1057,14 @@ }, "3box>ipfs>libp2p-record": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>err-code": true, "3box>ipfs>libp2p-record>buffer-split": true, "3box>ipfs>libp2p-record>multihashing-async": true, "3box>ipfs>protons": true, "browserify>assert": true, "browserify>buffer": true, - "browserify>insert-module-globals>is-buffer": true + "browserify>insert-module-globals>is-buffer": true, + "gh-pages>async": true } }, "3box>ipfs>libp2p-record>buffer-split": { @@ -1100,7 +1089,6 @@ }, "3box>ipfs>libp2p-secio": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>libp2p-crypto": true, "3box>ipfs>libp2p-secio>multihashing-async": true, "3box>ipfs>libp2p-secio>pull-handshake": true, @@ -1113,7 +1101,8 @@ "3box>ipfs>pull-stream": true, "browserify>assert": true, "browserify>buffer": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -1160,7 +1149,6 @@ }, "3box>ipfs>libp2p-webrtc-star": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>class-is": true, "3box>ipfs>libp2p-webrtc-star>simple-peer": true, "3box>ipfs>libp2p-webrtc-star>socket.io-client": true, @@ -1172,7 +1160,8 @@ "3box>ipfs>pull-mplex>interface-connection": true, "3box>ipfs>stream-to-pull-stream": true, "browserify>events": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -1187,8 +1176,8 @@ "3box>ipfs>libp2p-webrtc-star>simple-peer>get-browser-rtc": true, "3box>ipfs>libp2p-webrtc-star>simple-peer>readable-stream": true, "browserify>buffer": true, - "eslint>debug": true, "ethereumjs-wallet>randombytes": true, + "madge>debug": true, "pumpify>inherits": true } }, @@ -1383,12 +1372,12 @@ "setTimeout": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>libp2p-websocket-star-multi>libp2p-websocket-star": true, "3box>ipfs>mafmt": true, "3box>ipfs>multiaddr": true, "browserify>events": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -1397,7 +1386,6 @@ "console.error": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>class-is": true, "3box>ipfs>libp2p-crypto": true, "3box>ipfs>libp2p-webrtc-star>socket.io-client": true, @@ -1410,7 +1398,8 @@ "3box>ipfs>pull-stream": true, "browserify>buffer": true, "browserify>events": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true, "uuid": true } @@ -1460,7 +1449,7 @@ "3box>ipfs>multiaddr-to-uri": true, "3box>ipfs>pull-mplex>interface-connection": true, "browserify>os-browserify": true, - "eslint>debug": true + "madge>debug": true } }, "3box>ipfs>libp2p-websockets>pull-ws": { @@ -1489,7 +1478,7 @@ "packages": { "3box>ipfs>libp2p>libp2p-connection-manager>latency-monitor": true, "browserify>events": true, - "eslint>debug": true + "madge>debug": true } }, "3box>ipfs>libp2p>libp2p-connection-manager>latency-monitor": { @@ -1524,17 +1513,16 @@ }, "3box>ipfs>libp2p>libp2p-floodsub": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>libp2p-secio>pull-length-prefixed": true, "3box>ipfs>libp2p>libp2p-floodsub>libp2p-pubsub": true, "3box>ipfs>pull-stream": true, "browserify>assert": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs>libp2p>libp2p-floodsub>libp2p-pubsub": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>bs58": true, "3box>ipfs>err-code": true, "3box>ipfs>libp2p-crypto": true, @@ -1546,7 +1534,8 @@ "browserify>buffer": true, "browserify>events": true, "browserify>insert-module-globals>is-buffer": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs>libp2p>libp2p-floodsub>libp2p-pubsub>time-cache": { @@ -1566,12 +1555,11 @@ "3box>ipfs>libp2p-secio>pull-handshake": true, "3box>ipfs>pull-stream": true, "browserify>events": true, - "eslint>debug": true + "madge>debug": true } }, "3box>ipfs>libp2p>libp2p-switch": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>class-is": true, "3box>ipfs>err-code": true, "3box>ipfs>fsm-event": true, @@ -1589,7 +1577,8 @@ "3box>ipfs>pull-stream": true, "browserify>assert": true, "browserify>events": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -1601,7 +1590,6 @@ }, "3box>ipfs>libp2p>libp2p-switch>libp2p-circuit": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>libp2p-secio>pull-handshake": true, "3box>ipfs>libp2p-secio>pull-length-prefixed": true, "3box>ipfs>mafmt": true, @@ -1612,7 +1600,8 @@ "3box>ipfs>pull-mplex>interface-connection": true, "3box>ipfs>pull-stream": true, "browserify>events": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -1632,7 +1621,6 @@ }, "3box>ipfs>libp2p>libp2p-switch>multistream-select": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>err-code": true, "3box>ipfs>libp2p-secio>pull-handshake": true, "3box>ipfs>libp2p-secio>pull-length-prefixed": true, @@ -1642,7 +1630,8 @@ "3box>ipfs>varint": true, "browserify>assert": true, "browserify>buffer": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -1774,12 +1763,12 @@ }, "3box>ipfs>peer-id": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>class-is": true, "3box>ipfs>libp2p-crypto": true, "3box>ipfs>multihashes": true, "browserify>assert": true, - "browserify>buffer": true + "browserify>buffer": true, + "gh-pages>async": true } }, "3box>ipfs>peer-info": { @@ -1807,7 +1796,6 @@ }, "3box>ipfs>pull-mplex": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>pull-abortable": true, "3box>ipfs>pull-mplex>interface-connection": true, "3box>ipfs>pull-mplex>looper": true, @@ -1817,7 +1805,8 @@ "3box>ipfs>varint": true, "browserify>buffer": true, "browserify>events": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs>pull-mplex>interface-connection": { @@ -2200,9 +2189,192 @@ "browserify>browser-resolve": true } }, - "@babel/runtime": { + "@babel/code-frame": { + "globals": { + "console.warn": true + }, + "packages": { + "browserify>process": true, + "lavamoat>@babel/highlight": true + } + }, + "@babel/core": { + "globals": { + "console.log": true + }, + "packages": { + "@babel/code-frame": true, + "@babel/core>@ampproject/remapping": true, + "@babel/core>@babel/generator": true, + "@babel/core>@babel/helper-compilation-targets": true, + "@babel/core>@babel/helper-module-transforms": true, + "@babel/core>@babel/helpers": true, + "@babel/core>@babel/parser": true, + "@babel/core>@babel/template": true, + "@babel/core>@babel/types": true, + "@babel/core>gensync": true, + "@babel/core>semver": true, + "browserify": true, + "browserify>path-browserify": true, + "browserify>process": true, + "depcheck>@babel/traverse": true, + "madge>debug": true, + "nyc>convert-source-map": true + } + }, + "@babel/core>@ampproject/remapping": { + "globals": { + "define": true + }, + "packages": { + "@babel/core>@ampproject/remapping>@jridgewell/gen-mapping": true, + "@babel/core>@ampproject/remapping>@jridgewell/trace-mapping": true + } + }, + "@babel/core>@ampproject/remapping>@jridgewell/gen-mapping": { + "globals": { + "define": true + }, + "packages": { + "@babel/core>@babel/generator>@jridgewell/gen-mapping>@jridgewell/set-array": true, + "@babel/core>@babel/generator>@jridgewell/gen-mapping>@jridgewell/sourcemap-codec": true + } + }, + "@babel/core>@ampproject/remapping>@jridgewell/trace-mapping": { + "globals": { + "define": true + }, + "packages": { + "@babel/core>@ampproject/remapping>@jridgewell/trace-mapping>@jridgewell/resolve-uri": true, + "@babel/core>@babel/generator>@jridgewell/gen-mapping>@jridgewell/sourcemap-codec": true + } + }, + "@babel/core>@ampproject/remapping>@jridgewell/trace-mapping>@jridgewell/resolve-uri": { + "globals": { + "define": true + } + }, + "@babel/core>@babel/generator": { + "globals": { + "console.error": true + }, + "packages": { + "@babel/core>@babel/generator>@jridgewell/gen-mapping": true, + "@babel/core>@babel/generator>jsesc": true, + "@babel/core>@babel/types": true, + "browserify>buffer": true + } + }, + "@babel/core>@babel/generator>@jridgewell/gen-mapping": { + "globals": { + "define": true + }, + "packages": { + "@babel/core>@ampproject/remapping>@jridgewell/trace-mapping": true, + "@babel/core>@babel/generator>@jridgewell/gen-mapping>@jridgewell/set-array": true, + "@babel/core>@babel/generator>@jridgewell/gen-mapping>@jridgewell/sourcemap-codec": true + } + }, + "@babel/core>@babel/generator>@jridgewell/gen-mapping>@jridgewell/set-array": { + "globals": { + "define": true + } + }, + "@babel/core>@babel/generator>@jridgewell/gen-mapping>@jridgewell/sourcemap-codec": { + "globals": { + "TextDecoder": true, + "define": true + }, + "packages": { + "browserify>buffer": true + } + }, + "@babel/core>@babel/generator>jsesc": { + "packages": { + "browserify>insert-module-globals>is-buffer": true + } + }, + "@babel/core>@babel/helper-compilation-targets": { + "globals": { + "console.warn": true + }, + "packages": { + "@babel/core>@babel/helper-compilation-targets>semver": true, + "@babel/preset-env>@babel/compat-data": true, + "@babel/preset-env>@babel/helper-validator-option": true, + "browserify>process": true, + "stylelint>autoprefixer>browserslist": true + } + }, + "@babel/core>@babel/helper-compilation-targets>semver": { + "globals": { + "console": true + }, + "packages": { + "browserify>process": true + } + }, + "@babel/core>@babel/helper-module-transforms": { + "packages": { + "@babel/core>@babel/helper-module-transforms>@babel/helper-module-imports": true, + "@babel/core>@babel/helper-module-transforms>@babel/helper-simple-access": true, + "@babel/core>@babel/template": true, + "@babel/core>@babel/types": true, + "browserify>assert": true, + "browserify>path-browserify": true, + "depcheck>@babel/traverse": true, + "depcheck>@babel/traverse>@babel/helper-environment-visitor": true, + "depcheck>@babel/traverse>@babel/helper-split-export-declaration": true, + "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true + } + }, + "@babel/core>@babel/helper-module-transforms>@babel/helper-module-imports": { + "packages": { + "@babel/core>@babel/types": true, + "browserify>assert": true + } + }, + "@babel/core>@babel/helper-module-transforms>@babel/helper-simple-access": { + "packages": { + "@babel/core>@babel/types": true + } + }, + "@babel/core>@babel/helpers": { + "packages": { + "@babel/core>@babel/template": true, + "@babel/core>@babel/types": true, + "depcheck>@babel/traverse": true + } + }, + "@babel/core>@babel/template": { + "packages": { + "@babel/code-frame": true, + "@babel/core>@babel/parser": true, + "@babel/core>@babel/types": true + } + }, + "@babel/core>@babel/types": { + "globals": { + "console.trace": true + }, "packages": { - "@storybook/api>regenerator-runtime": true + "@babel/core>@babel/types>@babel/helper-string-parser": true, + "@babel/core>@babel/types>to-fast-properties": true, + "browserify>process": true, + "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true + } + }, + "@babel/core>semver": { + "globals": { + "console": true + }, + "packages": { + "browserify>process": true + } + }, + "@babel/runtime": { + "globals": { + "regeneratorRuntime": "write" } }, "@download/blockies": { @@ -2318,8 +2490,7 @@ }, "@eth-optimism/contracts": { "packages": { - "ethers": true, - "ethers>@ethersproject/abstract-provider": true + "ethers": true } }, "@ethereumjs/common": { @@ -2655,10 +2826,10 @@ "@metamask/controllers>nanoid": true, "@metamask/controllers>web3-provider-engine": true, "@metamask/metamask-eth-abis": true, - "@storybook/api>fast-deep-equal": true, "browserify>buffer": true, "browserify>events": true, "deep-freeze-strict": true, + "eslint>fast-deep-equal": true, "eth-ens-namehash": true, "eth-json-rpc-infura": true, "eth-keyring-controller": true, @@ -2824,7 +2995,6 @@ "setTimeout": true }, "packages": { - "3box>ipfs>async": true, "@ethereumjs/tx": true, "@metamask/controllers>web3-provider-engine>backoff": true, "@metamask/controllers>web3-provider-engine>eth-block-tracker": true, @@ -2838,6 +3008,7 @@ "browserify>util": true, "eth-json-rpc-filters": true, "eth-json-rpc-infura": true, + "gh-pages>async": true, "lavamoat>json-stable-stringify": true, "watchify>xtend": true } @@ -3168,43 +3339,6 @@ "watchify>xtend": true } }, - "@metamask/post-message-stream": { - "globals": { - "addEventListener": true, - "location.origin": true, - "onmessage": "write", - "postMessage": true, - "removeEventListener": true - }, - "packages": { - "@metamask/post-message-stream>readable-stream": true - } - }, - "@metamask/post-message-stream>readable-stream": { - "packages": { - "@metamask/post-message-stream>readable-stream>safe-buffer": true, - "@metamask/post-message-stream>readable-stream>string_decoder": true, - "@storybook/api>util-deprecate": true, - "browserify>browser-resolve": true, - "browserify>events": true, - "browserify>process": true, - "browserify>timers-browserify": true, - "pumpify>inherits": true, - "readable-stream>core-util-is": true, - "readable-stream>isarray": true, - "vinyl>cloneable-readable>process-nextick-args": true - } - }, - "@metamask/post-message-stream>readable-stream>safe-buffer": { - "packages": { - "browserify>buffer": true - } - }, - "@metamask/post-message-stream>readable-stream>string_decoder": { - "packages": { - "@metamask/post-message-stream>readable-stream>safe-buffer": true - } - }, "@metamask/providers>@metamask/object-multiplex": { "globals": { "console.warn": true @@ -3217,147 +3351,14 @@ }, "@metamask/rpc-methods": { "packages": { - "@metamask/rpc-methods>@metamask/controllers": true, + "@metamask/controllers": true, "@metamask/rpc-methods>@metamask/key-tree": true, + "@metamask/rpc-methods>@metamask/snap-utils": true, "@metamask/rpc-methods>@metamask/utils": true, "@metamask/snap-controllers": true, "eth-rpc-errors": true } }, - "@metamask/rpc-methods>@metamask/controllers": { - "globals": { - "Headers": true, - "URL": true, - "clearInterval": true, - "clearTimeout": true, - "console.error": true, - "console.log": true, - "fetch": true, - "setInterval": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/common": true, - "@ethereumjs/tx": true, - "@metamask/contract-metadata": true, - "@metamask/controllers>abort-controller": true, - "@metamask/controllers>async-mutex": true, - "@metamask/controllers>eth-phishing-detect": true, - "@metamask/controllers>isomorphic-fetch": true, - "@metamask/controllers>multiformats": true, - "@metamask/controllers>web3-provider-engine": true, - "@metamask/metamask-eth-abis": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry": true, - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet": true, - "@metamask/rpc-methods>@metamask/controllers>nanoid": true, - "@storybook/api>fast-deep-equal": true, - "browserify>buffer": true, - "browserify>events": true, - "deep-freeze-strict": true, - "eth-ens-namehash": true, - "eth-json-rpc-infura": true, - "eth-keyring-controller": true, - "eth-query": true, - "eth-rpc-errors": true, - "eth-sig-util": true, - "ethereumjs-util": true, - "ethers": true, - "ethjs>ethjs-unit": true, - "immer": true, - "json-rpc-engine": true, - "jsonschema": true, - "punycode": true, - "single-call-balance-checker-abi": true, - "uuid": true, - "web3": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs": { - "globals": { - "clearInterval": true, - "setInterval": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-provider-http": true, - "ethjs>ethjs-unit": true, - "ethjs>ethjs-util": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "ethjs-query>babel-runtime": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-util": true, - "promise-to-callback": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { - "globals": { - "console": true - }, - "packages": { - "ethjs-query>babel-runtime": true, - "ethjs-query>ethjs-format": true, - "ethjs-query>ethjs-rpc": true, - "promise-to-callback": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": { - "packages": { - "browserify>process": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": true, - "@truffle/codec>utf8": true, - "browserify>buffer": true, - "browserify>crypto-browserify": true, - "ethereumjs-util": true, - "ethereumjs-util>ethereum-cryptography": true, - "ethereumjs-wallet>aes-js": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, - "ethers>@ethersproject/json-wallets>scrypt-js": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": { - "globals": { - "crypto": true, - "msCrypto": true - } - }, "@metamask/rpc-methods>@metamask/key-tree": { "packages": { "@metamask/rpc-methods>@metamask/key-tree>@noble/ed25519": true, @@ -3403,9 +3404,32 @@ "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true } }, + "@metamask/rpc-methods>@metamask/snap-utils": { + "globals": { + "URL": true + }, + "packages": { + "@babel/core": true, + "@babel/core>@babel/types": true, + "@metamask/rpc-methods>@metamask/snap-utils>ajv": true, + "@metamask/rpc-methods>@metamask/snap-utils>rfdc": true, + "browserify": true, + "browserify>buffer": true, + "browserify>crypto-browserify": true, + "browserify>events": true, + "browserify>path-browserify": true, + "eslint>fast-deep-equal": true, + "semver": true + } + }, + "@metamask/rpc-methods>@metamask/snap-utils>rfdc": { + "packages": { + "browserify>buffer": true + } + }, "@metamask/rpc-methods>@metamask/utils": { "packages": { - "@storybook/api>fast-deep-equal": true + "eslint>fast-deep-equal": true } }, "@metamask/smart-transactions-controller": { @@ -3418,148 +3442,14 @@ "setInterval": true }, "packages": { + "@metamask/controllers": true, "@metamask/controllers>isomorphic-fetch": true, - "@metamask/smart-transactions-controller>@metamask/controllers": true, "@metamask/smart-transactions-controller>bignumber.js": true, "@metamask/smart-transactions-controller>fast-json-patch": true, "ethers": true, "lodash": true } }, - "@metamask/smart-transactions-controller>@metamask/controllers": { - "globals": { - "Headers": true, - "URL": true, - "clearInterval": true, - "clearTimeout": true, - "console.error": true, - "console.log": true, - "fetch": true, - "setInterval": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/common": true, - "@ethereumjs/tx": true, - "@metamask/contract-metadata": true, - "@metamask/controllers>abort-controller": true, - "@metamask/controllers>async-mutex": true, - "@metamask/controllers>eth-phishing-detect": true, - "@metamask/controllers>isomorphic-fetch": true, - "@metamask/controllers>multiformats": true, - "@metamask/controllers>web3-provider-engine": true, - "@metamask/metamask-eth-abis": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": true, - "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": true, - "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": true, - "@storybook/api>fast-deep-equal": true, - "browserify>buffer": true, - "browserify>events": true, - "deep-freeze-strict": true, - "eth-ens-namehash": true, - "eth-json-rpc-infura": true, - "eth-keyring-controller": true, - "eth-query": true, - "eth-rpc-errors": true, - "eth-sig-util": true, - "ethereumjs-util": true, - "ethers": true, - "ethjs>ethjs-unit": true, - "immer": true, - "json-rpc-engine": true, - "jsonschema": true, - "punycode": true, - "single-call-balance-checker-abi": true, - "uuid": true, - "web3": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": { - "packages": { - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": { - "globals": { - "clearInterval": true, - "setInterval": true - }, - "packages": { - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-provider-http": true, - "ethjs>ethjs-unit": true, - "ethjs>ethjs-util": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { - "packages": { - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { - "packages": { - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "ethjs-query>babel-runtime": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-util": true, - "promise-to-callback": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { - "packages": { - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { - "globals": { - "console": true - }, - "packages": { - "ethjs-query>babel-runtime": true, - "ethjs-query>ethjs-format": true, - "ethjs-query>ethjs-rpc": true, - "promise-to-callback": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": { - "packages": { - "browserify>process": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": { - "packages": { - "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet>uuid": true, - "@truffle/codec>utf8": true, - "browserify>buffer": true, - "browserify>crypto-browserify": true, - "ethereumjs-util": true, - "ethereumjs-util>ethereum-cryptography": true, - "ethereumjs-wallet>aes-js": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, - "ethers>@ethersproject/json-wallets>scrypt-js": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet>uuid": { - "globals": { - "crypto": true, - "msCrypto": true - } - }, "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { "globals": { "crypto.getRandomValues": true @@ -3582,7 +3472,6 @@ "@metamask/snap-controllers": { "globals": { "URL": true, - "Worker": true, "clearTimeout": true, "console.error": true, "console.info": true, @@ -3595,28 +3484,25 @@ "setTimeout": true }, "packages": { - "@metamask/post-message-stream": true, + "@metamask/controllers": true, "@metamask/providers>@metamask/object-multiplex": true, + "@metamask/rpc-methods>@metamask/snap-utils": true, "@metamask/rpc-methods>@metamask/utils": true, "@metamask/snap-controllers>@metamask/browser-passworder": true, - "@metamask/snap-controllers>@metamask/controllers": true, "@metamask/snap-controllers>@metamask/execution-environments": true, "@metamask/snap-controllers>@metamask/obs-store": true, - "@metamask/snap-controllers>ajv": true, + "@metamask/snap-controllers>@metamask/post-message-stream": true, + "@metamask/snap-controllers>@xstate/fsm": true, "@metamask/snap-controllers>concat-stream": true, "@metamask/snap-controllers>gunzip-maybe": true, "@metamask/snap-controllers>json-rpc-middleware-stream": true, "@metamask/snap-controllers>nanoid": true, "@metamask/snap-controllers>readable-web-to-node-stream": true, "@metamask/snap-controllers>tar-stream": true, - "@storybook/api>fast-deep-equal": true, - "browserify>buffer": true, - "browserify>crypto-browserify": true, "eth-rpc-errors": true, "json-rpc-engine": true, "json-rpc-engine>@metamask/safe-event-emitter": true, - "pump": true, - "semver": true + "pump": true } }, "@metamask/snap-controllers>@metamask/browser-passworder": { @@ -3629,161 +3515,81 @@ "crypto.subtle.importKey": true }, "packages": { - "browserify>buffer": true - } - }, - "@metamask/snap-controllers>@metamask/controllers": { - "globals": { - "Headers": true, - "URL": true, - "clearInterval": true, - "clearTimeout": true, - "console.error": true, - "console.log": true, - "fetch": true, - "setInterval": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/common": true, - "@ethereumjs/tx": true, - "@metamask/contract-metadata": true, - "@metamask/controllers>abort-controller": true, - "@metamask/controllers>async-mutex": true, - "@metamask/controllers>eth-phishing-detect": true, - "@metamask/controllers>isomorphic-fetch": true, - "@metamask/controllers>multiformats": true, - "@metamask/controllers>web3-provider-engine": true, - "@metamask/metamask-eth-abis": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry": true, - "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet": true, - "@metamask/snap-controllers>nanoid": true, - "@storybook/api>fast-deep-equal": true, - "browserify>buffer": true, - "browserify>events": true, - "deep-freeze-strict": true, - "eth-ens-namehash": true, - "eth-json-rpc-infura": true, - "eth-keyring-controller": true, - "eth-query": true, - "eth-rpc-errors": true, - "eth-sig-util": true, - "ethereumjs-util": true, - "ethers": true, - "ethjs>ethjs-unit": true, - "immer": true, - "json-rpc-engine": true, - "jsonschema": true, - "punycode": true, - "single-call-balance-checker-abi": true, - "uuid": true, - "web3": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry": { - "packages": { - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs": { - "globals": { - "clearInterval": true, - "setInterval": true - }, - "packages": { - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-provider-http": true, - "ethjs>ethjs-unit": true, - "ethjs>ethjs-util": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { - "packages": { - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>number-to-bn": true + "browserify>buffer": true } }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { + "@metamask/snap-controllers>@metamask/obs-store": { "packages": { - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "ethjs-query>babel-runtime": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-util": true, - "promise-to-callback": true + "@metamask/snap-controllers>@metamask/obs-store>through2": true, + "browserify>stream-browserify": true, + "json-rpc-engine>@metamask/safe-event-emitter": true } }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { + "@metamask/snap-controllers>@metamask/obs-store>through2": { "packages": { - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>number-to-bn": true + "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream": true, + "browserify>process": true, + "browserify>util": true, + "watchify>xtend": true } }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { - "globals": { - "console": true - }, + "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream": { "packages": { - "ethjs-query>babel-runtime": true, - "ethjs-query>ethjs-format": true, - "ethjs-query>ethjs-rpc": true, - "promise-to-callback": true + "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream>process-nextick-args": true, + "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream>string_decoder": true, + "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true, + "@storybook/api>util-deprecate": true, + "browserify>browser-resolve": true, + "browserify>events": true, + "browserify>process": true, + "browserify>timers-browserify": true, + "pumpify>inherits": true, + "readable-stream>core-util-is": true, + "readable-stream>isarray": true } }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": { + "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream>process-nextick-args": { "packages": { "browserify>process": true } }, - "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet": { + "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream>string_decoder": { "packages": { - "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet>uuid": true, - "@truffle/codec>utf8": true, - "browserify>buffer": true, - "browserify>crypto-browserify": true, - "ethereumjs-util": true, - "ethereumjs-util>ethereum-cryptography": true, - "ethereumjs-wallet>aes-js": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, - "ethers>@ethersproject/json-wallets>scrypt-js": true + "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true } }, - "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet>uuid": { + "@metamask/snap-controllers>@metamask/post-message-stream": { "globals": { - "crypto": true, - "msCrypto": true - } - }, - "@metamask/snap-controllers>@metamask/obs-store": { + "WorkerGlobalScope": true, + "addEventListener": true, + "location.origin": true, + "onmessage": "write", + "postMessage": true, + "removeEventListener": true + }, "packages": { - "@metamask/snap-controllers>@metamask/obs-store>through2": true, - "browserify>stream-browserify": true, - "json-rpc-engine>@metamask/safe-event-emitter": true + "@metamask/rpc-methods>@metamask/utils": true, + "@metamask/snap-controllers>@metamask/post-message-stream>readable-stream": true } }, - "@metamask/snap-controllers>@metamask/obs-store>through2": { + "@metamask/snap-controllers>@metamask/post-message-stream>readable-stream": { "packages": { + "@metamask/snap-controllers>@metamask/post-message-stream>readable-stream>string_decoder": true, + "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true, + "@storybook/api>util-deprecate": true, + "browserify>browser-resolve": true, + "browserify>events": true, "browserify>process": true, - "browserify>util": true, - "readable-stream": true, - "watchify>xtend": true + "browserify>timers-browserify": true, + "pumpify>inherits": true, + "readable-stream>core-util-is": true, + "readable-stream>isarray": true, + "vinyl>cloneable-readable>process-nextick-args": true } }, - "@metamask/snap-controllers>ajv": { + "@metamask/snap-controllers>@metamask/post-message-stream>readable-stream>string_decoder": { "packages": { - "@storybook/api>fast-deep-equal": true + "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true } }, "@metamask/snap-controllers>concat-stream": { @@ -3887,8 +3693,38 @@ "setTimeout": true }, "packages": { - "json-rpc-engine>@metamask/safe-event-emitter": true, - "readable-stream": true + "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream": true, + "json-rpc-engine>@metamask/safe-event-emitter": true + } + }, + "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream": { + "packages": { + "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>process-nextick-args": true, + "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true, + "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>string_decoder": true, + "@storybook/api>util-deprecate": true, + "browserify>browser-resolve": true, + "browserify>events": true, + "browserify>process": true, + "browserify>timers-browserify": true, + "pumpify>inherits": true, + "readable-stream>core-util-is": true, + "readable-stream>isarray": true + } + }, + "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>process-nextick-args": { + "packages": { + "browserify>process": true + } + }, + "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": { + "packages": { + "browserify>buffer": true + } + }, + "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>string_decoder": { + "packages": { + "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true } }, "@metamask/snap-controllers>nanoid": { @@ -4086,6 +3922,24 @@ "define": true } }, + "@spruceid/siwe-parser": { + "globals": { + "console.error": true, + "console.log": true + }, + "packages": { + "@spruceid/siwe-parser>apg-js": true + } + }, + "@spruceid/siwe-parser>apg-js": { + "globals": { + "mode": true + }, + "packages": { + "browserify>buffer": true, + "browserify>insert-module-globals>is-buffer": true + } + }, "@storybook/api>regenerator-runtime": { "globals": { "regeneratorRuntime": "write" @@ -4117,8 +3971,8 @@ "@truffle/codec>web3-utils": true, "browserify>buffer": true, "browserify>util": true, - "eslint>debug": true, "gulp-dart-sass>lodash.clonedeep": true, + "madge>debug": true, "semver": true } }, @@ -4341,7 +4195,7 @@ "@truffle/codec>web3-utils": true, "@truffle/decoder>@truffle/source-map-utils": true, "@truffle/decoder>bn.js": true, - "eslint>debug": true + "madge>debug": true } }, "@truffle/decoder>@truffle/source-map-utils": { @@ -4351,7 +4205,7 @@ "@truffle/decoder>@truffle/source-map-utils>@truffle/code-utils": true, "@truffle/decoder>@truffle/source-map-utils>json-pointer": true, "@truffle/decoder>@truffle/source-map-utils>node-interval-tree": true, - "eslint>debug": true + "madge>debug": true } }, "@truffle/decoder>@truffle/source-map-utils>@truffle/code-utils": { @@ -4875,6 +4729,40 @@ "browserify>stream-browserify": true } }, + "depcheck>@babel/traverse": { + "globals": { + "console.log": true, + "console.trace": true + }, + "packages": { + "@babel/code-frame": true, + "@babel/core>@babel/generator": true, + "@babel/core>@babel/parser": true, + "@babel/core>@babel/types": true, + "depcheck>@babel/traverse>@babel/helper-environment-visitor": true, + "depcheck>@babel/traverse>@babel/helper-function-name": true, + "depcheck>@babel/traverse>@babel/helper-hoist-variables": true, + "depcheck>@babel/traverse>@babel/helper-split-export-declaration": true, + "depcheck>@babel/traverse>globals": true, + "madge>debug": true + } + }, + "depcheck>@babel/traverse>@babel/helper-function-name": { + "packages": { + "@babel/core>@babel/template": true, + "@babel/core>@babel/types": true + } + }, + "depcheck>@babel/traverse>@babel/helper-hoist-variables": { + "packages": { + "@babel/core>@babel/types": true + } + }, + "depcheck>@babel/traverse>@babel/helper-split-export-declaration": { + "packages": { + "@babel/core>@babel/types": true + } + }, "depcheck>@vue/compiler-sfc>postcss>nanoid": { "globals": { "crypto.getRandomValues": true @@ -4898,35 +4786,15 @@ }, "enzyme>is-regex": { "packages": { - "string.prototype.matchall>call-bind": true, - "string.prototype.matchall>has-symbols": true + "enzyme>is-regex>has-tostringtag": true, + "string.prototype.matchall>call-bind": true } }, - "eslint-plugin-react>array-includes>get-intrinsic": { - "globals": { - "AggregateError": true, - "FinalizationRegistry": true, - "WeakRef": true - }, + "enzyme>is-regex>has-tostringtag": { "packages": { - "enzyme>has": true, - "mocha>object.assign>function-bind": true, "string.prototype.matchall>has-symbols": true } }, - "eslint>debug": { - "globals": { - "console": true, - "document": true, - "localStorage": true, - "navigator": true, - "process": true - }, - "packages": { - "browserify>process": true, - "eslint>debug>ms": true - } - }, "eslint>optionator>fast-levenshtein": { "globals": { "Intl": true, @@ -6067,73 +5935,6 @@ "browserify>process": true } }, - "ethjs-ens": { - "packages": { - "ethereum-ens-network-map": true, - "ethjs-ens>eth-ens-namehash": true, - "ethjs-ens>ethjs-contract": true, - "ethjs-ens>ethjs-query": true - } - }, - "ethjs-ens>eth-ens-namehash": { - "globals": { - "name": "write" - }, - "packages": { - "browserify>buffer": true, - "ethjs-ens>eth-ens-namehash>idna-uts46": true, - "ethjs-ens>eth-ens-namehash>js-sha3": true - } - }, - "ethjs-ens>eth-ens-namehash>idna-uts46": { - "globals": { - "define": true - }, - "packages": { - "browserify>punycode": true - } - }, - "ethjs-ens>eth-ens-namehash>js-sha3": { - "packages": { - "browserify>process": true - } - }, - "ethjs-ens>ethjs-contract": { - "packages": { - "ethjs-contract>ethjs-abi": true, - "ethjs-ens>ethjs-contract>ethjs-filter": true, - "ethjs-ens>ethjs-contract>js-sha3": true, - "ethjs>ethjs-util": true - } - }, - "ethjs-ens>ethjs-contract>ethjs-filter": { - "globals": { - "clearInterval": true, - "setInterval": true - } - }, - "ethjs-ens>ethjs-contract>js-sha3": { - "packages": { - "browserify>process": true - } - }, - "ethjs-ens>ethjs-query": { - "globals": { - "console": true - }, - "packages": { - "ethjs-ens>ethjs-query>ethjs-format": true, - "ethjs-ens>ethjs-query>ethjs-rpc": true - } - }, - "ethjs-ens>ethjs-query>ethjs-format": { - "packages": { - "ethjs-ens>ethjs-query>ethjs-format>ethjs-schema": true, - "ethjs>ethjs-util": true, - "ethjs>ethjs-util>strip-hex-prefix": true, - "ethjs>number-to-bn": true - } - }, "ethjs-query": { "globals": { "console": true @@ -6250,11 +6051,28 @@ "define": true } }, + "gh-pages>async": { + "globals": { + "clearTimeout": true, + "setTimeout": true + }, + "packages": { + "browserify>process": true, + "browserify>timers-browserify": true, + "lodash": true + } + }, "globalthis>define-properties": { "packages": { + "globalthis>define-properties>has-property-descriptors": true, "nock>deep-equal>object-keys": true } }, + "globalthis>define-properties>has-property-descriptors": { + "packages": { + "string.prototype.matchall>get-intrinsic": true + } + }, "json-rpc-engine": { "packages": { "eth-rpc-errors": true, @@ -6279,6 +6097,26 @@ "browserify>url": true } }, + "lavamoat>@babel/highlight": { + "packages": { + "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true, + "lavamoat>@babel/highlight>chalk": true, + "loose-envify>js-tokens": true + } + }, + "lavamoat>@babel/highlight>chalk": { + "packages": { + "browserify>process": true, + "lavamoat>@babel/highlight>chalk>ansi-styles": true, + "lavamoat>@babel/highlight>chalk>supports-color": true, + "mocha>escape-string-regexp": true + } + }, + "lavamoat>@babel/highlight>chalk>ansi-styles": { + "packages": { + "@metamask/jazzicon>color>color-convert": true + } + }, "lavamoat>json-stable-stringify": { "packages": { "lavamoat>json-stable-stringify>jsonify": true @@ -6333,6 +6171,24 @@ "Intl": true } }, + "madge>debug": { + "globals": { + "console": true, + "document": true, + "localStorage": true, + "navigator": true, + "process": true + }, + "packages": { + "browserify>process": true, + "madge>debug>ms": true + } + }, + "madge>rc>deep-extend": { + "packages": { + "browserify>buffer": true + } + }, "mockttp>node-forge": { "globals": { "Blob": true, @@ -6373,6 +6229,11 @@ "string.prototype.matchall>regexp.prototype.flags": true } }, + "nock>deep-equal>is-date-object": { + "packages": { + "enzyme>is-regex>has-tostringtag": true + } + }, "node-fetch": { "globals": { "Headers": true, @@ -6388,6 +6249,18 @@ "ethjs-query": true } }, + "nyc>convert-source-map": { + "packages": { + "browserify>browser-resolve": true, + "browserify>path-browserify": true, + "nyc>convert-source-map>safe-buffer": true + } + }, + "nyc>convert-source-map>safe-buffer": { + "packages": { + "browserify>buffer": true + } + }, "obj-multiplex": { "globals": { "console.warn": true @@ -6481,11 +6354,6 @@ "react": true } }, - "rc>deep-extend": { - "packages": { - "browserify>buffer": true - } - }, "react": { "globals": { "console": true @@ -6951,16 +6819,38 @@ }, "string.prototype.matchall>call-bind": { "packages": { - "eslint-plugin-react>array-includes>get-intrinsic": true, - "mocha>object.assign>function-bind": true + "mocha>object.assign>function-bind": true, + "string.prototype.matchall>get-intrinsic": true + } + }, + "string.prototype.matchall>get-intrinsic": { + "globals": { + "AggregateError": true, + "FinalizationRegistry": true, + "WeakRef": true + }, + "packages": { + "enzyme>has": true, + "mocha>object.assign>function-bind": true, + "string.prototype.matchall>has-symbols": true } }, "string.prototype.matchall>regexp.prototype.flags": { "packages": { + "enzyme>function.prototype.name>functions-have-names": true, "globalthis>define-properties": true, "string.prototype.matchall>call-bind": true } }, + "stylelint>autoprefixer>browserslist": { + "packages": { + "browserify>browser-resolve": true, + "browserify>process": true, + "stylelint>autoprefixer>browserslist>electron-to-chromium": true, + "stylelint>autoprefixer>browserslist>node-releases": true, + "stylelint>autoprefixer>caniuse-lite": true + } + }, "stylelint>write-file-atomic>typedarray-to-buffer": { "packages": { "browserify>buffer": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 2ed8c9610..cf8538172 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -61,11 +61,11 @@ }, "packages": { "3box>3box-orbitdb-plugins>ipfs-log>json-stringify-deterministic": true, + "3box>3box-orbitdb-plugins>ipfs-log>p-each-series": true, "3box>3box-orbitdb-plugins>ipfs-log>p-map": true, "3box>3box-orbitdb-plugins>ipfs-log>p-whilst": true, "3box>orbit-db>orbit-db-io": true, - "browserify>buffer": true, - "jest>@jest/core>p-each-series": true + "browserify>buffer": true } }, "3box>3id-resolver": { @@ -209,7 +209,6 @@ "setTimeout": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>async-iterator-all": true, "3box>ipfs>async-iterator-to-pull-stream": true, "3box>ipfs>async-iterator-to-stream": true, @@ -288,7 +287,8 @@ "browserify>events": true, "browserify>insert-module-globals>is-buffer": true, "browserify>timers-browserify": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs-mini": { @@ -305,17 +305,6 @@ "nanoid": true } }, - "3box>ipfs>async": { - "globals": { - "clearTimeout": true, - "setTimeout": true - }, - "packages": { - "browserify>process": true, - "browserify>timers-browserify": true, - "lodash": true - } - }, "3box>ipfs>async-iterator-to-pull-stream": { "packages": { "3box>ipfs>async-iterator-to-pull-stream>get-iterator": true, @@ -385,11 +374,11 @@ }, "3box>ipfs>datastore-core": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>datastore-core>pull-many": true, "3box>ipfs>interface-datastore": true, "3box>ipfs>pull-stream": true, - "browserify>buffer": true + "browserify>buffer": true, + "gh-pages>async": true } }, "3box>ipfs>datastore-pubsub": { @@ -399,7 +388,7 @@ "3box>ipfs>multibase": true, "browserify>assert": true, "browserify>buffer": true, - "eslint>debug": true + "madge>debug": true } }, "3box>ipfs>dlv": { @@ -421,7 +410,6 @@ }, "3box>ipfs>interface-datastore": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>class-is": true, "3box>ipfs>err-code": true, "3box>ipfs>interface-datastore>uuid": true, @@ -429,7 +417,8 @@ "3box>ipfs>pull-stream": true, "browserify>buffer": true, "browserify>os-browserify": true, - "browserify>path-browserify": true + "browserify>path-browserify": true, + "gh-pages>async": true } }, "3box>ipfs>interface-datastore>uuid": { @@ -446,7 +435,6 @@ "setTimeout": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>cids": true, "3box>ipfs>ipfs-bitswap>bignumber.js": true, "3box>ipfs>ipfs-bitswap>just-debounce-it": true, @@ -461,7 +449,8 @@ "3box>ipfs>pull-stream": true, "browserify>assert": true, "browserify>events": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs>ipfs-bitswap>bignumber.js": { @@ -506,7 +495,7 @@ }, "3box>ipfs>ipfs-block-service": { "packages": { - "3box>ipfs>async": true + "gh-pages>async": true } }, "3box>ipfs>ipfs-mfs": { @@ -531,7 +520,7 @@ "browserify>assert": true, "browserify>browser-resolve": true, "browserify>buffer": true, - "eslint>debug": true + "madge>debug": true } }, "3box>ipfs>ipfs-mfs>hamt-sharding": { @@ -562,7 +551,6 @@ }, "3box>ipfs>ipfs-repo": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>base32.js": true, "3box>ipfs>cids": true, "3box>ipfs>datastore-core": true, @@ -578,7 +566,8 @@ "browserify>buffer": true, "browserify>path-browserify": true, "browserify>timers-browserify": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs>ipfs-repo>bignumber.js": { @@ -699,7 +688,7 @@ "3box>ipfs>multihashes": true, "3box>ipfs>superstruct": true, "browserify>buffer": true, - "rc>deep-extend": true + "madge>rc>deep-extend": true } }, "3box>ipfs>ipfs-unixfs-importer>rabin-wasm": { @@ -822,7 +811,7 @@ "3box>ipfs>protons": true, "base32-encode": true, "browserify>buffer": true, - "eslint>debug": true + "madge>debug": true } }, "3box>ipfs>is-ipfs": { @@ -845,7 +834,6 @@ }, "3box>ipfs>libp2p": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>err-code": true, "3box>ipfs>fsm-event": true, "3box>ipfs>libp2p-websockets": true, @@ -861,7 +849,8 @@ "browserify>events": true, "browserify>insert-module-globals>is-buffer": true, "browserify>process": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -871,13 +860,13 @@ "setInterval": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>mafmt": true, "3box>ipfs>multiaddr": true, "3box>ipfs>peer-id": true, "3box>ipfs>peer-info": true, "browserify>events": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs>libp2p-crypto": { @@ -886,7 +875,6 @@ "msCrypto": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>bs58": true, "3box>ipfs>libp2p-crypto>asn1.js": true, "3box>ipfs>libp2p-crypto>iso-random-stream": true, @@ -896,6 +884,7 @@ "3box>tweetnacl": true, "browserify>buffer": true, "ethereumjs-util>ethereum-cryptography>browserify-aes": true, + "gh-pages>async": true, "mockttp>node-forge": true } }, @@ -918,10 +907,10 @@ }, "3box>ipfs>libp2p-crypto>libp2p-crypto-secp256k1": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>bs58": true, "3box>ipfs>libp2p-crypto>libp2p-crypto-secp256k1>multihashing-async": true, - "eth-trezor-keyring>hdkey>secp256k1": true + "eth-trezor-keyring>hdkey>secp256k1": true, + "gh-pages>async": true } }, "3box>ipfs>libp2p-crypto>libp2p-crypto-secp256k1>multihashing-async": { @@ -962,7 +951,6 @@ "setTimeout": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>base32.js": true, "3box>ipfs>cids": true, "3box>ipfs>err-code": true, @@ -990,7 +978,8 @@ "browserify>buffer": true, "browserify>events": true, "browserify>insert-module-globals>is-buffer": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "promise-to-callback": true } }, @@ -1045,7 +1034,6 @@ "setTimeout": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>err-code": true, "3box>ipfs>interface-datastore": true, "3box>ipfs>libp2p-crypto": true, @@ -1053,6 +1041,7 @@ "3box>ipfs>merge-options": true, "3box>ipfs>pull-stream": true, "browserify>buffer": true, + "gh-pages>async": true, "mockttp>node-forge": true } }, @@ -1068,14 +1057,14 @@ }, "3box>ipfs>libp2p-record": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>err-code": true, "3box>ipfs>libp2p-record>buffer-split": true, "3box>ipfs>libp2p-record>multihashing-async": true, "3box>ipfs>protons": true, "browserify>assert": true, "browserify>buffer": true, - "browserify>insert-module-globals>is-buffer": true + "browserify>insert-module-globals>is-buffer": true, + "gh-pages>async": true } }, "3box>ipfs>libp2p-record>buffer-split": { @@ -1100,7 +1089,6 @@ }, "3box>ipfs>libp2p-secio": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>libp2p-crypto": true, "3box>ipfs>libp2p-secio>multihashing-async": true, "3box>ipfs>libp2p-secio>pull-handshake": true, @@ -1113,7 +1101,8 @@ "3box>ipfs>pull-stream": true, "browserify>assert": true, "browserify>buffer": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -1160,7 +1149,6 @@ }, "3box>ipfs>libp2p-webrtc-star": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>class-is": true, "3box>ipfs>libp2p-webrtc-star>simple-peer": true, "3box>ipfs>libp2p-webrtc-star>socket.io-client": true, @@ -1172,7 +1160,8 @@ "3box>ipfs>pull-mplex>interface-connection": true, "3box>ipfs>stream-to-pull-stream": true, "browserify>events": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -1187,8 +1176,8 @@ "3box>ipfs>libp2p-webrtc-star>simple-peer>get-browser-rtc": true, "3box>ipfs>libp2p-webrtc-star>simple-peer>readable-stream": true, "browserify>buffer": true, - "eslint>debug": true, "ethereumjs-wallet>randombytes": true, + "madge>debug": true, "pumpify>inherits": true } }, @@ -1383,12 +1372,12 @@ "setTimeout": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>libp2p-websocket-star-multi>libp2p-websocket-star": true, "3box>ipfs>mafmt": true, "3box>ipfs>multiaddr": true, "browserify>events": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -1397,7 +1386,6 @@ "console.error": true }, "packages": { - "3box>ipfs>async": true, "3box>ipfs>class-is": true, "3box>ipfs>libp2p-crypto": true, "3box>ipfs>libp2p-webrtc-star>socket.io-client": true, @@ -1410,7 +1398,8 @@ "3box>ipfs>pull-stream": true, "browserify>buffer": true, "browserify>events": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true, "uuid": true } @@ -1460,7 +1449,7 @@ "3box>ipfs>multiaddr-to-uri": true, "3box>ipfs>pull-mplex>interface-connection": true, "browserify>os-browserify": true, - "eslint>debug": true + "madge>debug": true } }, "3box>ipfs>libp2p-websockets>pull-ws": { @@ -1489,7 +1478,7 @@ "packages": { "3box>ipfs>libp2p>libp2p-connection-manager>latency-monitor": true, "browserify>events": true, - "eslint>debug": true + "madge>debug": true } }, "3box>ipfs>libp2p>libp2p-connection-manager>latency-monitor": { @@ -1524,17 +1513,16 @@ }, "3box>ipfs>libp2p>libp2p-floodsub": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>libp2p-secio>pull-length-prefixed": true, "3box>ipfs>libp2p>libp2p-floodsub>libp2p-pubsub": true, "3box>ipfs>pull-stream": true, "browserify>assert": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs>libp2p>libp2p-floodsub>libp2p-pubsub": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>bs58": true, "3box>ipfs>err-code": true, "3box>ipfs>libp2p-crypto": true, @@ -1546,7 +1534,8 @@ "browserify>buffer": true, "browserify>events": true, "browserify>insert-module-globals>is-buffer": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs>libp2p>libp2p-floodsub>libp2p-pubsub>time-cache": { @@ -1566,12 +1555,11 @@ "3box>ipfs>libp2p-secio>pull-handshake": true, "3box>ipfs>pull-stream": true, "browserify>events": true, - "eslint>debug": true + "madge>debug": true } }, "3box>ipfs>libp2p>libp2p-switch": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>class-is": true, "3box>ipfs>err-code": true, "3box>ipfs>fsm-event": true, @@ -1589,7 +1577,8 @@ "3box>ipfs>pull-stream": true, "browserify>assert": true, "browserify>events": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -1601,7 +1590,6 @@ }, "3box>ipfs>libp2p>libp2p-switch>libp2p-circuit": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>libp2p-secio>pull-handshake": true, "3box>ipfs>libp2p-secio>pull-length-prefixed": true, "3box>ipfs>mafmt": true, @@ -1612,7 +1600,8 @@ "3box>ipfs>pull-mplex>interface-connection": true, "3box>ipfs>pull-stream": true, "browserify>events": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -1632,7 +1621,6 @@ }, "3box>ipfs>libp2p>libp2p-switch>multistream-select": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>err-code": true, "3box>ipfs>libp2p-secio>pull-handshake": true, "3box>ipfs>libp2p-secio>pull-length-prefixed": true, @@ -1642,7 +1630,8 @@ "3box>ipfs>varint": true, "browserify>assert": true, "browserify>buffer": true, - "eslint>debug": true, + "gh-pages>async": true, + "madge>debug": true, "pump>once": true } }, @@ -1774,12 +1763,12 @@ }, "3box>ipfs>peer-id": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>class-is": true, "3box>ipfs>libp2p-crypto": true, "3box>ipfs>multihashes": true, "browserify>assert": true, - "browserify>buffer": true + "browserify>buffer": true, + "gh-pages>async": true } }, "3box>ipfs>peer-info": { @@ -1807,7 +1796,6 @@ }, "3box>ipfs>pull-mplex": { "packages": { - "3box>ipfs>async": true, "3box>ipfs>pull-abortable": true, "3box>ipfs>pull-mplex>interface-connection": true, "3box>ipfs>pull-mplex>looper": true, @@ -1817,7 +1805,8 @@ "3box>ipfs>varint": true, "browserify>buffer": true, "browserify>events": true, - "eslint>debug": true + "gh-pages>async": true, + "madge>debug": true } }, "3box>ipfs>pull-mplex>interface-connection": { @@ -2201,8 +2190,8 @@ } }, "@babel/runtime": { - "packages": { - "@storybook/api>regenerator-runtime": true + "globals": { + "regeneratorRuntime": "write" } }, "@download/blockies": { @@ -2318,8 +2307,7 @@ }, "@eth-optimism/contracts": { "packages": { - "ethers": true, - "ethers>@ethersproject/abstract-provider": true + "ethers": true } }, "@ethereumjs/common": { @@ -2655,10 +2643,10 @@ "@metamask/controllers>nanoid": true, "@metamask/controllers>web3-provider-engine": true, "@metamask/metamask-eth-abis": true, - "@storybook/api>fast-deep-equal": true, "browserify>buffer": true, "browserify>events": true, "deep-freeze-strict": true, + "eslint>fast-deep-equal": true, "eth-ens-namehash": true, "eth-json-rpc-infura": true, "eth-keyring-controller": true, @@ -2824,7 +2812,6 @@ "setTimeout": true }, "packages": { - "3box>ipfs>async": true, "@ethereumjs/tx": true, "@metamask/controllers>web3-provider-engine>backoff": true, "@metamask/controllers>web3-provider-engine>eth-block-tracker": true, @@ -2838,6 +2825,7 @@ "browserify>util": true, "eth-json-rpc-filters": true, "eth-json-rpc-infura": true, + "gh-pages>async": true, "lavamoat>json-stable-stringify": true, "watchify>xtend": true } @@ -3168,884 +3156,146 @@ "watchify>xtend": true } }, - "@metamask/post-message-stream": { - "globals": { - "addEventListener": true, - "location.origin": true, - "onmessage": "write", - "postMessage": true, - "removeEventListener": true - }, - "packages": { - "@metamask/post-message-stream>readable-stream": true - } - }, - "@metamask/post-message-stream>readable-stream": { - "packages": { - "@metamask/post-message-stream>readable-stream>safe-buffer": true, - "@metamask/post-message-stream>readable-stream>string_decoder": true, - "@storybook/api>util-deprecate": true, - "browserify>browser-resolve": true, - "browserify>events": true, - "browserify>process": true, - "browserify>timers-browserify": true, - "pumpify>inherits": true, - "readable-stream>core-util-is": true, - "readable-stream>isarray": true, - "vinyl>cloneable-readable>process-nextick-args": true - } - }, - "@metamask/post-message-stream>readable-stream>safe-buffer": { - "packages": { - "browserify>buffer": true - } - }, - "@metamask/post-message-stream>readable-stream>string_decoder": { - "packages": { - "@metamask/post-message-stream>readable-stream>safe-buffer": true - } - }, - "@metamask/providers>@metamask/object-multiplex": { - "globals": { - "console.warn": true - }, - "packages": { - "end-of-stream": true, - "pump>once": true, - "readable-stream": true - } - }, - "@metamask/rpc-methods": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers": true, - "@metamask/rpc-methods>@metamask/key-tree": true, - "@metamask/rpc-methods>@metamask/utils": true, - "@metamask/snap-controllers": true, - "eth-rpc-errors": true - } - }, - "@metamask/rpc-methods>@metamask/controllers": { + "@metamask/smart-transactions-controller": { "globals": { - "Headers": true, - "URL": true, + "URLSearchParams": true, "clearInterval": true, - "clearTimeout": true, "console.error": true, "console.log": true, "fetch": true, - "setInterval": true, - "setTimeout": true + "setInterval": true }, "packages": { - "@ethereumjs/common": true, - "@ethereumjs/tx": true, - "@metamask/contract-metadata": true, - "@metamask/controllers>abort-controller": true, - "@metamask/controllers>async-mutex": true, - "@metamask/controllers>eth-phishing-detect": true, + "@metamask/controllers": true, "@metamask/controllers>isomorphic-fetch": true, - "@metamask/controllers>multiformats": true, - "@metamask/controllers>web3-provider-engine": true, - "@metamask/metamask-eth-abis": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry": true, - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet": true, - "@metamask/rpc-methods>@metamask/controllers>nanoid": true, - "@storybook/api>fast-deep-equal": true, - "browserify>buffer": true, - "browserify>events": true, - "deep-freeze-strict": true, - "eth-ens-namehash": true, - "eth-json-rpc-infura": true, - "eth-keyring-controller": true, - "eth-query": true, - "eth-rpc-errors": true, - "eth-sig-util": true, - "ethereumjs-util": true, + "@metamask/smart-transactions-controller>bignumber.js": true, + "@metamask/smart-transactions-controller>fast-json-patch": true, "ethers": true, - "ethjs>ethjs-unit": true, - "immer": true, - "json-rpc-engine": true, - "jsonschema": true, - "punycode": true, - "single-call-balance-checker-abi": true, - "uuid": true, - "web3": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs": true + "lodash": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs": { + "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { "globals": { - "clearInterval": true, - "setInterval": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-provider-http": true, - "ethjs>ethjs-unit": true, - "ethjs>ethjs-util": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "ethjs-query>babel-runtime": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-util": true, - "promise-to-callback": true + "crypto.getRandomValues": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>number-to-bn": true + "@metamask/smart-transactions-controller>bignumber.js": { + "globals": { + "crypto": true, + "define": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { + "@metamask/smart-transactions-controller>fast-json-patch": { "globals": { - "console": true - }, - "packages": { - "ethjs-query>babel-runtime": true, - "ethjs-query>ethjs-format": true, - "ethjs-query>ethjs-rpc": true, - "promise-to-callback": true + "addEventListener": true, + "clearTimeout": true, + "removeEventListener": true, + "setTimeout": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": { - "packages": { - "browserify>process": true + "@metamask/snap-controllers>nanoid": { + "globals": { + "crypto.getRandomValues": true } }, - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet": { + "@ngraveio/bc-ur": { "packages": { - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": true, - "@truffle/codec>utf8": true, + "@ngraveio/bc-ur>@apocentre/alias-sampling": true, + "@ngraveio/bc-ur>bignumber.js": true, + "@ngraveio/bc-ur>crc": true, + "@ngraveio/bc-ur>jsbi": true, + "addons-linter>sha.js": true, + "browserify>assert": true, "browserify>buffer": true, - "browserify>crypto-browserify": true, - "ethereumjs-util": true, - "ethereumjs-util>ethereum-cryptography": true, - "ethereumjs-wallet>aes-js": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, - "ethers>@ethersproject/json-wallets>scrypt-js": true + "pubnub>cbor-sync": true } }, - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": { + "@ngraveio/bc-ur>bignumber.js": { "globals": { "crypto": true, - "msCrypto": true + "define": true } }, - "@metamask/rpc-methods>@metamask/key-tree": { + "@ngraveio/bc-ur>crc": { "packages": { - "@metamask/rpc-methods>@metamask/key-tree>@noble/ed25519": true, - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, - "@metamask/rpc-methods>@metamask/key-tree>@noble/secp256k1": true, - "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true, - "@metamask/rpc-methods>@metamask/key-tree>@scure/bip39": true, "browserify>buffer": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@noble/ed25519": { + "@ngraveio/bc-ur>jsbi": { "globals": { - "crypto": true - }, - "packages": { - "browserify>browser-resolve": true + "define": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": { + "@popperjs/core": { "globals": { - "TextEncoder": true, - "crypto": true, - "setTimeout": true + "Element": true, + "HTMLElement": true, + "ShadowRoot": true, + "console.error": true, + "console.warn": true, + "document": true, + "navigator.userAgent": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@noble/secp256k1": { + "@reduxjs/toolkit": { "globals": { - "crypto": true + "AbortController": true, + "__REDUX_DEVTOOLS_EXTENSION_COMPOSE__": true, + "__REDUX_DEVTOOLS_EXTENSION__": true, + "console.error": true, + "console.info": true, + "console.warn": true }, "packages": { - "browserify>browser-resolve": true + "@reduxjs/toolkit>reselect": true, + "immer": true, + "redux": true, + "redux-thunk": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@scure/base": { + "@sentry/browser": { "globals": { - "TextDecoder": true, - "TextEncoder": true - } - }, - "@metamask/rpc-methods>@metamask/key-tree>@scure/bip39": { + "XMLHttpRequest": true, + "setTimeout": true + }, "packages": { - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, - "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true + "@sentry/browser>@sentry/core": true, + "@sentry/types": true, + "@sentry/utils": true, + "@sentry/utils>tslib": true } }, - "@metamask/rpc-methods>@metamask/utils": { + "@sentry/browser>@sentry/core": { + "globals": { + "clearInterval": true, + "setInterval": true + }, "packages": { - "@storybook/api>fast-deep-equal": true + "@sentry/browser>@sentry/core>@sentry/hub": true, + "@sentry/browser>@sentry/core>@sentry/minimal": true, + "@sentry/types": true, + "@sentry/utils": true, + "@sentry/utils>tslib": true } }, - "@metamask/smart-transactions-controller": { + "@sentry/browser>@sentry/core>@sentry/hub": { "globals": { - "URLSearchParams": true, "clearInterval": true, - "console.error": true, - "console.log": true, - "fetch": true, "setInterval": true }, "packages": { - "@metamask/controllers>isomorphic-fetch": true, - "@metamask/smart-transactions-controller>@metamask/controllers": true, - "@metamask/smart-transactions-controller>bignumber.js": true, - "@metamask/smart-transactions-controller>fast-json-patch": true, - "ethers": true, - "lodash": true + "@sentry/types": true, + "@sentry/utils": true, + "@sentry/utils>tslib": true + } + }, + "@sentry/browser>@sentry/core>@sentry/minimal": { + "packages": { + "@sentry/browser>@sentry/core>@sentry/hub": true, + "@sentry/utils>tslib": true } }, - "@metamask/smart-transactions-controller>@metamask/controllers": { - "globals": { - "Headers": true, - "URL": true, - "clearInterval": true, - "clearTimeout": true, - "console.error": true, - "console.log": true, - "fetch": true, - "setInterval": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/common": true, - "@ethereumjs/tx": true, - "@metamask/contract-metadata": true, - "@metamask/controllers>abort-controller": true, - "@metamask/controllers>async-mutex": true, - "@metamask/controllers>eth-phishing-detect": true, - "@metamask/controllers>isomorphic-fetch": true, - "@metamask/controllers>multiformats": true, - "@metamask/controllers>web3-provider-engine": true, - "@metamask/metamask-eth-abis": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": true, - "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": true, - "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": true, - "@storybook/api>fast-deep-equal": true, - "browserify>buffer": true, - "browserify>events": true, - "deep-freeze-strict": true, - "eth-ens-namehash": true, - "eth-json-rpc-infura": true, - "eth-keyring-controller": true, - "eth-query": true, - "eth-rpc-errors": true, - "eth-sig-util": true, - "ethereumjs-util": true, - "ethers": true, - "ethjs>ethjs-unit": true, - "immer": true, - "json-rpc-engine": true, - "jsonschema": true, - "punycode": true, - "single-call-balance-checker-abi": true, - "uuid": true, - "web3": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": { - "packages": { - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": { - "globals": { - "clearInterval": true, - "setInterval": true - }, - "packages": { - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-provider-http": true, - "ethjs>ethjs-unit": true, - "ethjs>ethjs-util": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { - "packages": { - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { - "packages": { - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "ethjs-query>babel-runtime": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-util": true, - "promise-to-callback": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { - "packages": { - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { - "globals": { - "console": true - }, - "packages": { - "ethjs-query>babel-runtime": true, - "ethjs-query>ethjs-format": true, - "ethjs-query>ethjs-rpc": true, - "promise-to-callback": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": { - "packages": { - "browserify>process": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": { - "packages": { - "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet>uuid": true, - "@truffle/codec>utf8": true, - "browserify>buffer": true, - "browserify>crypto-browserify": true, - "ethereumjs-util": true, - "ethereumjs-util>ethereum-cryptography": true, - "ethereumjs-wallet>aes-js": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, - "ethers>@ethersproject/json-wallets>scrypt-js": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet>uuid": { - "globals": { - "crypto": true, - "msCrypto": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { - "globals": { - "crypto.getRandomValues": true - } - }, - "@metamask/smart-transactions-controller>bignumber.js": { - "globals": { - "crypto": true, - "define": true - } - }, - "@metamask/smart-transactions-controller>fast-json-patch": { - "globals": { - "addEventListener": true, - "clearTimeout": true, - "removeEventListener": true, - "setTimeout": true - } - }, - "@metamask/snap-controllers": { - "globals": { - "URL": true, - "Worker": true, - "clearTimeout": true, - "console.error": true, - "console.info": true, - "console.log": true, - "console.warn": true, - "document.body.appendChild": true, - "document.createElement": true, - "document.getElementById": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@metamask/post-message-stream": true, - "@metamask/providers>@metamask/object-multiplex": true, - "@metamask/rpc-methods>@metamask/utils": true, - "@metamask/snap-controllers>@metamask/browser-passworder": true, - "@metamask/snap-controllers>@metamask/controllers": true, - "@metamask/snap-controllers>@metamask/execution-environments": true, - "@metamask/snap-controllers>@metamask/obs-store": true, - "@metamask/snap-controllers>ajv": true, - "@metamask/snap-controllers>concat-stream": true, - "@metamask/snap-controllers>gunzip-maybe": true, - "@metamask/snap-controllers>json-rpc-middleware-stream": true, - "@metamask/snap-controllers>nanoid": true, - "@metamask/snap-controllers>readable-web-to-node-stream": true, - "@metamask/snap-controllers>tar-stream": true, - "@storybook/api>fast-deep-equal": true, - "browserify>buffer": true, - "browserify>crypto-browserify": true, - "eth-rpc-errors": true, - "json-rpc-engine": true, - "json-rpc-engine>@metamask/safe-event-emitter": true, - "pump": true, - "semver": true - } - }, - "@metamask/snap-controllers>@metamask/browser-passworder": { - "globals": { - "btoa": true, - "crypto.getRandomValues": true, - "crypto.subtle.decrypt": true, - "crypto.subtle.deriveKey": true, - "crypto.subtle.encrypt": true, - "crypto.subtle.importKey": true - }, - "packages": { - "browserify>buffer": true - } - }, - "@metamask/snap-controllers>@metamask/controllers": { - "globals": { - "Headers": true, - "URL": true, - "clearInterval": true, - "clearTimeout": true, - "console.error": true, - "console.log": true, - "fetch": true, - "setInterval": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/common": true, - "@ethereumjs/tx": true, - "@metamask/contract-metadata": true, - "@metamask/controllers>abort-controller": true, - "@metamask/controllers>async-mutex": true, - "@metamask/controllers>eth-phishing-detect": true, - "@metamask/controllers>isomorphic-fetch": true, - "@metamask/controllers>multiformats": true, - "@metamask/controllers>web3-provider-engine": true, - "@metamask/metamask-eth-abis": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry": true, - "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet": true, - "@metamask/snap-controllers>nanoid": true, - "@storybook/api>fast-deep-equal": true, - "browserify>buffer": true, - "browserify>events": true, - "deep-freeze-strict": true, - "eth-ens-namehash": true, - "eth-json-rpc-infura": true, - "eth-keyring-controller": true, - "eth-query": true, - "eth-rpc-errors": true, - "eth-sig-util": true, - "ethereumjs-util": true, - "ethers": true, - "ethjs>ethjs-unit": true, - "immer": true, - "json-rpc-engine": true, - "jsonschema": true, - "punycode": true, - "single-call-balance-checker-abi": true, - "uuid": true, - "web3": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry": { - "packages": { - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs": { - "globals": { - "clearInterval": true, - "setInterval": true - }, - "packages": { - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-provider-http": true, - "ethjs>ethjs-unit": true, - "ethjs>ethjs-util": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { - "packages": { - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { - "packages": { - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "ethjs-query>babel-runtime": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-util": true, - "promise-to-callback": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { - "packages": { - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, - "browserify>buffer": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { - "globals": { - "console": true - }, - "packages": { - "ethjs-query>babel-runtime": true, - "ethjs-query>ethjs-format": true, - "ethjs-query>ethjs-rpc": true, - "promise-to-callback": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": { - "packages": { - "browserify>process": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet": { - "packages": { - "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet>uuid": true, - "@truffle/codec>utf8": true, - "browserify>buffer": true, - "browserify>crypto-browserify": true, - "ethereumjs-util": true, - "ethereumjs-util>ethereum-cryptography": true, - "ethereumjs-wallet>aes-js": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, - "ethers>@ethersproject/json-wallets>scrypt-js": true - } - }, - "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet>uuid": { - "globals": { - "crypto": true, - "msCrypto": true - } - }, - "@metamask/snap-controllers>@metamask/obs-store": { - "packages": { - "@metamask/snap-controllers>@metamask/obs-store>through2": true, - "browserify>stream-browserify": true, - "json-rpc-engine>@metamask/safe-event-emitter": true - } - }, - "@metamask/snap-controllers>@metamask/obs-store>through2": { - "packages": { - "browserify>process": true, - "browserify>util": true, - "readable-stream": true, - "watchify>xtend": true - } - }, - "@metamask/snap-controllers>ajv": { - "packages": { - "@storybook/api>fast-deep-equal": true - } - }, - "@metamask/snap-controllers>concat-stream": { - "packages": { - "@metamask/snap-controllers>concat-stream>readable-stream": true, - "browserify>buffer": true, - "pumpify>inherits": true - } - }, - "@metamask/snap-controllers>concat-stream>readable-stream": { - "packages": { - "@storybook/api>util-deprecate": true, - "browserify>browser-resolve": true, - "browserify>buffer": true, - "browserify>events": true, - "browserify>process": true, - "browserify>string_decoder": true, - "pumpify>inherits": true - } - }, - "@metamask/snap-controllers>gunzip-maybe": { - "packages": { - "@metamask/snap-controllers>gunzip-maybe>browserify-zlib": true, - "@metamask/snap-controllers>gunzip-maybe>is-deflate": true, - "@metamask/snap-controllers>gunzip-maybe>is-gzip": true, - "@metamask/snap-controllers>gunzip-maybe>peek-stream": true, - "@metamask/snap-controllers>gunzip-maybe>pumpify": true, - "@metamask/snap-controllers>gunzip-maybe>through2": true - } - }, - "@metamask/snap-controllers>gunzip-maybe>browserify-zlib": { - "packages": { - "@metamask/snap-controllers>gunzip-maybe>browserify-zlib>pako": true, - "browserify>assert": true, - "browserify>buffer": true, - "browserify>process": true, - "browserify>util": true, - "readable-stream": true - } - }, - "@metamask/snap-controllers>gunzip-maybe>peek-stream": { - "packages": { - "@metamask/snap-controllers>gunzip-maybe>peek-stream>duplexify": true, - "@metamask/snap-controllers>gunzip-maybe>peek-stream>through2": true, - "browserify>buffer": true, - "terser>source-map-support>buffer-from": true - } - }, - "@metamask/snap-controllers>gunzip-maybe>peek-stream>duplexify": { - "packages": { - "browserify>buffer": true, - "browserify>process": true, - "duplexify>stream-shift": true, - "end-of-stream": true, - "pumpify>inherits": true, - "readable-stream": true - } - }, - "@metamask/snap-controllers>gunzip-maybe>peek-stream>through2": { - "packages": { - "browserify>process": true, - "browserify>util": true, - "readable-stream": true, - "watchify>xtend": true - } - }, - "@metamask/snap-controllers>gunzip-maybe>pumpify": { - "packages": { - "@metamask/snap-controllers>gunzip-maybe>pumpify>duplexify": true, - "@metamask/snap-controllers>gunzip-maybe>pumpify>pump": true, - "pumpify>inherits": true - } - }, - "@metamask/snap-controllers>gunzip-maybe>pumpify>duplexify": { - "packages": { - "browserify>buffer": true, - "browserify>process": true, - "duplexify>stream-shift": true, - "end-of-stream": true, - "pumpify>inherits": true, - "readable-stream": true - } - }, - "@metamask/snap-controllers>gunzip-maybe>pumpify>pump": { - "packages": { - "browserify>browser-resolve": true, - "end-of-stream": true, - "pump>once": true - } - }, - "@metamask/snap-controllers>gunzip-maybe>through2": { - "packages": { - "browserify>process": true, - "browserify>util": true, - "readable-stream": true, - "watchify>xtend": true - } - }, - "@metamask/snap-controllers>json-rpc-middleware-stream": { - "globals": { - "setTimeout": true - }, - "packages": { - "json-rpc-engine>@metamask/safe-event-emitter": true, - "readable-stream": true - } - }, - "@metamask/snap-controllers>nanoid": { - "globals": { - "crypto.getRandomValues": true - } - }, - "@metamask/snap-controllers>readable-web-to-node-stream": { - "packages": { - "@metamask/snap-controllers>readable-web-to-node-stream>readable-stream": true - } - }, - "@metamask/snap-controllers>readable-web-to-node-stream>readable-stream": { - "packages": { - "@storybook/api>util-deprecate": true, - "browserify>browser-resolve": true, - "browserify>buffer": true, - "browserify>events": true, - "browserify>process": true, - "browserify>string_decoder": true, - "pumpify>inherits": true - } - }, - "@metamask/snap-controllers>tar-stream": { - "packages": { - "@metamask/snap-controllers>tar-stream>bl": true, - "@metamask/snap-controllers>tar-stream>fs-constants": true, - "@metamask/snap-controllers>tar-stream>readable-stream": true, - "browserify>buffer": true, - "browserify>process": true, - "browserify>string_decoder": true, - "browserify>util": true, - "end-of-stream": true, - "pumpify>inherits": true - } - }, - "@metamask/snap-controllers>tar-stream>bl": { - "packages": { - "@metamask/snap-controllers>tar-stream>readable-stream": true, - "browserify>buffer": true, - "pumpify>inherits": true - } - }, - "@metamask/snap-controllers>tar-stream>fs-constants": { - "packages": { - "browserify>constants-browserify": true - } - }, - "@metamask/snap-controllers>tar-stream>readable-stream": { - "packages": { - "@storybook/api>util-deprecate": true, - "browserify>browser-resolve": true, - "browserify>buffer": true, - "browserify>events": true, - "browserify>process": true, - "browserify>string_decoder": true, - "pumpify>inherits": true - } - }, - "@ngraveio/bc-ur": { - "packages": { - "@ngraveio/bc-ur>@apocentre/alias-sampling": true, - "@ngraveio/bc-ur>bignumber.js": true, - "@ngraveio/bc-ur>crc": true, - "@ngraveio/bc-ur>jsbi": true, - "addons-linter>sha.js": true, - "browserify>assert": true, - "browserify>buffer": true, - "pubnub>cbor-sync": true - } - }, - "@ngraveio/bc-ur>bignumber.js": { - "globals": { - "crypto": true, - "define": true - } - }, - "@ngraveio/bc-ur>crc": { - "packages": { - "browserify>buffer": true - } - }, - "@ngraveio/bc-ur>jsbi": { - "globals": { - "define": true - } - }, - "@popperjs/core": { - "globals": { - "Element": true, - "HTMLElement": true, - "ShadowRoot": true, - "console.error": true, - "console.warn": true, - "document": true, - "navigator.userAgent": true - } - }, - "@reduxjs/toolkit": { - "globals": { - "AbortController": true, - "__REDUX_DEVTOOLS_EXTENSION_COMPOSE__": true, - "__REDUX_DEVTOOLS_EXTENSION__": true, - "console.error": true, - "console.info": true, - "console.warn": true - }, - "packages": { - "@reduxjs/toolkit>reselect": true, - "immer": true, - "redux": true, - "redux-thunk": true - } - }, - "@sentry/browser": { - "globals": { - "XMLHttpRequest": true, - "setTimeout": true - }, - "packages": { - "@sentry/browser>@sentry/core": true, - "@sentry/types": true, - "@sentry/utils": true, - "@sentry/utils>tslib": true - } - }, - "@sentry/browser>@sentry/core": { - "globals": { - "clearInterval": true, - "setInterval": true - }, - "packages": { - "@sentry/browser>@sentry/core>@sentry/hub": true, - "@sentry/browser>@sentry/core>@sentry/minimal": true, - "@sentry/types": true, - "@sentry/utils": true, - "@sentry/utils>tslib": true - } - }, - "@sentry/browser>@sentry/core>@sentry/hub": { - "globals": { - "clearInterval": true, - "setInterval": true - }, - "packages": { - "@sentry/types": true, - "@sentry/utils": true, - "@sentry/utils>tslib": true - } - }, - "@sentry/browser>@sentry/core>@sentry/minimal": { - "packages": { - "@sentry/browser>@sentry/core>@sentry/hub": true, - "@sentry/utils>tslib": true - } - }, - "@sentry/integrations": { + "@sentry/integrations": { "globals": { "clearTimeout": true, "console.error": true, @@ -4086,6 +3336,24 @@ "define": true } }, + "@spruceid/siwe-parser": { + "globals": { + "console.error": true, + "console.log": true + }, + "packages": { + "@spruceid/siwe-parser>apg-js": true + } + }, + "@spruceid/siwe-parser>apg-js": { + "globals": { + "mode": true + }, + "packages": { + "browserify>buffer": true, + "browserify>insert-module-globals>is-buffer": true + } + }, "@storybook/api>regenerator-runtime": { "globals": { "regeneratorRuntime": "write" @@ -4117,8 +3385,8 @@ "@truffle/codec>web3-utils": true, "browserify>buffer": true, "browserify>util": true, - "eslint>debug": true, "gulp-dart-sass>lodash.clonedeep": true, + "madge>debug": true, "semver": true } }, @@ -4341,7 +3609,7 @@ "@truffle/codec>web3-utils": true, "@truffle/decoder>@truffle/source-map-utils": true, "@truffle/decoder>bn.js": true, - "eslint>debug": true + "madge>debug": true } }, "@truffle/decoder>@truffle/source-map-utils": { @@ -4351,7 +3619,7 @@ "@truffle/decoder>@truffle/source-map-utils>@truffle/code-utils": true, "@truffle/decoder>@truffle/source-map-utils>json-pointer": true, "@truffle/decoder>@truffle/source-map-utils>node-interval-tree": true, - "eslint>debug": true + "madge>debug": true } }, "@truffle/decoder>@truffle/source-map-utils>@truffle/code-utils": { @@ -4898,35 +4166,15 @@ }, "enzyme>is-regex": { "packages": { - "string.prototype.matchall>call-bind": true, - "string.prototype.matchall>has-symbols": true + "enzyme>is-regex>has-tostringtag": true, + "string.prototype.matchall>call-bind": true } }, - "eslint-plugin-react>array-includes>get-intrinsic": { - "globals": { - "AggregateError": true, - "FinalizationRegistry": true, - "WeakRef": true - }, + "enzyme>is-regex>has-tostringtag": { "packages": { - "enzyme>has": true, - "mocha>object.assign>function-bind": true, "string.prototype.matchall>has-symbols": true } }, - "eslint>debug": { - "globals": { - "console": true, - "document": true, - "localStorage": true, - "navigator": true, - "process": true - }, - "packages": { - "browserify>process": true, - "eslint>debug>ms": true - } - }, "eslint>optionator>fast-levenshtein": { "globals": { "Intl": true, @@ -6067,73 +5315,6 @@ "browserify>process": true } }, - "ethjs-ens": { - "packages": { - "ethereum-ens-network-map": true, - "ethjs-ens>eth-ens-namehash": true, - "ethjs-ens>ethjs-contract": true, - "ethjs-ens>ethjs-query": true - } - }, - "ethjs-ens>eth-ens-namehash": { - "globals": { - "name": "write" - }, - "packages": { - "browserify>buffer": true, - "ethjs-ens>eth-ens-namehash>idna-uts46": true, - "ethjs-ens>eth-ens-namehash>js-sha3": true - } - }, - "ethjs-ens>eth-ens-namehash>idna-uts46": { - "globals": { - "define": true - }, - "packages": { - "browserify>punycode": true - } - }, - "ethjs-ens>eth-ens-namehash>js-sha3": { - "packages": { - "browserify>process": true - } - }, - "ethjs-ens>ethjs-contract": { - "packages": { - "ethjs-contract>ethjs-abi": true, - "ethjs-ens>ethjs-contract>ethjs-filter": true, - "ethjs-ens>ethjs-contract>js-sha3": true, - "ethjs>ethjs-util": true - } - }, - "ethjs-ens>ethjs-contract>ethjs-filter": { - "globals": { - "clearInterval": true, - "setInterval": true - } - }, - "ethjs-ens>ethjs-contract>js-sha3": { - "packages": { - "browserify>process": true - } - }, - "ethjs-ens>ethjs-query": { - "globals": { - "console": true - }, - "packages": { - "ethjs-ens>ethjs-query>ethjs-format": true, - "ethjs-ens>ethjs-query>ethjs-rpc": true - } - }, - "ethjs-ens>ethjs-query>ethjs-format": { - "packages": { - "ethjs-ens>ethjs-query>ethjs-format>ethjs-schema": true, - "ethjs>ethjs-util": true, - "ethjs>ethjs-util>strip-hex-prefix": true, - "ethjs>number-to-bn": true - } - }, "ethjs-query": { "globals": { "console": true @@ -6250,11 +5431,28 @@ "define": true } }, + "gh-pages>async": { + "globals": { + "clearTimeout": true, + "setTimeout": true + }, + "packages": { + "browserify>process": true, + "browserify>timers-browserify": true, + "lodash": true + } + }, "globalthis>define-properties": { "packages": { + "globalthis>define-properties>has-property-descriptors": true, "nock>deep-equal>object-keys": true } }, + "globalthis>define-properties>has-property-descriptors": { + "packages": { + "string.prototype.matchall>get-intrinsic": true + } + }, "json-rpc-engine": { "packages": { "eth-rpc-errors": true, @@ -6333,6 +5531,24 @@ "Intl": true } }, + "madge>debug": { + "globals": { + "console": true, + "document": true, + "localStorage": true, + "navigator": true, + "process": true + }, + "packages": { + "browserify>process": true, + "madge>debug>ms": true + } + }, + "madge>rc>deep-extend": { + "packages": { + "browserify>buffer": true + } + }, "mockttp>node-forge": { "globals": { "Blob": true, @@ -6373,6 +5589,11 @@ "string.prototype.matchall>regexp.prototype.flags": true } }, + "nock>deep-equal>is-date-object": { + "packages": { + "enzyme>is-regex>has-tostringtag": true + } + }, "node-fetch": { "globals": { "Headers": true, @@ -6481,11 +5702,6 @@ "react": true } }, - "rc>deep-extend": { - "packages": { - "browserify>buffer": true - } - }, "react": { "globals": { "console": true @@ -6951,12 +6167,25 @@ }, "string.prototype.matchall>call-bind": { "packages": { - "eslint-plugin-react>array-includes>get-intrinsic": true, - "mocha>object.assign>function-bind": true + "mocha>object.assign>function-bind": true, + "string.prototype.matchall>get-intrinsic": true + } + }, + "string.prototype.matchall>get-intrinsic": { + "globals": { + "AggregateError": true, + "FinalizationRegistry": true, + "WeakRef": true + }, + "packages": { + "enzyme>has": true, + "mocha>object.assign>function-bind": true, + "string.prototype.matchall>has-symbols": true } }, "string.prototype.matchall>regexp.prototype.flags": { "packages": { + "enzyme>function.prototype.name>functions-have-names": true, "globalthis>define-properties": true, "string.prototype.matchall>call-bind": true } @@ -6967,11 +6196,6 @@ "jsdom>request>is-typedarray": true } }, - "terser>source-map-support>buffer-from": { - "packages": { - "browserify>buffer": true - } - }, "textarea-caret": { "globals": { "document.body.appendChild": true, @@ -6994,11 +6218,6 @@ "browserify>buffer": true } }, - "vinyl>cloneable-readable>process-nextick-args": { - "packages": { - "browserify>process": true - } - }, "web3": { "globals": { "Web3": "write", diff --git a/lavamoat/build-system/policy-override.json b/lavamoat/build-system/policy-override.json index 8bdcb6a60..84098a0b4 100644 --- a/lavamoat/build-system/policy-override.json +++ b/lavamoat/build-system/policy-override.json @@ -13,7 +13,43 @@ "@babel/preset-typescript": true } }, + "@babel/eslint-parser": { + "builtin": { + "path": true + }, + "packages": { + "@babel/core": true, + "@babel/core>@babel/parser": true, + "@babel/eslint-parser>eslint-scope": true, + "@babel/eslint-parser>eslint-visitor-keys": true, + "@babel/eslint-parser>semver": true, + "@babel/parser": true, + "depcheck>@babel/parser": true, + "eslint": true, + "lavamoat>lavamoat-tofu>@babel/parser": true + }, + "globals": { + "process.versions": true + } + }, + "depcheck>@babel/traverse": { + "packages": { + "babel/preset-env>b@babel/types": true + } + }, "eslint>@eslint/eslintrc": { + "builtin": { + "assert": true, + "fs": true, + "module": true, + "os": true, + "path": true, + "url": true, + "util": true + }, + "globals": { + "process.platform": true + }, "packages": { "$root$": true, "@babel/eslint-parser": true, @@ -32,22 +68,49 @@ "eslint-plugin-react-hooks": true } }, + "eslint>eslint-scope": { + "builtin": { + "assert": true + } + }, "eslint-plugin-jest": { "packages": { - "eslint-plugin-jest>@typescript-eslint/experimental-utils": true, + "eslint-plugin-jest>@typescript-eslint/utils": true, "@typescript-eslint/eslint-plugin": true } }, + "eslint-plugin-jest>@typescript-eslint/utils>eslint-utils": { + "packages": { + "eslint-plugin-jest>@typescript-eslint/utils>eslint-utils>eslint-visitor-keys": true + } + }, + "eslint-plugin-jest>@typescript-eslint/utils": { + "builtin": { + "path": true + }, + "packages": { + "eslint-plugin-jest>@typescript-eslint/experimental-utils>@typescript-eslint/types": true, + "eslint-plugin-jest>@typescript-eslint/utils>eslint-utils": true, + "@typescript-eslint/parser>@typescript-eslint/types": true, + "eslint": true, + "@typescript-eslint/parser>@typescript-eslint/scope-manager": true, + "eslint>eslint-scope": true, + "@babel/eslint-parser>eslint-scope": true, + "eslint>eslint-utils": true + } + }, "eslint-plugin-jest>@typescript-eslint/experimental-utils": { "builtin": { "path": true }, "packages": { + "eslint-plugin-jest>@typescript-eslint/experimental-utils>@typescript-eslint/types": true, "eslint-plugin-jest>@typescript-eslint/experimental-utils>eslint-utils": true, "@typescript-eslint/parser>@typescript-eslint/types": true, "eslint": true, "@typescript-eslint/parser>@typescript-eslint/scope-manager": true, - "eslint>eslint-scope": true + "eslint>eslint-scope": true, + "eslint>eslint-utils": true } }, "eslint-plugin-jest>@typescript-eslint/experimental-utils>eslint-utils": { @@ -55,10 +118,30 @@ "eslint-plugin-jest>@typescript-eslint/experimental-utils>eslint-utils>eslint-visitor-keys": true } }, + "@typescript-eslint/eslint-plugin>@typescript-eslint/type-utils": { + "packages": { + "@typescript-eslint/eslint-plugin>@typescript-eslint/type-utils>debug": true, + "@typescript-eslint/eslint-plugin>tsutils": true, + "eslint-plugin-jest>@typescript-eslint/utils": true, + "eslint>debug": true, + "madge>debug": true, + "typescript": true + } + }, + "@typescript-eslint/eslint-plugin>@typescript-eslint/type-utils>debug": { + "packages": { + "@typescript-eslint/eslint-plugin>@typescript-eslint/type-utils>debug>ms": true + }, + "globals": { + "console.debug": true, + "console.log": true + } + }, "@typescript-eslint/eslint-plugin": { "packages": { "typescript": true, - "eslint-plugin-jest>@typescript-eslint/experimental-utils": true, + "eslint-plugin-jest>@typescript-eslint/utils": true, + "@typescript-eslint/eslint-plugin>@typescript-eslint/type-utils": true, "@typescript-eslint/parser>@typescript-eslint/scope-manager": true, "@typescript-eslint/eslint-plugin>tsutils": true, "eslint>debug": true, @@ -91,6 +174,11 @@ "Buffer": true } }, + "string.prototype.matchall>get-intrinsic": { + "packages": { + "string.prototype.matchall>has-symbols": true + } + }, "tsutils": { "packages": { "typescript": true, diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index f633b23af..0bb487573 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -17,23 +17,22 @@ }, "@babel/core": { "builtin": { + "assert": true, "fs": true, "module": true, "path": true, "url": true, - "v8": true + "util": true }, "globals": { + "console.error": true, "console.log": true, - "process.cwd": true, - "process.env.BABEL_ENV": true, - "process.env.BABEL_SHOW_CONFIG_FOR": true, - "process.env.NODE_ENV": true, - "process.versions.node": true + "process": true }, "packages": { "$root$": true, "@babel/code-frame": true, + "@babel/core>@ampproject/remapping": true, "@babel/core>@babel/generator": true, "@babel/core>@babel/helper-compilation-targets": true, "@babel/core>@babel/helper-module-transforms": true, @@ -43,7 +42,6 @@ "@babel/core>@babel/types": true, "@babel/core>gensync": true, "@babel/core>semver": true, - "@babel/core>source-map": true, "@babel/plugin-proposal-class-properties": true, "@babel/plugin-proposal-nullish-coalescing-operator": true, "@babel/plugin-proposal-object-rest-spread": true, @@ -54,20 +52,74 @@ "@babel/preset-typescript": true, "depcheck>@babel/traverse": true, "depcheck>json5": true, - "eslint>debug": true, + "madge>debug": true, "nyc>convert-source-map": true } }, + "@babel/core>@ampproject/remapping": { + "globals": { + "define": true + }, + "packages": { + "@babel/core>@ampproject/remapping>@jridgewell/gen-mapping": true, + "@babel/core>@ampproject/remapping>@jridgewell/trace-mapping": true + } + }, + "@babel/core>@ampproject/remapping>@jridgewell/gen-mapping": { + "globals": { + "define": true + }, + "packages": { + "@babel/core>@babel/generator>@jridgewell/gen-mapping>@jridgewell/set-array": true, + "@babel/core>@babel/generator>@jridgewell/gen-mapping>@jridgewell/sourcemap-codec": true + } + }, + "@babel/core>@ampproject/remapping>@jridgewell/trace-mapping": { + "globals": { + "define": true + }, + "packages": { + "@babel/core>@ampproject/remapping>@jridgewell/trace-mapping>@jridgewell/resolve-uri": true, + "@babel/core>@babel/generator>@jridgewell/gen-mapping>@jridgewell/sourcemap-codec": true + } + }, + "@babel/core>@ampproject/remapping>@jridgewell/trace-mapping>@jridgewell/resolve-uri": { + "globals": { + "define": true + } + }, "@babel/core>@babel/generator": { "globals": { "console.error": true }, "packages": { + "@babel/core>@babel/generator>@jridgewell/gen-mapping": true, "@babel/core>@babel/generator>jsesc": true, - "@babel/core>@babel/generator>source-map": true, "@babel/core>@babel/types": true } }, + "@babel/core>@babel/generator>@jridgewell/gen-mapping": { + "globals": { + "define": true + }, + "packages": { + "@babel/core>@ampproject/remapping>@jridgewell/trace-mapping": true, + "@babel/core>@babel/generator>@jridgewell/gen-mapping>@jridgewell/set-array": true, + "@babel/core>@babel/generator>@jridgewell/gen-mapping>@jridgewell/sourcemap-codec": true + } + }, + "@babel/core>@babel/generator>@jridgewell/gen-mapping>@jridgewell/set-array": { + "globals": { + "define": true + } + }, + "@babel/core>@babel/generator>@jridgewell/gen-mapping>@jridgewell/sourcemap-codec": { + "globals": { + "Buffer": true, + "TextDecoder": true, + "define": true + } + }, "@babel/core>@babel/generator>jsesc": { "globals": { "Buffer.isBuffer": true @@ -98,23 +150,22 @@ "path.extname": true }, "packages": { - "@babel/core>@babel/helper-module-transforms>@babel/helper-replace-supers": true, + "@babel/core>@babel/helper-module-transforms>@babel/helper-module-imports": true, "@babel/core>@babel/helper-module-transforms>@babel/helper-simple-access": true, "@babel/core>@babel/template": true, "@babel/core>@babel/types": true, - "@babel/plugin-transform-runtime>@babel/helper-module-imports": true, "depcheck>@babel/traverse": true, + "depcheck>@babel/traverse>@babel/helper-environment-visitor": true, "depcheck>@babel/traverse>@babel/helper-split-export-declaration": true, "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true } }, - "@babel/core>@babel/helper-module-transforms>@babel/helper-replace-supers": { + "@babel/core>@babel/helper-module-transforms>@babel/helper-module-imports": { + "builtin": { + "assert": true + }, "packages": { - "@babel/core>@babel/types": true, - "@babel/plugin-proposal-class-properties>@babel/helper-create-class-features-plugin>@babel/helper-member-expression-to-functions": true, - "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-optimise-call-expression": true, - "depcheck>@babel/traverse": true, - "depcheck>@babel/traverse>@babel/helper-environment-visitor": true + "@babel/core>@babel/types": true } }, "@babel/core>@babel/helper-module-transforms>@babel/helper-simple-access": { @@ -142,6 +193,7 @@ "process.env.BABEL_TYPES_8_BREAKING": true }, "packages": { + "@babel/core>@babel/types>@babel/helper-string-parser": true, "@babel/core>@babel/types>to-fast-properties": true, "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true } @@ -153,107 +205,45 @@ } }, "@babel/eslint-parser": { - "packages": { - "@babel/core": true, - "@babel/eslint-parser>eslint-visitor-keys": true, - "@babel/eslint-parser>semver": true, - "eslint>eslint-scope": true - } - }, - "@babel/eslint-parser>semver": { - "globals": { - "console": true, - "process": true - } - }, - "@babel/eslint-plugin": { - "packages": { - "@babel/eslint-plugin>eslint-rule-composer": true, - "eslint": true - } - }, - "@babel/plugin-proposal-class-properties": { - "packages": { - "@babel/plugin-proposal-class-properties>@babel/helper-create-class-features-plugin": true, - "@babel/preset-env>@babel/helper-plugin-utils": true - } - }, - "@babel/plugin-proposal-class-properties>@babel/helper-create-class-features-plugin": { - "globals": { - "console.warn": true - }, - "packages": { - "@babel/core": true, - "@babel/core>@babel/helper-module-transforms>@babel/helper-replace-supers": true, - "@babel/plugin-proposal-class-properties>@babel/helper-create-class-features-plugin>@babel/helper-member-expression-to-functions": true, - "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure": true, - "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-optimise-call-expression": true, - "depcheck>@babel/traverse>@babel/helper-environment-visitor": true, - "depcheck>@babel/traverse>@babel/helper-function-name": true, - "depcheck>@babel/traverse>@babel/helper-split-export-declaration": true - } - }, - "@babel/plugin-proposal-class-properties>@babel/helper-create-class-features-plugin>@babel/helper-member-expression-to-functions": { - "packages": { - "@babel/core>@babel/types": true - } - }, - "@babel/plugin-proposal-nullish-coalescing-operator": { - "packages": { - "@babel/core": true, - "@babel/preset-env>@babel/helper-plugin-utils": true, - "@babel/preset-env>@babel/plugin-syntax-nullish-coalescing-operator": true - } - }, - "@babel/plugin-proposal-object-rest-spread": { - "packages": { - "@babel/core": true, - "@babel/core>@babel/helper-compilation-targets": true, - "@babel/preset-env>@babel/compat-data": true, - "@babel/preset-env>@babel/helper-plugin-utils": true, - "@babel/preset-env>@babel/plugin-syntax-object-rest-spread": true, - "@babel/preset-env>@babel/plugin-transform-parameters": true - } - }, - "@babel/plugin-proposal-optional-chaining": { - "packages": { - "@babel/core": true, - "@babel/plugin-proposal-optional-chaining>@babel/helper-skip-transparent-expression-wrappers": true, - "@babel/preset-env>@babel/helper-plugin-utils": true, - "@babel/preset-env>@babel/plugin-syntax-optional-chaining": true - } - }, - "@babel/plugin-proposal-optional-chaining>@babel/helper-skip-transparent-expression-wrappers": { - "packages": { - "@babel/core>@babel/types": true - } - }, - "@babel/plugin-transform-runtime": { "builtin": { "path": true }, + "globals": { + "process.versions": true + }, "packages": { "@babel/core": true, - "@babel/plugin-transform-runtime>@babel/helper-module-imports": true, - "@babel/plugin-transform-runtime>semver": true, - "@babel/preset-env>@babel/helper-plugin-utils": true, - "brfs>resolve": true + "@babel/core>@babel/parser": true, + "@babel/eslint-parser>eslint-scope": true, + "@babel/eslint-parser>eslint-visitor-keys": true, + "@babel/eslint-parser>semver": true, + "@babel/parser": true, + "depcheck>@babel/parser": true, + "eslint": true, + "lavamoat>lavamoat-tofu>@babel/parser": true } }, - "@babel/plugin-transform-runtime>@babel/helper-module-imports": { + "@babel/eslint-parser>eslint-scope": { "builtin": { "assert": true }, "packages": { - "@babel/core>@babel/types": true + "@babel/eslint-parser>eslint-scope>estraverse": true, + "eslint>eslint-scope>esrecurse": true } }, - "@babel/plugin-transform-runtime>semver": { + "@babel/eslint-parser>semver": { "globals": { "console": true, "process": true } }, + "@babel/eslint-plugin": { + "packages": { + "@babel/eslint-plugin>eslint-rule-composer": true, + "eslint": true + } + }, "@babel/preset-env": { "globals": { "console.log": true, @@ -264,22 +254,23 @@ "packages": { "@babel/core>@babel/helper-compilation-targets": true, "@babel/core>@babel/types": true, - "@babel/plugin-proposal-class-properties": true, - "@babel/plugin-proposal-nullish-coalescing-operator": true, - "@babel/plugin-proposal-object-rest-spread": true, - "@babel/plugin-proposal-optional-chaining": true, "@babel/preset-env>@babel/compat-data": true, "@babel/preset-env>@babel/helper-plugin-utils": true, "@babel/preset-env>@babel/helper-validator-option": true, + "@babel/preset-env>@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": true, "@babel/preset-env>@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": true, "@babel/preset-env>@babel/plugin-proposal-async-generator-functions": true, + "@babel/preset-env>@babel/plugin-proposal-class-properties": true, "@babel/preset-env>@babel/plugin-proposal-class-static-block": true, "@babel/preset-env>@babel/plugin-proposal-dynamic-import": true, "@babel/preset-env>@babel/plugin-proposal-export-namespace-from": true, "@babel/preset-env>@babel/plugin-proposal-json-strings": true, "@babel/preset-env>@babel/plugin-proposal-logical-assignment-operators": true, + "@babel/preset-env>@babel/plugin-proposal-nullish-coalescing-operator": true, "@babel/preset-env>@babel/plugin-proposal-numeric-separator": true, + "@babel/preset-env>@babel/plugin-proposal-object-rest-spread": true, "@babel/preset-env>@babel/plugin-proposal-optional-catch-binding": true, + "@babel/preset-env>@babel/plugin-proposal-optional-chaining": true, "@babel/preset-env>@babel/plugin-proposal-private-methods": true, "@babel/preset-env>@babel/plugin-proposal-private-property-in-object": true, "@babel/preset-env>@babel/plugin-proposal-unicode-property-regex": true, @@ -288,6 +279,7 @@ "@babel/preset-env>@babel/plugin-syntax-class-static-block": true, "@babel/preset-env>@babel/plugin-syntax-dynamic-import": true, "@babel/preset-env>@babel/plugin-syntax-export-namespace-from": true, + "@babel/preset-env>@babel/plugin-syntax-import-assertions": true, "@babel/preset-env>@babel/plugin-syntax-json-strings": true, "@babel/preset-env>@babel/plugin-syntax-logical-assignment-operators": true, "@babel/preset-env>@babel/plugin-syntax-nullish-coalescing-operator": true, @@ -337,12 +329,17 @@ "@babel/preset-env>semver": true } }, + "@babel/preset-env>@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { + "packages": { + "@babel/preset-env>@babel/helper-plugin-utils": true + } + }, "@babel/preset-env>@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { "packages": { "@babel/core": true, - "@babel/plugin-proposal-optional-chaining": true, - "@babel/plugin-proposal-optional-chaining>@babel/helper-skip-transparent-expression-wrappers": true, - "@babel/preset-env>@babel/helper-plugin-utils": true + "@babel/preset-env>@babel/helper-plugin-utils": true, + "@babel/preset-env>@babel/plugin-proposal-optional-chaining": true, + "@babel/preset-env>@babel/plugin-transform-spread>@babel/helper-skip-transparent-expression-wrappers": true } }, "@babel/preset-env>@babel/plugin-proposal-async-generator-functions": { @@ -350,13 +347,20 @@ "@babel/core": true, "@babel/preset-env>@babel/helper-plugin-utils": true, "@babel/preset-env>@babel/plugin-syntax-async-generators": true, - "@babel/preset-env>@babel/plugin-transform-async-to-generator>@babel/helper-remap-async-to-generator": true + "@babel/preset-env>@babel/plugin-transform-async-to-generator>@babel/helper-remap-async-to-generator": true, + "depcheck>@babel/traverse>@babel/helper-environment-visitor": true + } + }, + "@babel/preset-env>@babel/plugin-proposal-class-properties": { + "packages": { + "@babel/preset-env>@babel/helper-plugin-utils": true, + "@babel/preset-env>@babel/plugin-proposal-private-methods>@babel/helper-create-class-features-plugin": true } }, "@babel/preset-env>@babel/plugin-proposal-class-static-block": { "packages": { - "@babel/plugin-proposal-class-properties>@babel/helper-create-class-features-plugin": true, "@babel/preset-env>@babel/helper-plugin-utils": true, + "@babel/preset-env>@babel/plugin-proposal-private-methods>@babel/helper-create-class-features-plugin": true, "@babel/preset-env>@babel/plugin-syntax-class-static-block": true } }, @@ -386,28 +390,67 @@ "@babel/preset-env>@babel/plugin-syntax-logical-assignment-operators": true } }, + "@babel/preset-env>@babel/plugin-proposal-nullish-coalescing-operator": { + "packages": { + "@babel/core": true, + "@babel/preset-env>@babel/helper-plugin-utils": true, + "@babel/preset-env>@babel/plugin-syntax-nullish-coalescing-operator": true + } + }, "@babel/preset-env>@babel/plugin-proposal-numeric-separator": { "packages": { "@babel/preset-env>@babel/helper-plugin-utils": true, "@babel/preset-env>@babel/plugin-syntax-numeric-separator": true } }, + "@babel/preset-env>@babel/plugin-proposal-object-rest-spread": { + "packages": { + "@babel/core": true, + "@babel/core>@babel/helper-compilation-targets": true, + "@babel/preset-env>@babel/helper-plugin-utils": true, + "@babel/preset-env>@babel/plugin-syntax-object-rest-spread": true, + "@babel/preset-env>@babel/plugin-transform-parameters": true + } + }, "@babel/preset-env>@babel/plugin-proposal-optional-catch-binding": { "packages": { "@babel/preset-env>@babel/helper-plugin-utils": true, "@babel/preset-env>@babel/plugin-syntax-optional-catch-binding": true } }, + "@babel/preset-env>@babel/plugin-proposal-optional-chaining": { + "packages": { + "@babel/core": true, + "@babel/preset-env>@babel/helper-plugin-utils": true, + "@babel/preset-env>@babel/plugin-syntax-optional-chaining": true, + "@babel/preset-env>@babel/plugin-transform-spread>@babel/helper-skip-transparent-expression-wrappers": true + } + }, "@babel/preset-env>@babel/plugin-proposal-private-methods": { "packages": { - "@babel/plugin-proposal-class-properties>@babel/helper-create-class-features-plugin": true, - "@babel/preset-env>@babel/helper-plugin-utils": true + "@babel/preset-env>@babel/helper-plugin-utils": true, + "@babel/preset-env>@babel/plugin-proposal-private-methods>@babel/helper-create-class-features-plugin": true + } + }, + "@babel/preset-env>@babel/plugin-proposal-private-methods>@babel/helper-create-class-features-plugin": { + "globals": { + "console.warn": true + }, + "packages": { + "@babel/core": true, + "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure": true, + "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-optimise-call-expression": true, + "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers": true, + "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers>@babel/helper-member-expression-to-functions": true, + "depcheck>@babel/traverse>@babel/helper-environment-visitor": true, + "depcheck>@babel/traverse>@babel/helper-function-name": true, + "depcheck>@babel/traverse>@babel/helper-split-export-declaration": true } }, "@babel/preset-env>@babel/plugin-proposal-private-property-in-object": { "packages": { - "@babel/plugin-proposal-class-properties>@babel/helper-create-class-features-plugin": true, "@babel/preset-env>@babel/helper-plugin-utils": true, + "@babel/preset-env>@babel/plugin-proposal-private-methods>@babel/helper-create-class-features-plugin": true, "@babel/preset-env>@babel/plugin-syntax-private-property-in-object": true, "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure": true } @@ -443,6 +486,11 @@ "@babel/preset-env>@babel/helper-plugin-utils": true } }, + "@babel/preset-env>@babel/plugin-syntax-import-assertions": { + "packages": { + "@babel/preset-env>@babel/helper-plugin-utils": true + } + }, "@babel/preset-env>@babel/plugin-syntax-json-strings": { "packages": { "@babel/preset-env>@babel/helper-plugin-utils": true @@ -496,16 +544,18 @@ "@babel/preset-env>@babel/plugin-transform-async-to-generator": { "packages": { "@babel/core": true, - "@babel/plugin-transform-runtime>@babel/helper-module-imports": true, + "@babel/core>@babel/helper-module-transforms>@babel/helper-module-imports": true, "@babel/preset-env>@babel/helper-plugin-utils": true, "@babel/preset-env>@babel/plugin-transform-async-to-generator>@babel/helper-remap-async-to-generator": true } }, "@babel/preset-env>@babel/plugin-transform-async-to-generator>@babel/helper-remap-async-to-generator": { "packages": { + "@babel/core": true, "@babel/core>@babel/types": true, "@babel/preset-env>@babel/plugin-transform-async-to-generator>@babel/helper-remap-async-to-generator>@babel/helper-wrap-function": true, - "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure": true + "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure": true, + "depcheck>@babel/traverse>@babel/helper-environment-visitor": true } }, "@babel/preset-env>@babel/plugin-transform-async-to-generator>@babel/helper-remap-async-to-generator>@babel/helper-wrap-function": { @@ -530,11 +580,12 @@ "@babel/preset-env>@babel/plugin-transform-classes": { "packages": { "@babel/core": true, - "@babel/core>@babel/helper-module-transforms>@babel/helper-replace-supers": true, "@babel/preset-env>@babel/helper-plugin-utils": true, "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure": true, "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-optimise-call-expression": true, + "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers": true, "@babel/preset-env>@babel/plugin-transform-classes>globals": true, + "depcheck>@babel/traverse>@babel/helper-environment-visitor": true, "depcheck>@babel/traverse>@babel/helper-function-name": true, "depcheck>@babel/traverse>@babel/helper-split-export-declaration": true } @@ -549,6 +600,20 @@ "@babel/core>@babel/types": true } }, + "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers": { + "packages": { + "@babel/core>@babel/types": true, + "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-optimise-call-expression": true, + "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers>@babel/helper-member-expression-to-functions": true, + "depcheck>@babel/traverse": true, + "depcheck>@babel/traverse>@babel/helper-environment-visitor": true + } + }, + "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers>@babel/helper-member-expression-to-functions": { + "packages": { + "@babel/core>@babel/types": true + } + }, "@babel/preset-env>@babel/plugin-transform-computed-properties": { "packages": { "@babel/core": true, @@ -575,6 +640,9 @@ } }, "@babel/preset-env>@babel/plugin-transform-dotall-regex>@babel/helper-create-regexp-features-plugin>regexpu-core": { + "globals": { + "characterClassItem.kind": true + }, "packages": { "@babel/preset-env>@babel/plugin-transform-dotall-regex>@babel/helper-create-regexp-features-plugin>regexpu-core>regenerate": true, "@babel/preset-env>@babel/plugin-transform-dotall-regex>@babel/helper-create-regexp-features-plugin>regexpu-core>regjsgen": true, @@ -636,6 +704,7 @@ }, "@babel/preset-env>@babel/plugin-transform-function-name": { "packages": { + "@babel/core>@babel/helper-compilation-targets": true, "@babel/preset-env>@babel/helper-plugin-utils": true, "depcheck>@babel/traverse>@babel/helper-function-name": true } @@ -694,6 +763,7 @@ }, "@babel/preset-env>@babel/plugin-transform-named-capturing-groups-regex": { "packages": { + "@babel/preset-env>@babel/helper-plugin-utils": true, "@babel/preset-env>@babel/plugin-transform-dotall-regex>@babel/helper-create-regexp-features-plugin": true } }, @@ -706,8 +776,8 @@ "@babel/preset-env>@babel/plugin-transform-object-super": { "packages": { "@babel/core": true, - "@babel/core>@babel/helper-module-transforms>@babel/helper-replace-supers": true, - "@babel/preset-env>@babel/helper-plugin-utils": true + "@babel/preset-env>@babel/helper-plugin-utils": true, + "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers": true } }, "@babel/preset-env>@babel/plugin-transform-parameters": { @@ -724,6 +794,7 @@ }, "@babel/preset-env>@babel/plugin-transform-regenerator": { "packages": { + "@babel/preset-env>@babel/helper-plugin-utils": true, "@babel/preset-env>@babel/plugin-transform-regenerator>regenerator-transform": true } }, @@ -751,8 +822,13 @@ "@babel/preset-env>@babel/plugin-transform-spread": { "packages": { "@babel/core": true, - "@babel/plugin-proposal-optional-chaining>@babel/helper-skip-transparent-expression-wrappers": true, - "@babel/preset-env>@babel/helper-plugin-utils": true + "@babel/preset-env>@babel/helper-plugin-utils": true, + "@babel/preset-env>@babel/plugin-transform-spread>@babel/helper-skip-transparent-expression-wrappers": true + } + }, + "@babel/preset-env>@babel/plugin-transform-spread>@babel/helper-skip-transparent-expression-wrappers": { + "packages": { + "@babel/core>@babel/types": true } }, "@babel/preset-env>@babel/plugin-transform-sticky-regex": { @@ -808,6 +884,7 @@ }, "@babel/preset-env>babel-plugin-polyfill-corejs3>@babel/helper-define-polyfill-provider": { "builtin": { + "module": true, "path": true }, "globals": { @@ -876,7 +953,7 @@ "@babel/preset-react>@babel/plugin-transform-react-jsx": { "packages": { "@babel/core": true, - "@babel/plugin-transform-runtime>@babel/helper-module-imports": true, + "@babel/core>@babel/helper-module-transforms>@babel/helper-module-imports": true, "@babel/preset-env>@babel/helper-plugin-utils": true, "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure": true, "@babel/preset-react>@babel/plugin-transform-react-jsx>@babel/plugin-syntax-jsx": true @@ -915,8 +992,8 @@ }, "packages": { "@babel/core": true, - "@babel/plugin-proposal-class-properties>@babel/helper-create-class-features-plugin": true, "@babel/preset-env>@babel/helper-plugin-utils": true, + "@babel/preset-env>@babel/plugin-proposal-private-methods>@babel/helper-create-class-features-plugin": true, "@babel/preset-typescript>@babel/plugin-transform-typescript>@babel/plugin-syntax-typescript": true } }, @@ -925,6 +1002,11 @@ "@babel/preset-env>@babel/helper-plugin-utils": true } }, + "@babel/register>clone-deep>is-plain-object": { + "packages": { + "gulp>gulp-cli>isobject": true + } + }, "@lavamoat/lavapack": { "builtin": { "assert": true, @@ -1075,10 +1157,11 @@ }, "@typescript-eslint/eslint-plugin": { "packages": { + "@typescript-eslint/eslint-plugin>@typescript-eslint/type-utils": true, "@typescript-eslint/eslint-plugin>tsutils": true, "@typescript-eslint/parser>@typescript-eslint/scope-manager": true, "eslint": true, - "eslint-plugin-jest>@typescript-eslint/experimental-utils": true, + "eslint-plugin-jest>@typescript-eslint/utils": true, "eslint>debug": true, "eslint>regexpp": true, "globby>ignore": true, @@ -1086,6 +1169,25 @@ "typescript": true } }, + "@typescript-eslint/eslint-plugin>@typescript-eslint/type-utils": { + "packages": { + "@typescript-eslint/eslint-plugin>@typescript-eslint/type-utils>debug": true, + "@typescript-eslint/eslint-plugin>tsutils": true, + "eslint-plugin-jest>@typescript-eslint/utils": true, + "eslint>debug": true, + "madge>debug": true, + "typescript": true + } + }, + "@typescript-eslint/eslint-plugin>@typescript-eslint/type-utils>debug": { + "globals": { + "console.debug": true, + "console.log": true + }, + "packages": { + "@typescript-eslint/eslint-plugin>@typescript-eslint/type-utils>debug>ms": true + } + }, "@typescript-eslint/eslint-plugin>tsutils": { "packages": { "@sentry/utils>tslib": true, @@ -1096,7 +1198,7 @@ "packages": { "@typescript-eslint/parser>@typescript-eslint/scope-manager": true, "@typescript-eslint/parser>@typescript-eslint/typescript-estree": true, - "eslint>debug": true, + "madge>debug": true, "typescript": true } }, @@ -1108,7 +1210,7 @@ }, "@typescript-eslint/parser>@typescript-eslint/scope-manager>@typescript-eslint/visitor-keys": { "packages": { - "@typescript-eslint/parser>@typescript-eslint/scope-manager>@typescript-eslint/visitor-keys>eslint-visitor-keys": true + "eslint>eslint-visitor-keys": true } }, "@typescript-eslint/parser>@typescript-eslint/typescript-estree": { @@ -1127,9 +1229,9 @@ "@typescript-eslint/eslint-plugin>tsutils": true, "@typescript-eslint/parser>@typescript-eslint/scope-manager>@typescript-eslint/visitor-keys": true, "@typescript-eslint/parser>@typescript-eslint/types": true, - "eslint>debug": true, "eslint>is-glob": true, "globby": true, + "madge>debug": true, "semver": true, "typescript": true } @@ -1233,6 +1335,7 @@ "fs.realpathSync": true, "fs.stat": true, "fs.statSync": true, + "os.homedir": true, "path.dirname": true, "path.join": true, "path.parse": true, @@ -1240,6 +1343,15 @@ "path.resolve": true }, "globals": { + "process.env.HOME": true, + "process.env.HOMEDRIVE": true, + "process.env.HOMEPATH": true, + "process.env.LNAME": true, + "process.env.LOGNAME": true, + "process.env.USER": true, + "process.env.USERNAME": true, + "process.env.USERPROFILE": true, + "process.getuid": true, "process.nextTick": true, "process.platform": true, "process.versions": true @@ -1275,10 +1387,15 @@ "brfs>static-module>acorn-node": { "packages": { "@storybook/addon-essentials>@storybook/addon-docs>acorn-walk": true, - "eslint>espree>acorn": true, + "brfs>static-module>acorn-node>acorn": true, "watchify>xtend": true } }, + "brfs>static-module>acorn-node>acorn": { + "globals": { + "define": true + } + }, "brfs>static-module>magic-string": { "globals": { "Buffer": true, @@ -1698,6 +1815,86 @@ "jest-canvas-mock>moo-color>color-name": true } }, + "chokidar": { + "builtin": { + "events.EventEmitter": true, + "fs.close": true, + "fs.lstat": true, + "fs.open": true, + "fs.readdir": true, + "fs.realpath": true, + "fs.stat": true, + "fs.unwatchFile": true, + "fs.watch": true, + "fs.watchFile": true, + "os.type": true, + "path.basename": true, + "path.dirname": true, + "path.extname": true, + "path.isAbsolute": true, + "path.join": true, + "path.normalize": true, + "path.relative": true, + "path.resolve": true, + "path.sep": true, + "util.promisify": true + }, + "globals": { + "clearTimeout": true, + "console.error": true, + "process.env.CHOKIDAR_INTERVAL": true, + "process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR": true, + "process.env.CHOKIDAR_USEPOLLING": true, + "process.nextTick": true, + "process.platform": true, + "process.version.match": true, + "setTimeout": true + }, + "packages": { + "chokidar>braces": true, + "chokidar>glob-parent": true, + "chokidar>is-binary-path": true, + "chokidar>normalize-path": true, + "depcheck>readdirp": true, + "eslint>is-glob": true, + "watchify>anymatch": true + } + }, + "chokidar>braces": { + "packages": { + "chokidar>braces>fill-range": true + } + }, + "chokidar>braces>fill-range": { + "builtin": { + "util.inspect": true + }, + "packages": { + "chokidar>braces>fill-range>to-regex-range": true + } + }, + "chokidar>braces>fill-range>to-regex-range": { + "packages": { + "chokidar>braces>fill-range>to-regex-range>is-number": true + } + }, + "chokidar>glob-parent": { + "builtin": { + "os.platform": true, + "path.posix.dirname": true + }, + "packages": { + "eslint>is-glob": true + } + }, + "chokidar>is-binary-path": { + "builtin": { + "path.extname": true + }, + "packages": { + "chokidar>is-binary-path>binary-extensions": true + } + }, "cross-spawn": { "builtin": { "child_process.spawn": true, @@ -1848,28 +2045,18 @@ "@babel/core>@babel/generator": true, "@babel/core>@babel/parser": true, "@babel/core>@babel/types": true, + "babel/preset-env>b@babel/types": true, "depcheck>@babel/traverse>@babel/helper-environment-visitor": true, "depcheck>@babel/traverse>@babel/helper-function-name": true, "depcheck>@babel/traverse>@babel/helper-hoist-variables": true, "depcheck>@babel/traverse>@babel/helper-split-export-declaration": true, - "depcheck>@babel/traverse>globals": true, - "eslint>debug": true - } - }, - "depcheck>@babel/traverse>@babel/helper-environment-visitor": { - "packages": { - "@babel/core>@babel/types": true + "depcheck>@babel/traverse>globals": true, + "madge>debug": true } }, "depcheck>@babel/traverse>@babel/helper-function-name": { "packages": { "@babel/core>@babel/template": true, - "@babel/core>@babel/types": true, - "depcheck>@babel/traverse>@babel/helper-function-name>@babel/helper-get-function-arity": true - } - }, - "depcheck>@babel/traverse>@babel/helper-function-name>@babel/helper-get-function-arity": { - "packages": { "@babel/core>@babel/types": true } }, @@ -1883,6 +2070,14 @@ "@babel/core>@babel/types": true } }, + "depcheck>cosmiconfig>parse-json": { + "packages": { + "@babel/code-frame": true, + "depcheck>cosmiconfig>parse-json>error-ex": true, + "depcheck>cosmiconfig>parse-json>json-parse-even-better-errors": true, + "depcheck>cosmiconfig>parse-json>lines-and-columns": true + } + }, "depcheck>cosmiconfig>parse-json>error-ex": { "builtin": { "util.inherits": true @@ -1891,6 +2086,11 @@ "depcheck>cosmiconfig>parse-json>error-ex>is-arrayish": true } }, + "depcheck>cosmiconfig>parse-json>json-parse-even-better-errors": { + "globals": { + "Buffer.isBuffer": true + } + }, "depcheck>cosmiconfig>yaml": { "globals": { "Buffer": true, @@ -1930,7 +2130,17 @@ "process.versions.node.split": true }, "packages": { - "fast-glob>picomatch": true + "depcheck>readdirp>picomatch": true + } + }, + "depcheck>readdirp>picomatch": { + "builtin": { + "path.basename": true, + "path.sep": true + }, + "globals": { + "process.platform": true, + "process.version.slice": true } }, "duplexify": { @@ -1974,10 +2184,17 @@ }, "enzyme>array.prototype.flat": { "packages": { + "enzyme>array.prototype.flat>es-shim-unscopables": true, "globalthis>define-properties": true, + "string.prototype.matchall>call-bind": true, "string.prototype.matchall>es-abstract": true } }, + "enzyme>array.prototype.flat>es-shim-unscopables": { + "packages": { + "enzyme>has": true + } + }, "enzyme>has": { "packages": { "mocha>object.assign>function-bind": true @@ -1990,16 +2207,27 @@ }, "enzyme>is-regex": { "packages": { - "string.prototype.matchall>call-bind": true, + "enzyme>is-regex>has-tostringtag": true, + "string.prototype.matchall>call-bind": true + } + }, + "enzyme>is-regex>has-tostringtag": { + "packages": { "string.prototype.matchall>has-symbols": true } }, + "enzyme>is-string": { + "packages": { + "enzyme>is-regex>has-tostringtag": true + } + }, "enzyme>object-inspect": { "builtin": { "util.inspect": true }, "globals": { - "HTMLElement": true + "HTMLElement": true, + "WeakRef": true } }, "enzyme>object.assign": { @@ -2012,7 +2240,6 @@ }, "enzyme>object.entries": { "packages": { - "enzyme>has": true, "globalthis>define-properties": true, "string.prototype.matchall>call-bind": true, "string.prototype.matchall>es-abstract": true @@ -2049,28 +2276,31 @@ }, "packages": { "eslint>@eslint/eslintrc": true, + "eslint>@humanwhocodes/config-array": true, "eslint>ajv": true, - "eslint>debug": true, "eslint>doctrine": true, + "eslint>escape-string-regexp": true, "eslint>eslint-scope": true, "eslint>eslint-utils": true, "eslint>eslint-visitor-keys": true, "eslint>espree": true, "eslint>esquery": true, "eslint>esutils": true, + "eslint>fast-deep-equal": true, "eslint>file-entry-cache": true, "eslint>functional-red-black-tree": true, "eslint>glob-parent": true, "eslint>globals": true, - "eslint>ignore": true, "eslint>imurmurhash": true, "eslint>is-glob": true, "eslint>json-stable-stringify-without-jsonify": true, "eslint>levn": true, + "eslint>lodash.merge": true, "eslint>minimatch": true, "eslint>natural-compare": true, "eslint>regexpp": true, - "lodash": true + "globby>ignore": true, + "madge>debug": true } }, "eslint-config-prettier": { @@ -2081,6 +2311,7 @@ "eslint-import-resolver-node": { "builtin": { "path.dirname": true, + "path.join": true, "path.resolve": true }, "packages": { @@ -2090,14 +2321,10 @@ }, "eslint-import-resolver-node>debug": { "builtin": { - "fs.SyncWriteStream": true, - "net.Socket": true, - "tty.WriteStream": true, "tty.isatty": true, "util": true }, "globals": { - "chrome": true, "console": true, "document": true, "localStorage": true, @@ -2105,7 +2332,8 @@ "process": true }, "packages": { - "eslint-import-resolver-node>debug>ms": true + "analytics-node>ms": true, + "sinon>supports-color": true } }, "eslint-import-resolver-typescript": { @@ -2119,8 +2347,8 @@ "packages": { "brfs>resolve": true, "eslint-plugin-import>tsconfig-paths": true, - "eslint>debug": true, "eslint>is-glob": true, + "madge>debug": true, "nyc>glob": true } }, @@ -2135,27 +2363,21 @@ "process.env": true }, "packages": { - "brfs>resolve": true, + "depcheck>is-core-module": true, "enzyme>array.prototype.flat": true, "enzyme>has": true, "enzyme>object.values": true, "eslint": true, - "eslint-plugin-import>contains-path": true, "eslint-plugin-import>debug": true, "eslint-plugin-import>doctrine": true, "eslint-plugin-import>eslint-module-utils": true, - "eslint-plugin-import>read-pkg-up": true, "eslint-plugin-import>tsconfig-paths": true, "eslint-plugin-react>array-includes": true, + "eslint>is-glob": true, "eslint>minimatch": true, "typescript": true } }, - "eslint-plugin-import>contains-path": { - "builtin": { - "path.normalize": true - } - }, "eslint-plugin-import>debug": { "builtin": { "fs.SyncWriteStream": true, @@ -2181,14 +2403,14 @@ "assert": true }, "packages": { - "eslint>esutils": true, - "readable-stream>isarray": true + "eslint>esutils": true } }, "eslint-plugin-import>eslint-module-utils": { "builtin": { "crypto.createHash": true, "fs.existsSync": true, + "fs.readFileSync": true, "fs.readdirSync": true, "module": true, "path.dirname": true, @@ -2198,7 +2420,7 @@ "path.resolve": true }, "globals": { - "__dirname": true, + "__dirname.toUpperCase": true, "console.warn": true, "process.cwd": true, "process.hrtime": true @@ -2207,19 +2429,15 @@ "@babel/eslint-parser": true, "eslint-import-resolver-node": true, "eslint-plugin-import>eslint-module-utils>debug": true, - "eslint-plugin-import>eslint-module-utils>pkg-dir": true + "eslint-plugin-import>eslint-module-utils>find-up": true } }, "eslint-plugin-import>eslint-module-utils>debug": { "builtin": { - "fs.SyncWriteStream": true, - "net.Socket": true, - "tty.WriteStream": true, "tty.isatty": true, "util": true }, "globals": { - "chrome": true, "console": true, "document": true, "localStorage": true, @@ -2227,57 +2445,11 @@ "process": true }, "packages": { - "eslint-plugin-import>eslint-module-utils>debug>ms": true - } - }, - "eslint-plugin-import>eslint-module-utils>pkg-dir": { - "builtin": { - "path.dirname": true - }, - "packages": { - "eslint-plugin-import>eslint-module-utils>pkg-dir>find-up": true - } - }, - "eslint-plugin-import>eslint-module-utils>pkg-dir>find-up": { - "builtin": { - "path.dirname": true, - "path.join": true, - "path.parse": true, - "path.resolve": true - }, - "packages": { - "eslint-plugin-import>eslint-module-utils>pkg-dir>find-up>locate-path": true - } - }, - "eslint-plugin-import>eslint-module-utils>pkg-dir>find-up>locate-path": { - "builtin": { - "path.resolve": true - }, - "globals": { - "process.cwd": true - }, - "packages": { - "eslint-plugin-import>eslint-module-utils>pkg-dir>find-up>locate-path>p-locate": true, - "mocha>find-up>locate-path>path-exists": true - } - }, - "eslint-plugin-import>eslint-module-utils>pkg-dir>find-up>locate-path>p-locate": { - "packages": { - "eslint-plugin-import>eslint-module-utils>pkg-dir>find-up>locate-path>p-locate>p-limit": true - } - }, - "eslint-plugin-import>eslint-module-utils>pkg-dir>find-up>locate-path>p-locate>p-limit": { - "packages": { - "eslint-plugin-import>eslint-module-utils>pkg-dir>find-up>locate-path>p-locate>p-limit>p-try": true - } - }, - "eslint-plugin-import>read-pkg-up": { - "packages": { - "eslint-plugin-import>read-pkg-up>find-up": true, - "eslint-plugin-import>read-pkg-up>read-pkg": true + "analytics-node>ms": true, + "sinon>supports-color": true } }, - "eslint-plugin-import>read-pkg-up>find-up": { + "eslint-plugin-import>eslint-module-utils>find-up": { "builtin": { "path.dirname": true, "path.join": true, @@ -2285,10 +2457,10 @@ "path.resolve": true }, "packages": { - "eslint-plugin-import>read-pkg-up>find-up>locate-path": true + "eslint-plugin-import>eslint-module-utils>find-up>locate-path": true } }, - "eslint-plugin-import>read-pkg-up>find-up>locate-path": { + "eslint-plugin-import>eslint-module-utils>find-up>locate-path": { "builtin": { "path.resolve": true }, @@ -2296,47 +2468,18 @@ "process.cwd": true }, "packages": { - "eslint-plugin-import>read-pkg-up>find-up>locate-path>p-locate": true, + "eslint-plugin-import>eslint-module-utils>find-up>locate-path>p-locate": true, "mocha>find-up>locate-path>path-exists": true } }, - "eslint-plugin-import>read-pkg-up>find-up>locate-path>p-locate": { - "packages": { - "eslint-plugin-import>read-pkg-up>find-up>locate-path>p-locate>p-limit": true - } - }, - "eslint-plugin-import>read-pkg-up>find-up>locate-path>p-locate>p-limit": { - "packages": { - "eslint-plugin-import>read-pkg-up>find-up>locate-path>p-locate>p-limit>p-try": true - } - }, - "eslint-plugin-import>read-pkg-up>read-pkg": { - "builtin": { - "path.join": true - }, - "packages": { - "eslint-plugin-import>read-pkg-up>read-pkg>load-json-file": true, - "eslint-plugin-import>read-pkg-up>read-pkg>path-type": true, - "stylelint>meow>normalize-package-data": true - } - }, - "eslint-plugin-import>read-pkg-up>read-pkg>load-json-file": { - "builtin": { - "path.relative": true - }, + "eslint-plugin-import>eslint-module-utils>find-up>locate-path>p-locate": { "packages": { - "eslint-plugin-import>read-pkg-up>read-pkg>load-json-file>pify": true, - "eslint-plugin-import>read-pkg-up>read-pkg>load-json-file>strip-bom": true, - "fs-extra>graceful-fs": true, - "geckodriver>got>parse-json": true + "eslint-plugin-import>eslint-module-utils>find-up>locate-path>p-locate>p-limit": true } }, - "eslint-plugin-import>read-pkg-up>read-pkg>path-type": { - "builtin": { - "fs": true - }, + "eslint-plugin-import>eslint-module-utils>find-up>locate-path>p-locate>p-limit": { "packages": { - "eslint-plugin-import>read-pkg-up>read-pkg>path-type>pify": true + "eslint-plugin-import>eslint-module-utils>find-up>locate-path>p-locate>p-limit>p-try": true } }, "eslint-plugin-import>tsconfig-paths": { @@ -2352,8 +2495,7 @@ "path.dirname": true, "path.isAbsolute": true, "path.join": true, - "path.resolve": true, - "path.sep": true + "path.resolve": true }, "globals": { "console.warn": true, @@ -2364,7 +2506,7 @@ "packages": { "eslint-plugin-import>tsconfig-paths>json5": true, "eslint-plugin-import>tsconfig-paths>strip-bom": true, - "rc>minimist": true + "patch-package>minimist": true } }, "eslint-plugin-import>tsconfig-paths>json5": { @@ -2383,7 +2525,7 @@ }, "packages": { "@typescript-eslint/eslint-plugin": true, - "eslint-plugin-jest>@typescript-eslint/experimental-utils": true + "eslint-plugin-jest>@typescript-eslint/utils": true } }, "eslint-plugin-jest>@typescript-eslint/experimental-utils": { @@ -2394,8 +2536,10 @@ "@typescript-eslint/parser>@typescript-eslint/scope-manager": true, "@typescript-eslint/parser>@typescript-eslint/types": true, "eslint": true, + "eslint-plugin-jest>@typescript-eslint/experimental-utils>@typescript-eslint/types": true, "eslint-plugin-jest>@typescript-eslint/experimental-utils>eslint-utils": true, - "eslint>eslint-scope": true + "eslint>eslint-scope": true, + "eslint>eslint-utils": true } }, "eslint-plugin-jest>@typescript-eslint/experimental-utils>eslint-utils": { @@ -2403,32 +2547,46 @@ "eslint-plugin-jest>@typescript-eslint/experimental-utils>eslint-utils>eslint-visitor-keys": true } }, + "eslint-plugin-jest>@typescript-eslint/utils": { + "builtin": { + "path": true + }, + "packages": { + "@babel/eslint-parser>eslint-scope": true, + "@typescript-eslint/parser>@typescript-eslint/scope-manager": true, + "@typescript-eslint/parser>@typescript-eslint/types": true, + "eslint": true, + "eslint-plugin-jest>@typescript-eslint/experimental-utils>@typescript-eslint/types": true, + "eslint-plugin-jest>@typescript-eslint/utils>eslint-utils": true, + "eslint>eslint-scope": true, + "eslint>eslint-utils": true + } + }, + "eslint-plugin-jest>@typescript-eslint/utils>eslint-utils": { + "packages": { + "eslint-plugin-jest>@typescript-eslint/utils>eslint-utils>eslint-visitor-keys": true + } + }, "eslint-plugin-jsdoc": { "packages": { "eslint": true, "eslint-plugin-jsdoc>@es-joy/jsdoccomment": true, "eslint-plugin-jsdoc>comment-parser": true, - "eslint-plugin-jsdoc>jsdoc-type-pratt-parser": true, - "eslint-plugin-jsdoc>regextras": true, + "eslint-plugin-jsdoc>escape-string-regexp": true, "eslint-plugin-jsdoc>spdx-expression-parse": true, - "eslint>debug": true, - "lodash": true, + "eslint>esquery": true, + "madge>debug": true, "semver": true } }, "eslint-plugin-jsdoc>@es-joy/jsdoccomment": { "packages": { + "eslint-plugin-jsdoc>@es-joy/jsdoccomment>jsdoc-type-pratt-parser": true, "eslint-plugin-jsdoc>comment-parser": true, - "eslint-plugin-jsdoc>jsdoc-type-pratt-parser": true, "eslint>esquery": true } }, - "eslint-plugin-jsdoc>jsdoc-type-pratt-parser": { - "globals": { - "define": true - } - }, - "eslint-plugin-jsdoc>regextras": { + "eslint-plugin-jsdoc>@es-joy/jsdoccomment>jsdoc-type-pratt-parser": { "globals": { "define": true } @@ -2459,18 +2617,23 @@ "packages": { "brfs>resolve": true, "eslint-plugin-node>eslint-plugin-es": true, + "eslint-plugin-node>eslint-utils": true, "eslint-plugin-node>semver": true, - "eslint>eslint-utils": true, "eslint>minimatch": true, "globby>ignore": true } }, "eslint-plugin-node>eslint-plugin-es": { "packages": { - "eslint>eslint-utils": true, + "eslint-plugin-node>eslint-utils": true, "eslint>regexpp": true } }, + "eslint-plugin-node>eslint-utils": { + "packages": { + "eslint-plugin-node>eslint-utils>eslint-visitor-keys": true + } + }, "eslint-plugin-node>semver": { "globals": { "console": true, @@ -2501,14 +2664,17 @@ "process.cwd": true }, "packages": { - "enzyme>has": true, "enzyme>object.entries": true, "enzyme>object.values": true, + "eslint": true, "eslint-plugin-react>array-includes": true, "eslint-plugin-react>array.prototype.flatmap": true, "eslint-plugin-react>doctrine": true, + "eslint-plugin-react>estraverse": true, "eslint-plugin-react>jsx-ast-utils": true, + "eslint-plugin-react>object.hasown": true, "eslint-plugin-react>resolve": true, + "eslint-plugin-react>semver": true, "eslint>minimatch": true, "lavamoat>object.fromentries": true, "prop-types": true, @@ -2523,26 +2689,15 @@ "eslint-plugin-react>array-includes": { "packages": { "enzyme>is-string": true, - "eslint-plugin-react>array-includes>get-intrinsic": true, "globalthis>define-properties": true, "string.prototype.matchall>call-bind": true, - "string.prototype.matchall>es-abstract": true - } - }, - "eslint-plugin-react>array-includes>get-intrinsic": { - "globals": { - "AggregateError": true, - "FinalizationRegistry": true, - "WeakRef": true - }, - "packages": { - "enzyme>has": true, - "mocha>object.assign>function-bind": true, - "string.prototype.matchall>has-symbols": true + "string.prototype.matchall>es-abstract": true, + "string.prototype.matchall>get-intrinsic": true } }, "eslint-plugin-react>array.prototype.flatmap": { "packages": { + "enzyme>array.prototype.flat>es-shim-unscopables": true, "globalthis>define-properties": true, "string.prototype.matchall>call-bind": true, "string.prototype.matchall>es-abstract": true @@ -2564,6 +2719,11 @@ "enzyme>object.assign": true } }, + "eslint-plugin-react>object.hasown": { + "packages": { + "string.prototype.matchall>es-abstract": true + } + }, "eslint-plugin-react>resolve": { "builtin": { "fs.readFile": true, @@ -2572,6 +2732,7 @@ "fs.realpathSync": true, "fs.stat": true, "fs.statSync": true, + "os.homedir": true, "path.dirname": true, "path.join": true, "path.parse": true, @@ -2579,6 +2740,15 @@ "path.resolve": true }, "globals": { + "process.env.HOME": true, + "process.env.HOMEDRIVE": true, + "process.env.HOMEPATH": true, + "process.env.LNAME": true, + "process.env.LOGNAME": true, + "process.env.USER": true, + "process.env.USERNAME": true, + "process.env.USERPROFILE": true, + "process.getuid": true, "process.nextTick": true, "process.platform": true }, @@ -2587,28 +2757,23 @@ "depcheck>is-core-module": true } }, + "eslint-plugin-react>semver": { + "globals": { + "console": true, + "process": true + } + }, "eslint>@eslint/eslintrc": { "builtin": { "assert": true, - "fs.existsSync": true, - "fs.readFileSync": true, - "module.createRequire": true, - "module.createRequireFromPath": true, - "os.homedir": true, - "path.basename": true, - "path.dirname": true, - "path.extname": true, - "path.isAbsolute": true, - "path.join": true, - "path.relative": true, - "path.resolve": true, - "path.sep": true, - "util.inspect": true + "fs": true, + "module": true, + "os": true, + "path": true, + "url": true, + "util": true }, "globals": { - "__dirname": true, - "process.cwd": true, - "process.emitWarning": true, "process.platform": true }, "packages": { @@ -2627,19 +2792,22 @@ "eslint-plugin-prettier": true, "eslint-plugin-react": true, "eslint-plugin-react-hooks": true, - "eslint>@eslint/eslintrc>globals": true, - "eslint>@eslint/eslintrc>ignore": true, "eslint>ajv": true, - "eslint>debug": true, - "eslint>espree": true, + "eslint>globals": true, "eslint>minimatch": true, "eslint>strip-json-comments": true, - "nyc>js-yaml": true + "globby>ignore": true, + "madge>debug": true } }, - "eslint>@eslint/eslintrc>ignore": { - "globals": { - "process": true + "eslint>@humanwhocodes/config-array": { + "builtin": { + "path": true + }, + "packages": { + "eslint>@humanwhocodes/config-array>@humanwhocodes/object-schema": true, + "eslint>minimatch": true, + "madge>debug": true } }, "eslint>ajv": { @@ -2647,10 +2815,10 @@ "console": true }, "packages": { - "@storybook/api>fast-deep-equal": true, "eslint>ajv>fast-json-stable-stringify": true, "eslint>ajv>json-schema-traverse": true, - "eslint>ajv>uri-js": true + "eslint>ajv>uri-js": true, + "eslint>fast-deep-equal": true } }, "eslint>ajv>uri-js": { @@ -2658,25 +2826,6 @@ "define": true } }, - "eslint>debug": { - "builtin": { - "tty.isatty": true, - "util.deprecate": true, - "util.format": true, - "util.inspect": true - }, - "globals": { - "console": true, - "document": true, - "localStorage": true, - "navigator": true, - "process": true - }, - "packages": { - "eslint>debug>ms": true, - "sinon>supports-color": true - } - }, "eslint>doctrine": { "builtin": { "assert": true @@ -2690,13 +2839,13 @@ "assert": true }, "packages": { - "eslint>eslint-scope>esrecurse": true, - "eslint>eslint-scope>estraverse": true + "eslint-plugin-react>estraverse": true, + "eslint>eslint-scope>esrecurse": true } }, "eslint>eslint-scope>esrecurse": { "packages": { - "eslint>esquery>estraverse": true + "eslint-plugin-react>estraverse": true } }, "eslint>eslint-utils": { @@ -2706,19 +2855,19 @@ }, "eslint>espree": { "packages": { - "eslint>espree>acorn": true, + "eslint>eslint-visitor-keys": true, "eslint>espree>acorn-jsx": true, - "eslint>espree>eslint-visitor-keys": true - } - }, - "eslint>espree>acorn": { - "globals": { - "define": true + "ts-node>acorn": true } }, "eslint>espree>acorn-jsx": { "packages": { - "eslint>espree>acorn": true + "eslint>espree>acorn-jsx>acorn": true + } + }, + "eslint>espree>acorn-jsx>acorn": { + "globals": { + "define": true } }, "eslint>esquery": { @@ -2765,11 +2914,6 @@ "eslint>is-glob": true } }, - "eslint>ignore": { - "globals": { - "process": true - } - }, "eslint>import-fresh": { "builtin": { "path.dirname": true @@ -2879,10 +3023,9 @@ "process.cwd": true }, "packages": { - "eslint>glob-parent": true, "fast-glob>@nodelib/fs.stat": true, "fast-glob>@nodelib/fs.walk": true, - "fast-glob>picomatch": true, + "fast-glob>glob-parent": true, "globby>merge2": true, "stylelint>micromatch": true } @@ -2937,14 +3080,13 @@ "fast-glob>@nodelib/fs.walk>fastq>reusify": true } }, - "fast-glob>picomatch": { + "fast-glob>glob-parent": { "builtin": { - "path.basename": true, - "path.sep": true + "os.platform": true, + "path.posix.dirname": true }, - "globals": { - "process.platform": true, - "process.version.slice": true + "packages": { + "eslint>is-glob": true } }, "fs-extra": { @@ -2988,6 +3130,7 @@ "util": true }, "globals": { + "clearTimeout": true, "console.error": true, "process": true, "setTimeout": true @@ -3004,11 +3147,6 @@ "fs-extra>graceful-fs": true } }, - "geckodriver>got>parse-json": { - "packages": { - "depcheck>cosmiconfig>parse-json>error-ex": true - } - }, "globalthis": { "packages": { "globalthis>define-properties": true @@ -3016,9 +3154,15 @@ }, "globalthis>define-properties": { "packages": { + "globalthis>define-properties>has-property-descriptors": true, "nock>deep-equal>object-keys": true } }, + "globalthis>define-properties>has-property-descriptors": { + "packages": { + "string.prototype.matchall>get-intrinsic": true + } + }, "globby": { "builtin": { "fs.Stats": true, @@ -3658,7 +3802,7 @@ }, "gulp-sourcemaps>@gulp-sourcemaps/identity-map": { "packages": { - "css-loader>normalize-path": true, + "chokidar>normalize-path": true, "gulp-sourcemaps>@gulp-sourcemaps/identity-map>acorn": true, "gulp-sourcemaps>@gulp-sourcemaps/identity-map>source-map": true, "gulp-sourcemaps>@gulp-sourcemaps/identity-map>through2": true, @@ -4087,11 +4231,11 @@ "setTimeout": true }, "packages": { + "eslint>is-glob": true, "gulp-watch>chokidar>anymatch": true, "gulp-watch>chokidar>async-each": true, "gulp-watch>chokidar>braces": true, "gulp-watch>chokidar>is-binary-path": true, - "gulp-watch>chokidar>is-glob": true, "gulp-watch>chokidar>normalize-path": true, "gulp-watch>chokidar>readdirp": true, "gulp-watch>chokidar>upath": true, @@ -4247,11 +4391,6 @@ "gulp-watch>chokidar>is-binary-path>binary-extensions": true } }, - "gulp-watch>chokidar>is-glob": { - "packages": { - "gulp-watch>chokidar>is-glob>is-extglob": true - } - }, "gulp-watch>chokidar>readdirp": { "builtin": { "path.join": true, @@ -4306,7 +4445,7 @@ }, "gulp-watch>chokidar>readdirp>micromatch>extend-shallow>is-extendable": { "packages": { - "gulp>gulp-cli>liftoff>is-plain-object": true + "@babel/register>clone-deep>is-plain-object": true } }, "gulp-watch>chokidar>readdirp>micromatch>extglob": { @@ -4563,7 +4702,7 @@ }, "gulp-zip>plugin-error>extend-shallow>is-extendable": { "packages": { - "gulp>gulp-cli>liftoff>is-plain-object": true + "@babel/register>clone-deep>is-plain-object": true } }, "gulp-zip>through2": { @@ -4679,7 +4818,7 @@ }, "gulp>glob-watcher>anymatch>micromatch>extend-shallow>is-extendable": { "packages": { - "gulp>gulp-cli>liftoff>is-plain-object": true + "@babel/register>clone-deep>is-plain-object": true } }, "gulp>glob-watcher>anymatch>normalize-path": { @@ -4696,9 +4835,14 @@ }, "packages": { "end-of-stream": true, + "gulp>glob-watcher>async-done>process-nextick-args": true, "gulp>glob-watcher>async-done>stream-exhaust": true, - "pump>once": true, - "vinyl>cloneable-readable>process-nextick-args": true + "pump>once": true + } + }, + "gulp>glob-watcher>async-done>process-nextick-args": { + "globals": { + "process": true } }, "gulp>glob-watcher>async-done>stream-exhaust": { @@ -4735,10 +4879,10 @@ "packages": { "eslint>is-glob": true, "gulp-watch>chokidar>async-each": true, + "gulp-watch>glob-parent": true, "gulp-watch>path-is-absolute": true, "gulp>glob-watcher>anymatch": true, "gulp>glob-watcher>chokidar>braces": true, - "gulp>glob-watcher>chokidar>glob-parent": true, "gulp>glob-watcher>chokidar>is-binary-path": true, "gulp>glob-watcher>chokidar>normalize-path": true, "gulp>glob-watcher>chokidar>readdirp": true, @@ -4787,21 +4931,6 @@ "webpack>micromatch>braces>fill-range>repeat-string": true } }, - "gulp>glob-watcher>chokidar>glob-parent": { - "builtin": { - "os.platform": true, - "path": true - }, - "packages": { - "gulp-watch>glob-parent>path-dirname": true, - "gulp>glob-watcher>chokidar>glob-parent>is-glob": true - } - }, - "gulp>glob-watcher>chokidar>glob-parent>is-glob": { - "packages": { - "gulp>glob-watcher>chokidar>glob-parent>is-glob>is-extglob": true - } - }, "gulp>glob-watcher>chokidar>is-binary-path": { "builtin": { "path.extname": true @@ -4836,11 +4965,6 @@ "setTimeout": true } }, - "gulp>gulp-cli>liftoff>is-plain-object": { - "packages": { - "gulp>gulp-cli>isobject": true - } - }, "gulp>gulp-cli>replace-homedir>is-absolute": { "packages": { "gulp>gulp-cli>replace-homedir>is-absolute>is-relative": true, @@ -5043,8 +5167,8 @@ "process.nextTick": true }, "packages": { + "gulp-watch>glob-parent": true, "gulp>glob-watcher>is-negated-glob": true, - "gulp>vinyl-fs>glob-stream>glob-parent": true, "gulp>vinyl-fs>glob-stream>ordered-read-streams": true, "gulp>vinyl-fs>glob-stream>pumpify": true, "gulp>vinyl-fs>glob-stream>to-absolute-glob": true, @@ -5055,21 +5179,6 @@ "vinyl>remove-trailing-separator": true } }, - "gulp>vinyl-fs>glob-stream>glob-parent": { - "builtin": { - "os.platform": true, - "path": true - }, - "packages": { - "gulp-watch>glob-parent>path-dirname": true, - "gulp>vinyl-fs>glob-stream>glob-parent>is-glob": true - } - }, - "gulp>vinyl-fs>glob-stream>glob-parent>is-glob": { - "packages": { - "gulp>vinyl-fs>glob-stream>glob-parent>is-glob>is-extglob": true - } - }, "gulp>vinyl-fs>glob-stream>ordered-read-streams": { "builtin": { "util.inherits": true @@ -5301,6 +5410,11 @@ "pump>once": true } }, + "ini": { + "globals": { + "process": true + } + }, "jsdom>escodegen": { "globals": { "sourceMap.SourceNode": true @@ -5498,11 +5612,11 @@ }, "lavamoat>lavamoat-core>merge-deep>clone-deep": { "packages": { - "gulp>gulp-cli>liftoff>is-plain-object": true, + "@babel/register>clone-deep>is-plain-object": true, "lavamoat>lavamoat-core>merge-deep>clone-deep>for-own": true, - "lavamoat>lavamoat-core>merge-deep>clone-deep>kind-of": true, "lavamoat>lavamoat-core>merge-deep>clone-deep>lazy-cache": true, - "lavamoat>lavamoat-core>merge-deep>clone-deep>shallow-clone": true + "lavamoat>lavamoat-core>merge-deep>clone-deep>shallow-clone": true, + "lavamoat>lavamoat-core>merge-deep>kind-of": true } }, "lavamoat>lavamoat-core>merge-deep>clone-deep>for-own": { @@ -5510,11 +5624,6 @@ "gulp>undertaker>object.reduce>for-own>for-in": true } }, - "lavamoat>lavamoat-core>merge-deep>clone-deep>kind-of": { - "packages": { - "browserify>insert-module-globals>is-buffer": true - } - }, "lavamoat>lavamoat-core>merge-deep>clone-deep>lazy-cache": { "globals": { "process.env.TRAVIS": true, @@ -5581,6 +5690,40 @@ "loose-envify>js-tokens": true } }, + "madge>debug": { + "builtin": { + "tty.isatty": true, + "util.deprecate": true, + "util.format": true, + "util.inspect": true + }, + "globals": { + "console": true, + "document": true, + "localStorage": true, + "navigator": true, + "process": true + }, + "packages": { + "madge>debug>ms": true, + "sinon>supports-color": true + } + }, + "madge>detective-scss>gonzales-pe": { + "globals": { + "console.error": true, + "define": true + } + }, + "madge>ora>is-unicode-supported": { + "globals": { + "process.env.CI": true, + "process.env.TERM": true, + "process.env.TERM_PROGRAM": true, + "process.env.WT_SESSION": true, + "process.platform": true + } + }, "mocha>find-up>locate-path>path-exists": { "builtin": { "fs.access": true, @@ -5625,6 +5768,11 @@ "process.platform": true } }, + "nock>deep-equal>is-date-object": { + "packages": { + "enzyme>is-regex>has-tostringtag": true + } + }, "nock>mkdirp": { "builtin": { "fs": true, @@ -5712,11 +5860,6 @@ "pump>once>wrappy": true } }, - "nyc>js-yaml": { - "globals": { - "esprima": true - } - }, "nyc>resolve-from": { "builtin": { "fs.realpathSync": true, @@ -5759,37 +5902,49 @@ "prettier": { "builtin": { "assert": true, - "events": true, + "events.EventEmitter": true, "fs": true, - "module": true, + "module._nodeModulePaths": true, + "module._resolveFilename": true, "os": true, "path": true, - "stream": true, - "tty": true, - "util": true + "stream.PassThrough": true, + "stream.Readable": true, + "util.inherits": true, + "util.inspect": true, + "util.promisify": true }, "globals": { "Buffer": true, + "Element": true, + "HTMLElement": true, "Intl": true, "PerformanceObserver": true, + "SVGElement": true, "WorkerGlobalScope": true, - "XMLHttpRequest": true, "YAML_SILENCE_DEPRECATION_WARNINGS": true, "YAML_SILENCE_WARNINGS": true, "__dirname": true, "__filename": true, + "__magic__": true, + "assertDoc": true, "atob": true, "btoa": true, "clearTimeout": true, "console": true, "define": true, "document": true, + "globalThis": "write", "localStorage": true, + "location": true, "navigator": true, + "new": true, "performance": true, "process": true, + "queueMicrotask": true, "setImmediate": true, - "setTimeout": true + "setTimeout": true, + "target": true } }, "prop-types": { @@ -5842,36 +5997,6 @@ "define": true } }, - "rc": { - "builtin": { - "fs.readFileSync": true, - "fs.statSync": true, - "path.dirname": true, - "path.join": true - }, - "globals": { - "process.argv.slice": true, - "process.cwd": true, - "process.env": true, - "process.platform": true - }, - "packages": { - "rc>deep-extend": true, - "rc>ini": true, - "rc>minimist": true, - "rc>strip-json-comments": true - } - }, - "rc>deep-extend": { - "globals": { - "Buffer": true - } - }, - "rc>ini": { - "globals": { - "process": true - } - }, "readable-stream": { "builtin": { "events.EventEmitter": true, @@ -5975,78 +6100,7 @@ "version": true }, "packages": { - "sass>chokidar": true - } - }, - "sass>chokidar": { - "builtin": { - "events.EventEmitter": true, - "fs.close": true, - "fs.lstat": true, - "fs.open": true, - "fs.readdir": true, - "fs.realpath": true, - "fs.stat": true, - "fs.unwatchFile": true, - "fs.watch": true, - "fs.watchFile": true, - "os.type": true, - "path.basename": true, - "path.dirname": true, - "path.extname": true, - "path.isAbsolute": true, - "path.join": true, - "path.normalize": true, - "path.relative": true, - "path.resolve": true, - "path.sep": true, - "util.promisify": true - }, - "globals": { - "clearTimeout": true, - "console.error": true, - "process.env.CHOKIDAR_INTERVAL": true, - "process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR": true, - "process.env.CHOKIDAR_USEPOLLING": true, - "process.nextTick": true, - "process.platform": true, - "process.version.match": true, - "setTimeout": true - }, - "packages": { - "css-loader>normalize-path": true, - "depcheck>readdirp": true, - "eslint>glob-parent": true, - "eslint>is-glob": true, - "sass>chokidar>braces": true, - "sass>chokidar>is-binary-path": true, - "watchify>anymatch": true - } - }, - "sass>chokidar>braces": { - "packages": { - "sass>chokidar>braces>fill-range": true - } - }, - "sass>chokidar>braces>fill-range": { - "builtin": { - "util.inspect": true - }, - "packages": { - "sass>chokidar>braces>fill-range>to-regex-range": true - } - }, - "sass>chokidar>braces>fill-range>to-regex-range": { - "packages": { - "sass>chokidar>braces>fill-range>to-regex-range>is-number": true - } - }, - "sass>chokidar>is-binary-path": { - "builtin": { - "path.extname": true - }, - "packages": { - "sass>chokidar>is-binary-path>binary-extensions": true + "chokidar": true } }, "semver": { @@ -6118,14 +6172,13 @@ "string.prototype.matchall>call-bind": true, "string.prototype.matchall>es-abstract": true, "string.prototype.matchall>has-symbols": true, - "string.prototype.matchall>internal-slot": true, "string.prototype.matchall>regexp.prototype.flags": true } }, "string.prototype.matchall>call-bind": { "packages": { - "eslint-plugin-react>array-includes>get-intrinsic": true, - "mocha>object.assign>function-bind": true + "mocha>object.assign>function-bind": true, + "string.prototype.matchall>get-intrinsic": true } }, "string.prototype.matchall>es-abstract": { @@ -6133,11 +6186,14 @@ "enzyme>has": true, "enzyme>is-callable": true, "enzyme>is-regex": true, + "enzyme>is-string": true, "enzyme>object-inspect": true, - "eslint-plugin-react>array-includes>get-intrinsic": true, + "globalthis>define-properties>has-property-descriptors": true, "string.prototype.matchall>call-bind": true, "string.prototype.matchall>es-abstract>es-to-primitive": true, - "string.prototype.matchall>has-symbols": true + "string.prototype.matchall>get-intrinsic": true, + "string.prototype.matchall>has-symbols": true, + "string.prototype.matchall>internal-slot": true } }, "string.prototype.matchall>es-abstract>es-to-primitive": { @@ -6147,15 +6203,28 @@ "nock>deep-equal>is-date-object": true } }, + "string.prototype.matchall>get-intrinsic": { + "globals": { + "AggregateError": true, + "FinalizationRegistry": true, + "WeakRef": true + }, + "packages": { + "enzyme>has": true, + "mocha>object.assign>function-bind": true, + "string.prototype.matchall>has-symbols": true + } + }, "string.prototype.matchall>internal-slot": { "packages": { "enzyme>has": true, - "eslint-plugin-react>array-includes>get-intrinsic": true, + "string.prototype.matchall>get-intrinsic": true, "string.prototype.matchall>side-channel": true } }, "string.prototype.matchall>regexp.prototype.flags": { "packages": { + "enzyme>function.prototype.name>functions-have-names": true, "globalthis>define-properties": true, "string.prototype.matchall>call-bind": true } @@ -6163,8 +6232,8 @@ "string.prototype.matchall>side-channel": { "packages": { "enzyme>object-inspect": true, - "eslint-plugin-react>array-includes>get-intrinsic": true, - "string.prototype.matchall>call-bind": true + "string.prototype.matchall>call-bind": true, + "string.prototype.matchall>get-intrinsic": true } }, "stylelint": { @@ -6193,12 +6262,12 @@ "process.stdout.isTTY": true }, "packages": { - "eslint>debug": true, "eslint>imurmurhash": true, "globby": true, "globby>ignore": true, "globby>slash": true, "lodash": true, + "madge>debug": true, "nyc>resolve-from": true, "stylelint>@stylelint/postcss-css-in-js": true, "stylelint>@stylelint/postcss-markdown": true, @@ -6429,18 +6498,10 @@ "process.cwd": true }, "packages": { + "depcheck>cosmiconfig>parse-json": true, "depcheck>cosmiconfig>yaml": true, "eslint>import-fresh": true, - "globby>dir-glob>path-type": true, - "stylelint>cosmiconfig>parse-json": true - } - }, - "stylelint>cosmiconfig>parse-json": { - "packages": { - "@babel/code-frame": true, - "depcheck>cosmiconfig>parse-json>error-ex": true, - "depcheck>cosmiconfig>parse-json>lines-and-columns": true, - "webpack>json-parse-better-errors": true + "globby>dir-glob>path-type": true } }, "stylelint>execall": { @@ -6538,68 +6599,29 @@ }, "packages": { "mocha>which": true, - "rc>ini": true - } - }, - "stylelint>globjoin": { - "builtin": { - "path.join": true + "stylelint>global-modules>global-prefix>ini": true } }, - "stylelint>log-symbols": { + "stylelint>global-modules>global-prefix>ini": { "globals": { - "process.env.CI": true, - "process.env.TERM": true, - "process.platform": true - }, - "packages": { - "stylelint>chalk": true - } - }, - "stylelint>meow>normalize-package-data": { - "builtin": { - "url.parse": true, - "util.format": true - }, - "packages": { - "brfs>resolve": true, - "stylelint>meow>normalize-package-data>hosted-git-info": true, - "stylelint>meow>normalize-package-data>semver": true, - "stylelint>meow>normalize-package-data>validate-npm-package-license": true + "process": true } }, - "stylelint>meow>normalize-package-data>hosted-git-info": { + "stylelint>globjoin": { "builtin": { - "url.URL": true, - "url.parse": true - } - }, - "stylelint>meow>normalize-package-data>semver": { - "globals": { - "console": true, - "process": true + "path.join": true } }, - "stylelint>meow>normalize-package-data>validate-npm-package-license": { + "stylelint>log-symbols": { "packages": { - "stylelint>meow>normalize-package-data>validate-npm-package-license>spdx-correct": true, - "stylelint>meow>normalize-package-data>validate-npm-package-license>spdx-expression-parse": true + "madge>ora>is-unicode-supported": true, + "stylelint>log-symbols>chalk": true } }, - "stylelint>meow>normalize-package-data>validate-npm-package-license>spdx-correct": { + "stylelint>log-symbols>chalk": { "packages": { - "stylelint>meow>normalize-package-data>validate-npm-package-license>spdx-correct>spdx-license-ids": true - } - }, - "stylelint>meow>normalize-package-data>validate-npm-package-license>spdx-expression-parse": { - "builtin": { - "fs.readFileSync": true, - "path.normalize": true - }, - "globals": { - "console.log": true, - "process.argv.slice": true, - "process.exit": true + "chalk>ansi-styles": true, + "sinon>supports-color": true } }, "stylelint>micromatch": { @@ -6607,8 +6629,8 @@ "util.inspect": true }, "packages": { - "fast-glob>picomatch": true, - "sass>chokidar>braces": true + "chokidar>braces": true, + "depcheck>readdirp>picomatch": true } }, "stylelint>normalize-selector": { @@ -6710,14 +6732,8 @@ }, "stylelint>postcss-sass": { "packages": { - "stylelint>postcss": true, - "stylelint>postcss-sass>gonzales-pe": true - } - }, - "stylelint>postcss-sass>gonzales-pe": { - "globals": { - "console.error": true, - "define": true + "madge>detective-scss>gonzales-pe": true, + "stylelint>postcss": true } }, "stylelint>postcss-scss": { @@ -6860,8 +6876,8 @@ "process.stdin.setEncoding": true }, "packages": { - "eslint>espree>acorn": true, - "source-map": true + "source-map": true, + "ts-node>acorn": true } }, "terser>source-map-support": { @@ -6909,6 +6925,12 @@ "pumpify>inherits": true } }, + "ts-node>acorn": { + "globals": { + "console": true, + "define": true + } + }, "tsutils": { "packages": { "tslib": true, @@ -7090,7 +7112,7 @@ "setTimeout": true }, "packages": { - "sass>chokidar": true, + "chokidar": true, "through2": true, "watchify>anymatch": true, "watchify>xtend": true @@ -7098,8 +7120,8 @@ }, "watchify>anymatch": { "packages": { - "css-loader>normalize-path": true, - "fast-glob>picomatch": true + "chokidar>normalize-path": true, + "depcheck>readdirp>picomatch": true } }, "watchify>browserify>shasum-object": { @@ -7148,7 +7170,7 @@ }, "webpack>micromatch>braces>split-string>extend-shallow>is-extendable": { "packages": { - "gulp>gulp-cli>liftoff>is-plain-object": true + "@babel/register>clone-deep>is-plain-object": true } }, "webpack>micromatch>define-property>is-descriptor": { @@ -7296,7 +7318,7 @@ }, "webpack>micromatch>nanomatch>extend-shallow>is-extendable": { "packages": { - "gulp>gulp-cli>liftoff>is-plain-object": true + "@babel/register>clone-deep>is-plain-object": true } }, "webpack>micromatch>nanomatch>is-odd": { @@ -7323,7 +7345,7 @@ }, "webpack>micromatch>regex-not>extend-shallow>is-extendable": { "packages": { - "gulp>gulp-cli>liftoff>is-plain-object": true + "@babel/register>clone-deep>is-plain-object": true } }, "webpack>micromatch>snapdragon": { @@ -7422,7 +7444,7 @@ }, "webpack>micromatch>snapdragon>base>cache-base>set-value": { "packages": { - "gulp>gulp-cli>liftoff>is-plain-object": true, + "@babel/register>clone-deep>is-plain-object": true, "webpack>micromatch>braces>split-string": true, "webpack>micromatch>extglob>extend-shallow": true, "webpack>micromatch>extglob>extend-shallow>is-extendable": true @@ -7509,7 +7531,7 @@ }, "webpack>micromatch>snapdragon>base>mixin-deep>is-extendable": { "packages": { - "gulp>gulp-cli>liftoff>is-plain-object": true + "@babel/register>clone-deep>is-plain-object": true } }, "webpack>micromatch>snapdragon>debug": { @@ -7610,7 +7632,7 @@ }, "webpack>micromatch>to-regex>extend-shallow>is-extendable": { "packages": { - "gulp>gulp-cli>liftoff>is-plain-object": true + "@babel/register>clone-deep>is-plain-object": true } }, "webpack>micromatch>to-regex>safe-regex": { diff --git a/package.json b/package.json index 534b2a971..e856ab457 100644 --- a/package.json +++ b/package.json @@ -12,14 +12,17 @@ "start": "yarn build:dev dev --apply-lavamoat=false", "start:lavamoat": "yarn build:dev dev --apply-lavamoat=true", "start:mv3": "ENABLE_MV3=true yarn build:dev dev --apply-lavamoat=false", - "dist": "yarn build prod", + "dist": "yarn build dist", "build": "yarn lavamoat:build", "build:dev": "node development/build/index.js", "start:test": "SEGMENT_HOST='https://api.segment.io' SEGMENT_WRITE_KEY='FAKE' yarn build testDev", "benchmark:chrome": "SELENIUM_BROWSER=chrome node test/e2e/benchmark.js", + "mv3:stats:chrome": "SELENIUM_BROWSER=chrome ENABLE_MV3=true node test/e2e/mv3-perf-stats/index.js", + "user-actions-benchmark:chrome": "SELENIUM_BROWSER=chrome node test/e2e/user-actions-benchmark.js", "benchmark:firefox": "SELENIUM_BROWSER=firefox node test/e2e/benchmark.js", "build:test": "SEGMENT_HOST='https://api.segment.io' SEGMENT_WRITE_KEY='FAKE' yarn build test", "build:test:flask": "yarn build test --build-type flask", + "build:test:mv3": "ENABLE_MV3=true yarn build test", "test": "yarn lint && yarn test:unit && yarn test:unit:jest", "dapp": "node development/static-server.js node_modules/@metamask/test-dapp/dist --port 8080", "dapp-chain": "GANACHE_ARGS='-b 2' concurrently -k -n ganache,dapp -p '[{time}][{name}]' 'yarn ganache:start' 'sleep 5 && yarn dapp'", @@ -70,18 +73,21 @@ "lavamoat:build": "lavamoat development/build/index.js --policy lavamoat/build-system/policy.json --policyOverride lavamoat/build-system/policy-override.json", "lavamoat:build:auto": "yarn lavamoat:build --writeAutoPolicy", "lavamoat:debug:build": "yarn lavamoat:build --writeAutoPolicyDebug --policydebug lavamoat/build-system/policy-debug.json", - "lavamoat:background:auto": "./development/generate-lavamoat-policies.sh", - "lavamoat:auto": "yarn lavamoat:build:auto && yarn lavamoat:background:auto" + "lavamoat:background:auto": "node ./development/generate-lavamoat-policies.js", + "lavamoat:background:auto:ci": "node ./development/generate-lavamoat-policies.js --parallel=false", + "lavamoat:auto": "yarn lavamoat:build:auto && yarn lavamoat:background:auto", + "lavamoat:auto:ci": "yarn lavamoat:build:auto && yarn lavamoat:background:auto:ci", + "ts-migration:enumerate": "ts-node development/ts-migration-dashboard/scripts/write-list-of-files-to-convert.ts", + "ts-migration:dashboard:watch": "ts-node development/ts-migration-dashboard/scripts/build.ts --watch", + "ts-migration:dashboard:build": "ts-node development/ts-migration-dashboard/scripts/build.ts", + "ts-migration:dashboard:deploy": "gh-pages --dist development/ts-migration-dashboard/build --remote ts-migration-dashboard" }, "resolutions": { "**/regenerator-runtime": "^0.13.7", - "**/caniuse-lite": "1.0.30001265", + "**/caniuse-lite": "^1.0.30001312", "**/cross-fetch": "^3.1.5", "**/configstore/dot-prop": "^5.1.1", "**/ethers/elliptic": "^6.5.4", - "**/knex/minimist": "^1.2.6", - "**/optimist/minimist": "^1.2.6", - "**/socketcluster/minimist": "^1.2.6", "**/redux/symbol-observable": "^2.0.3", "**/redux-devtools-instrument/symbol-observable": "^2.0.3", "**/rxjs/symbol-observable": "^2.0.3", @@ -116,8 +122,8 @@ "@keystonehq/metamask-airgapped-keyring": "0.2.1", "@material-ui/core": "^4.11.0", "@metamask/contract-metadata": "^1.31.0", - "@metamask/controllers": "^29.0.1", - "@metamask/design-tokens": "^1.6.5", + "@metamask/controllers": "^30.3.0", + "@metamask/design-tokens": "^1.9.0", "@metamask/eth-ledger-bridge-keyring": "^0.13.0", "@metamask/eth-token-tracker": "^4.0.0", "@metamask/etherscan-link": "^2.1.0", @@ -127,10 +133,10 @@ "@metamask/obs-store": "^5.0.0", "@metamask/post-message-stream": "^4.0.0", "@metamask/providers": "^9.0.0", - "@metamask/rpc-methods": "^0.16.0", + "@metamask/rpc-methods": "^0.19.0", "@metamask/slip44": "^2.1.0", - "@metamask/smart-transactions-controller": "^2.1.0", - "@metamask/snap-controllers": "^0.16.0", + "@metamask/smart-transactions-controller": "^2.3.1", + "@metamask/snap-controllers": "^0.19.0", "@ngraveio/bc-ur": "^1.1.6", "@popperjs/core": "^2.4.0", "@reduxjs/toolkit": "^1.6.2", @@ -138,6 +144,7 @@ "@sentry/integrations": "^6.0.0", "@sentry/types": "^6.0.1", "@sentry/utils": "^6.0.1", + "@spruceid/siwe-parser": "^1.1.3", "@truffle/codec": "^0.11.18", "@truffle/decoder": "^5.1.0", "@zxing/browser": "^0.0.10", @@ -170,10 +177,9 @@ "ethereumjs-abi": "^0.6.4", "ethereumjs-util": "^7.0.10", "ethereumjs-wallet": "^0.6.4", - "ethers": "^5.0.8", + "ethers": "^5.6.4", "ethjs": "^0.4.0", "ethjs-contract": "^0.2.3", - "ethjs-ens": "^2.0.0", "ethjs-query": "^0.3.4", "extension-port-stream": "^2.0.0", "fast-json-patch": "^2.2.1", @@ -235,11 +241,6 @@ "@babel/core": "^7.12.1", "@babel/eslint-parser": "^7.13.14", "@babel/eslint-plugin": "^7.12.1", - "@babel/plugin-proposal-class-properties": "^7.5.5", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4", - "@babel/plugin-proposal-object-rest-spread": "^7.5.5", - "@babel/plugin-proposal-optional-chaining": "^7.8.3", - "@babel/plugin-transform-runtime": "^7.5.5", "@babel/preset-env": "^7.5.5", "@babel/preset-react": "^7.0.0", "@babel/preset-typescript": "^7.16.7", @@ -253,8 +254,8 @@ "@metamask/eslint-config-nodejs": "^9.0.0", "@metamask/eslint-config-typescript": "^9.0.1", "@metamask/forwarder": "^1.1.0", - "@metamask/phishing-warning": "^1.1.0", - "@metamask/test-dapp": "^5.1.1", + "@metamask/phishing-warning": "^1.2.1", + "@metamask/test-dapp": "^5.2.0", "@sentry/cli": "^1.58.0", "@storybook/addon-a11y": "^6.3.12", "@storybook/addon-actions": "^6.3.12", @@ -272,11 +273,26 @@ "@testing-library/jest-dom": "^5.11.10", "@testing-library/react": "^10.4.8", "@testing-library/react-hooks": "^3.2.1", - "@testing-library/user-event": "^14.0.0-beta.12", - "@tsconfig/node14": "^1.0.1", + "@testing-library/user-event": "^14.4.3", + "@tsconfig/node16": "^1.0.3", + "@types/babelify": "^7.3.7", + "@types/browserify": "^12.0.37", + "@types/end-of-stream": "^1.4.1", + "@types/fs-extra": "^9.0.13", + "@types/gulp": "^4.0.9", + "@types/gulp-autoprefixer": "^0.0.33", + "@types/gulp-dart-sass": "^1.0.1", + "@types/gulp-sourcemaps": "^0.0.35", + "@types/madge": "^5.0.0", + "@types/node": "^17.0.21", + "@types/pify": "^5.0.1", + "@types/pump": "^1.1.1", "@types/react": "^16.9.53", - "@typescript-eslint/eslint-plugin": "^4.20.0", - "@typescript-eslint/parser": "^4.20.0", + "@types/react-dom": "^17.0.11", + "@types/watchify": "^3.11.1", + "@types/yargs": "^17.0.8", + "@typescript-eslint/eslint-plugin": "^5.30.7", + "@typescript-eslint/parser": "^5.30.7", "addons-linter": "^5.2.0", "babelify": "^10.0.0", "bify-module-groups": "^2.0.0", @@ -284,28 +300,30 @@ "browser-util-inspect": "^0.2.0", "browserify": "^16.5.1", "chalk": "^3.0.0", + "chokidar": "^3.5.3", "chromedriver": "^103.0.0", "concurrently": "^5.2.0", "copy-webpack-plugin": "^6.0.3", "cross-spawn": "^7.0.3", "css-loader": "^2.1.1", "css-to-xpath": "^0.1.0", + "csstype": "^3.0.11", "del": "^3.0.0", "depcheck": "^1.4.3", - "dependency-tree": "^8.1.1", + "dependency-tree": "^8.1.2", "duplexify": "^4.1.1", "enzyme": "^3.10.0", "enzyme-adapter-react-16": "^1.15.1", - "eslint": "^7.23.0", - "eslint-config-prettier": "^8.1.0", + "eslint": "^8.20.0", + "eslint-config-prettier": "^8.5.0", "eslint-import-resolver-node": "^0.3.4", "eslint-import-resolver-typescript": "^2.5.0", "eslint-plugin-import": "^2.22.1", - "eslint-plugin-jest": "^24.3.4", - "eslint-plugin-jsdoc": "^37.0.3", + "eslint-plugin-jest": "^26.6.0", + "eslint-plugin-jsdoc": "^39.3.3", "eslint-plugin-mocha": "^8.1.0", "eslint-plugin-node": "^11.1.0", - "eslint-plugin-prettier": "^3.3.1", + "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.23.1", "eslint-plugin-react-hooks": "^4.2.0", "fancy-log": "^1.3.3", @@ -313,6 +331,7 @@ "fs-extra": "^8.1.0", "ganache": "^v7.0.4", "geckodriver": "^1.21.0", + "gh-pages": "^3.2.3", "globby": "^11.0.4", "gulp": "^4.0.2", "gulp-autoprefixer": "^5.0.0", @@ -327,8 +346,10 @@ "gulp-zip": "^5.1.0", "history": "^5.0.0", "improved-yarn-audit": "^3.0.0", - "jest": "^26.6.3", + "ini": "^3.0.0", + "jest": "^29.0.0-alpha.5", "jest-canvas-mock": "^2.3.1", + "jest-environment-jsdom": "^29.0.0-alpha.4", "jest-it-up": "^2.0.2", "jsdom": "^11.2.0", "koa": "^2.7.0", @@ -337,6 +358,7 @@ "lavamoat-viz": "^6.0.9", "lockfile-lint": "^4.0.0", "loose-envify": "^1.4.0", + "madge": "^5.0.1", "mocha": "^7.2.0", "mockttp": "^2.6.0", "nock": "^9.0.14", @@ -344,12 +366,11 @@ "nyc": "^15.0.0", "patch-package": "^6.4.7", "polyfill-crypto.getrandomvalues": "^1.0.0", - "prettier": "^2.2.1", + "prettier": "^2.7.1", "prettier-plugin-sort-json": "^0.0.1", "proxyquire": "^2.1.3", "pumpify": "^2.0.1", "randomcolor": "^0.5.4", - "rc": "^1.2.8", "react-devtools": "^4.11.0", "read-installed": "^4.0.3", "redux-mock-store": "^1.5.4", @@ -357,7 +378,7 @@ "resolve-url-loader": "^3.1.2", "sass": "^1.32.4", "sass-loader": "^10.1.1", - "selenium-webdriver": "^4.1.0", + "selenium-webdriver": "^4.3.1", "semver": "^7.3.5", "serve-handler": "^6.1.2", "sinon": "^9.0.0", @@ -370,6 +391,7 @@ "stylelint": "^13.6.1", "terser": "^5.7.0", "through2": "^4.0.2", + "ts-node": "^10.5.0", "ttest": "^2.1.1", "typescript": "~4.4.0", "vinyl": "^2.2.1", diff --git a/patches/@babel+runtime+7.16.3.patch b/patches/@babel+runtime+7.18.9.patch similarity index 66% rename from patches/@babel+runtime+7.16.3.patch rename to patches/@babel+runtime+7.18.9.patch index eaa0fe391..77bd8d8a2 100644 --- a/patches/@babel+runtime+7.16.3.patch +++ b/patches/@babel+runtime+7.18.9.patch @@ -1,8 +1,8 @@ diff --git a/node_modules/@babel/runtime/helpers/construct.js b/node_modules/@babel/runtime/helpers/construct.js -index 108b39a..e3c769b 100644 +index ecc013d..092b29b 100644 --- a/node_modules/@babel/runtime/helpers/construct.js +++ b/node_modules/@babel/runtime/helpers/construct.js -@@ -1,26 +1,21 @@ +@@ -1,22 +1,21 @@ -var setPrototypeOf = require("./setPrototypeOf.js"); +// All of MetaMask's supported browsers include `Reflect.construct` support, so +// we don't need this polyfill. @@ -11,8 +11,7 @@ index 108b39a..e3c769b 100644 - -function _construct(Parent, args, Class) { - if (isNativeReflectConstruct()) { -- module.exports = _construct = Reflect.construct; -- module.exports["default"] = module.exports, module.exports.__esModule = true; +- module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports; - } else { - module.exports = _construct = function _construct(Parent, args, Class) { - var a = [null]; @@ -21,9 +20,7 @@ index 108b39a..e3c769b 100644 - var instance = new Constructor(); - if (Class) setPrototypeOf(instance, Class.prototype); - return instance; -- }; -- -- module.exports["default"] = module.exports, module.exports.__esModule = true; +- }, module.exports.__esModule = true, module.exports["default"] = module.exports; +// This Proxy preseves the two properties that were added by `@babel/runtime`. +// I am not entire sure what these properties are for (maybe ES5/ES6 +// interoperability?) but they have been preserved just in case. @@ -44,17 +41,17 @@ index 108b39a..e3c769b 100644 - return _construct.apply(null, arguments); -} - --module.exports = _construct; --module.exports["default"] = module.exports, module.exports.__esModule = true; +-module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file +module.exports = reflectProxy; +\ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/extends.js b/node_modules/@babel/runtime/helpers/extends.js -index eaf9547..d0474f5 100644 +index b76a654..561a078 100644 --- a/node_modules/@babel/runtime/helpers/extends.js +++ b/node_modules/@babel/runtime/helpers/extends.js -@@ -1,20 +1,5 @@ +@@ -1,18 +1,5 @@ function _extends() { -- module.exports = _extends = Object.assign || function (target) { +- module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - @@ -66,47 +63,42 @@ index eaf9547..d0474f5 100644 - } - - return target; -- }; -- -- module.exports["default"] = module.exports, module.exports.__esModule = true; +- }, module.exports.__esModule = true, module.exports["default"] = module.exports; - return _extends.apply(this, arguments); -+ return Object.assign(...arguments) ++ return Object.assign(...arguments); } - module.exports = _extends; + module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports; +\ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/getPrototypeOf.js b/node_modules/@babel/runtime/helpers/getPrototypeOf.js -index a6916eb..e01b2d6 100644 +index 259ed27..07bb963 100644 --- a/node_modules/@babel/runtime/helpers/getPrototypeOf.js +++ b/node_modules/@babel/runtime/helpers/getPrototypeOf.js -@@ -1,9 +1,5 @@ +@@ -1,8 +1,5 @@ function _getPrototypeOf(o) { -- module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { +- module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); -- }; -- module.exports["default"] = module.exports, module.exports.__esModule = true; +- }, module.exports.__esModule = true, module.exports["default"] = module.exports; - return _getPrototypeOf(o); + return Object.getPrototypeOf(o); } - module.exports = _getPrototypeOf; + module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; +\ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/setPrototypeOf.js b/node_modules/@babel/runtime/helpers/setPrototypeOf.js -index 415797b..63312f2 100644 +index ed2c1eb..da8ef36 100644 --- a/node_modules/@babel/runtime/helpers/setPrototypeOf.js +++ b/node_modules/@babel/runtime/helpers/setPrototypeOf.js -@@ -1,12 +1,7 @@ +@@ -1,9 +1,6 @@ function _setPrototypeOf(o, p) { -- module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { +- module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; -- }; -- -- module.exports["default"] = module.exports, module.exports.__esModule = true; +- }, module.exports.__esModule = true, module.exports["default"] = module.exports; - return _setPrototypeOf(o, p); --} + o.__proto__ = p; + return o; -+}; + } - module.exports = _setPrototypeOf; - module.exports["default"] = module.exports, module.exports.__esModule = true; + module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; \ No newline at end of file diff --git a/patches/@eslint+eslintrc+0.4.0.patch b/patches/@eslint+eslintrc+0.4.0.patch deleted file mode 100644 index c469c7c84..000000000 --- a/patches/@eslint+eslintrc+0.4.0.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/node_modules/@eslint/eslintrc/lib/config-array-factory.js b/node_modules/@eslint/eslintrc/lib/config-array-factory.js -index c7ff6a0..6a88c6d 100644 ---- a/node_modules/@eslint/eslintrc/lib/config-array-factory.js -+++ b/node_modules/@eslint/eslintrc/lib/config-array-factory.js -@@ -41,7 +41,6 @@ - - const fs = require("fs"); - const path = require("path"); --const importFresh = require("import-fresh"); - const stripComments = require("strip-json-comments"); - const ConfigValidator = require("./shared/config-validator"); - const naming = require("./shared/naming"); -@@ -222,7 +221,7 @@ function loadLegacyConfigFile(filePath) { - function loadJSConfigFile(filePath) { - debug(`Loading JS config file: ${filePath}`); - try { -- return importFresh(filePath); -+ return require(filePath); - } catch (e) { - debug(`Error reading JavaScript file: ${filePath}`); - e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; diff --git a/patches/@eslint+eslintrc+1.3.0.patch b/patches/@eslint+eslintrc+1.3.0.patch new file mode 100644 index 000000000..9fa0ef141 --- /dev/null +++ b/patches/@eslint+eslintrc+1.3.0.patch @@ -0,0 +1,59 @@ +diff --git a/node_modules/@eslint/eslintrc/dist/eslintrc.cjs b/node_modules/@eslint/eslintrc/dist/eslintrc.cjs +index 8b07ba1..ae54d8f 100644 +--- a/node_modules/@eslint/eslintrc/dist/eslintrc.cjs ++++ b/node_modules/@eslint/eslintrc/dist/eslintrc.cjs +@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true }); + + var debugOrig = require('debug'); + var fs = require('fs'); +-var importFresh = require('import-fresh'); + var Module = require('module'); + var path = require('path'); + var stripComments = require('strip-json-comments'); +@@ -20,7 +19,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau + + var debugOrig__default = /*#__PURE__*/_interopDefaultLegacy(debugOrig); + var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); +-var importFresh__default = /*#__PURE__*/_interopDefaultLegacy(importFresh); + var Module__default = /*#__PURE__*/_interopDefaultLegacy(Module); + var path__default = /*#__PURE__*/_interopDefaultLegacy(path); + var stripComments__default = /*#__PURE__*/_interopDefaultLegacy(stripComments); +@@ -2556,7 +2554,7 @@ function loadLegacyConfigFile(filePath) { + function loadJSConfigFile(filePath) { + debug$2(`Loading JS config file: ${filePath}`); + try { +- return importFresh__default["default"](filePath); ++ return require$1(filePath); + } catch (e) { + debug$2(`Error reading JavaScript file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; +diff --git a/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map b/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map +index 246d9f2..5c11e8d 100644 +--- a/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map ++++ b/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map +@@ -1 +1 @@ +-{"version":3,"file":"eslintrc.cjs","sources":["../lib/config-array/ignore-pattern.js","../lib/config-array/extracted-config.js","../lib/config-array/config-array.js","../lib/config-array/config-dependency.js","../lib/config-array/override-tester.js","../lib/config-array/index.js","../lib/shared/config-ops.js","../lib/shared/deprecation-warnings.js","../lib/shared/ajv.js","../conf/config-schema.js","../conf/environments.js","../lib/shared/config-validator.js","../lib/shared/naming.js","../lib/shared/relative-module-resolver.js","../lib/config-array-factory.js","../lib/cascading-config-array-factory.js","../lib/flat-compat.js","../lib/index.js"],"sourcesContent":["/**\n * @fileoverview `IgnorePattern` class.\n *\n * `IgnorePattern` class has the set of glob patterns and the base path.\n *\n * It provides two static methods.\n *\n * - `IgnorePattern.createDefaultIgnore(cwd)`\n * Create the default predicate function.\n * - `IgnorePattern.createIgnore(ignorePatterns)`\n * Create the predicate function from multiple `IgnorePattern` objects.\n *\n * It provides two properties and a method.\n *\n * - `patterns`\n * The glob patterns that ignore to lint.\n * - `basePath`\n * The base path of the glob patterns. If absolute paths existed in the\n * glob patterns, those are handled as relative paths to the base path.\n * - `getPatternsRelativeTo(basePath)`\n * Get `patterns` as modified for a given base path. It modifies the\n * absolute paths in the patterns as prepending the difference of two base\n * paths.\n *\n * `ConfigArrayFactory` creates `IgnorePattern` objects when it processes\n * `ignorePatterns` properties.\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport assert from \"assert\";\nimport path from \"path\";\nimport ignore from \"ignore\";\nimport debugOrig from \"debug\";\n\nconst debug = debugOrig(\"eslintrc:ignore-pattern\");\n\n/** @typedef {ReturnType} Ignore */\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Get the path to the common ancestor directory of given paths.\n * @param {string[]} sourcePaths The paths to calculate the common ancestor.\n * @returns {string} The path to the common ancestor directory.\n */\nfunction getCommonAncestorPath(sourcePaths) {\n let result = sourcePaths[0];\n\n for (let i = 1; i < sourcePaths.length; ++i) {\n const a = result;\n const b = sourcePaths[i];\n\n // Set the shorter one (it's the common ancestor if one includes the other).\n result = a.length < b.length ? a : b;\n\n // Set the common ancestor.\n for (let j = 0, lastSepPos = 0; j < a.length && j < b.length; ++j) {\n if (a[j] !== b[j]) {\n result = a.slice(0, lastSepPos);\n break;\n }\n if (a[j] === path.sep) {\n lastSepPos = j;\n }\n }\n }\n\n let resolvedResult = result || path.sep;\n\n // if Windows common ancestor is root of drive must have trailing slash to be absolute.\n if (resolvedResult && resolvedResult.endsWith(\":\") && process.platform === \"win32\") {\n resolvedResult += path.sep;\n }\n return resolvedResult;\n}\n\n/**\n * Make relative path.\n * @param {string} from The source path to get relative path.\n * @param {string} to The destination path to get relative path.\n * @returns {string} The relative path.\n */\nfunction relative(from, to) {\n const relPath = path.relative(from, to);\n\n if (path.sep === \"/\") {\n return relPath;\n }\n return relPath.split(path.sep).join(\"/\");\n}\n\n/**\n * Get the trailing slash if existed.\n * @param {string} filePath The path to check.\n * @returns {string} The trailing slash if existed.\n */\nfunction dirSuffix(filePath) {\n const isDir = (\n filePath.endsWith(path.sep) ||\n (process.platform === \"win32\" && filePath.endsWith(\"/\"))\n );\n\n return isDir ? \"/\" : \"\";\n}\n\nconst DefaultPatterns = Object.freeze([\"/**/node_modules/*\"]);\nconst DotPatterns = Object.freeze([\".*\", \"!.eslintrc.*\", \"!../\"]);\n\n//------------------------------------------------------------------------------\n// Public\n//------------------------------------------------------------------------------\n\nclass IgnorePattern {\n\n /**\n * The default patterns.\n * @type {string[]}\n */\n static get DefaultPatterns() {\n return DefaultPatterns;\n }\n\n /**\n * Create the default predicate function.\n * @param {string} cwd The current working directory.\n * @returns {((filePath:string, dot:boolean) => boolean) & {basePath:string; patterns:string[]}}\n * The preficate function.\n * The first argument is an absolute path that is checked.\n * The second argument is the flag to not ignore dotfiles.\n * If the predicate function returned `true`, it means the path should be ignored.\n */\n static createDefaultIgnore(cwd) {\n return this.createIgnore([new IgnorePattern(DefaultPatterns, cwd)]);\n }\n\n /**\n * Create the predicate function from multiple `IgnorePattern` objects.\n * @param {IgnorePattern[]} ignorePatterns The list of ignore patterns.\n * @returns {((filePath:string, dot?:boolean) => boolean) & {basePath:string; patterns:string[]}}\n * The preficate function.\n * The first argument is an absolute path that is checked.\n * The second argument is the flag to not ignore dotfiles.\n * If the predicate function returned `true`, it means the path should be ignored.\n */\n static createIgnore(ignorePatterns) {\n debug(\"Create with: %o\", ignorePatterns);\n\n const basePath = getCommonAncestorPath(ignorePatterns.map(p => p.basePath));\n const patterns = [].concat(\n ...ignorePatterns.map(p => p.getPatternsRelativeTo(basePath))\n );\n const ig = ignore({ allowRelativePaths: true }).add([...DotPatterns, ...patterns]);\n const dotIg = ignore({ allowRelativePaths: true }).add(patterns);\n\n debug(\" processed: %o\", { basePath, patterns });\n\n return Object.assign(\n (filePath, dot = false) => {\n assert(path.isAbsolute(filePath), \"'filePath' should be an absolute path.\");\n const relPathRaw = relative(basePath, filePath);\n const relPath = relPathRaw && (relPathRaw + dirSuffix(filePath));\n const adoptedIg = dot ? dotIg : ig;\n const result = relPath !== \"\" && adoptedIg.ignores(relPath);\n\n debug(\"Check\", { filePath, dot, relativePath: relPath, result });\n return result;\n },\n { basePath, patterns }\n );\n }\n\n /**\n * Initialize a new `IgnorePattern` instance.\n * @param {string[]} patterns The glob patterns that ignore to lint.\n * @param {string} basePath The base path of `patterns`.\n */\n constructor(patterns, basePath) {\n assert(path.isAbsolute(basePath), \"'basePath' should be an absolute path.\");\n\n /**\n * The glob patterns that ignore to lint.\n * @type {string[]}\n */\n this.patterns = patterns;\n\n /**\n * The base path of `patterns`.\n * @type {string}\n */\n this.basePath = basePath;\n\n /**\n * If `true` then patterns which don't start with `/` will match the paths to the outside of `basePath`. Defaults to `false`.\n *\n * It's set `true` for `.eslintignore`, `package.json`, and `--ignore-path` for backward compatibility.\n * It's `false` as-is for `ignorePatterns` property in config files.\n * @type {boolean}\n */\n this.loose = false;\n }\n\n /**\n * Get `patterns` as modified for a given base path. It modifies the\n * absolute paths in the patterns as prepending the difference of two base\n * paths.\n * @param {string} newBasePath The base path.\n * @returns {string[]} Modifired patterns.\n */\n getPatternsRelativeTo(newBasePath) {\n assert(path.isAbsolute(newBasePath), \"'newBasePath' should be an absolute path.\");\n const { basePath, loose, patterns } = this;\n\n if (newBasePath === basePath) {\n return patterns;\n }\n const prefix = `/${relative(newBasePath, basePath)}`;\n\n return patterns.map(pattern => {\n const negative = pattern.startsWith(\"!\");\n const head = negative ? \"!\" : \"\";\n const body = negative ? pattern.slice(1) : pattern;\n\n if (body.startsWith(\"/\") || body.startsWith(\"../\")) {\n return `${head}${prefix}${body}`;\n }\n return loose ? pattern : `${head}${prefix}/**/${body}`;\n });\n }\n}\n\nexport { IgnorePattern };\n","/**\n * @fileoverview `ExtractedConfig` class.\n *\n * `ExtractedConfig` class expresses a final configuration for a specific file.\n *\n * It provides one method.\n *\n * - `toCompatibleObjectAsConfigFileContent()`\n * Convert this configuration to the compatible object as the content of\n * config files. It converts the loaded parser and plugins to strings.\n * `CLIEngine#getConfigForFile(filePath)` method uses this method.\n *\n * `ConfigArray#extractConfig(filePath)` creates a `ExtractedConfig` instance.\n *\n * @author Toru Nagashima \n */\n\nimport { IgnorePattern } from \"./ignore-pattern.js\";\n\n// For VSCode intellisense\n/** @typedef {import(\"../../shared/types\").ConfigData} ConfigData */\n/** @typedef {import(\"../../shared/types\").GlobalConf} GlobalConf */\n/** @typedef {import(\"../../shared/types\").SeverityConf} SeverityConf */\n/** @typedef {import(\"./config-dependency\").DependentParser} DependentParser */\n/** @typedef {import(\"./config-dependency\").DependentPlugin} DependentPlugin */\n\n/**\n * Check if `xs` starts with `ys`.\n * @template T\n * @param {T[]} xs The array to check.\n * @param {T[]} ys The array that may be the first part of `xs`.\n * @returns {boolean} `true` if `xs` starts with `ys`.\n */\nfunction startsWith(xs, ys) {\n return xs.length >= ys.length && ys.every((y, i) => y === xs[i]);\n}\n\n/**\n * The class for extracted config data.\n */\nclass ExtractedConfig {\n constructor() {\n\n /**\n * The config name what `noInlineConfig` setting came from.\n * @type {string}\n */\n this.configNameOfNoInlineConfig = \"\";\n\n /**\n * Environments.\n * @type {Record}\n */\n this.env = {};\n\n /**\n * Global variables.\n * @type {Record}\n */\n this.globals = {};\n\n /**\n * The glob patterns that ignore to lint.\n * @type {(((filePath:string, dot?:boolean) => boolean) & { basePath:string; patterns:string[] }) | undefined}\n */\n this.ignores = void 0;\n\n /**\n * The flag that disables directive comments.\n * @type {boolean|undefined}\n */\n this.noInlineConfig = void 0;\n\n /**\n * Parser definition.\n * @type {DependentParser|null}\n */\n this.parser = null;\n\n /**\n * Options for the parser.\n * @type {Object}\n */\n this.parserOptions = {};\n\n /**\n * Plugin definitions.\n * @type {Record}\n */\n this.plugins = {};\n\n /**\n * Processor ID.\n * @type {string|null}\n */\n this.processor = null;\n\n /**\n * The flag that reports unused `eslint-disable` directive comments.\n * @type {boolean|undefined}\n */\n this.reportUnusedDisableDirectives = void 0;\n\n /**\n * Rule settings.\n * @type {Record}\n */\n this.rules = {};\n\n /**\n * Shared settings.\n * @type {Object}\n */\n this.settings = {};\n }\n\n /**\n * Convert this config to the compatible object as a config file content.\n * @returns {ConfigData} The converted object.\n */\n toCompatibleObjectAsConfigFileContent() {\n const {\n /* eslint-disable no-unused-vars */\n configNameOfNoInlineConfig: _ignore1,\n processor: _ignore2,\n /* eslint-enable no-unused-vars */\n ignores,\n ...config\n } = this;\n\n config.parser = config.parser && config.parser.filePath;\n config.plugins = Object.keys(config.plugins).filter(Boolean).reverse();\n config.ignorePatterns = ignores ? ignores.patterns : [];\n\n // Strip the default patterns from `ignorePatterns`.\n if (startsWith(config.ignorePatterns, IgnorePattern.DefaultPatterns)) {\n config.ignorePatterns =\n config.ignorePatterns.slice(IgnorePattern.DefaultPatterns.length);\n }\n\n return config;\n }\n}\n\nexport { ExtractedConfig };\n","/**\n * @fileoverview `ConfigArray` class.\n *\n * `ConfigArray` class expresses the full of a configuration. It has the entry\n * config file, base config files that were extended, loaded parsers, and loaded\n * plugins.\n *\n * `ConfigArray` class provides three properties and two methods.\n *\n * - `pluginEnvironments`\n * - `pluginProcessors`\n * - `pluginRules`\n * The `Map` objects that contain the members of all plugins that this\n * config array contains. Those map objects don't have mutation methods.\n * Those keys are the member ID such as `pluginId/memberName`.\n * - `isRoot()`\n * If `true` then this configuration has `root:true` property.\n * - `extractConfig(filePath)`\n * Extract the final configuration for a given file. This means merging\n * every config array element which that `criteria` property matched. The\n * `filePath` argument must be an absolute path.\n *\n * `ConfigArrayFactory` provides the loading logic of config files.\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport { ExtractedConfig } from \"./extracted-config.js\";\nimport { IgnorePattern } from \"./ignore-pattern.js\";\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n// Define types for VSCode IntelliSense.\n/** @typedef {import(\"../../shared/types\").Environment} Environment */\n/** @typedef {import(\"../../shared/types\").GlobalConf} GlobalConf */\n/** @typedef {import(\"../../shared/types\").RuleConf} RuleConf */\n/** @typedef {import(\"../../shared/types\").Rule} Rule */\n/** @typedef {import(\"../../shared/types\").Plugin} Plugin */\n/** @typedef {import(\"../../shared/types\").Processor} Processor */\n/** @typedef {import(\"./config-dependency\").DependentParser} DependentParser */\n/** @typedef {import(\"./config-dependency\").DependentPlugin} DependentPlugin */\n/** @typedef {import(\"./override-tester\")[\"OverrideTester\"]} OverrideTester */\n\n/**\n * @typedef {Object} ConfigArrayElement\n * @property {string} name The name of this config element.\n * @property {string} filePath The path to the source file of this config element.\n * @property {InstanceType|null} criteria The tester for the `files` and `excludedFiles` of this config element.\n * @property {Record|undefined} env The environment settings.\n * @property {Record|undefined} globals The global variable settings.\n * @property {IgnorePattern|undefined} ignorePattern The ignore patterns.\n * @property {boolean|undefined} noInlineConfig The flag that disables directive comments.\n * @property {DependentParser|undefined} parser The parser loader.\n * @property {Object|undefined} parserOptions The parser options.\n * @property {Record|undefined} plugins The plugin loaders.\n * @property {string|undefined} processor The processor name to refer plugin's processor.\n * @property {boolean|undefined} reportUnusedDisableDirectives The flag to report unused `eslint-disable` comments.\n * @property {boolean|undefined} root The flag to express root.\n * @property {Record|undefined} rules The rule settings\n * @property {Object|undefined} settings The shared settings.\n * @property {\"config\" | \"ignore\" | \"implicit-processor\"} type The element type.\n */\n\n/**\n * @typedef {Object} ConfigArrayInternalSlots\n * @property {Map} cache The cache to extract configs.\n * @property {ReadonlyMap|null} envMap The map from environment ID to environment definition.\n * @property {ReadonlyMap|null} processorMap The map from processor ID to environment definition.\n * @property {ReadonlyMap|null} ruleMap The map from rule ID to rule definition.\n */\n\n/** @type {WeakMap} */\nconst internalSlotsMap = new class extends WeakMap {\n get(key) {\n let value = super.get(key);\n\n if (!value) {\n value = {\n cache: new Map(),\n envMap: null,\n processorMap: null,\n ruleMap: null\n };\n super.set(key, value);\n }\n\n return value;\n }\n}();\n\n/**\n * Get the indices which are matched to a given file.\n * @param {ConfigArrayElement[]} elements The elements.\n * @param {string} filePath The path to a target file.\n * @returns {number[]} The indices.\n */\nfunction getMatchedIndices(elements, filePath) {\n const indices = [];\n\n for (let i = elements.length - 1; i >= 0; --i) {\n const element = elements[i];\n\n if (!element.criteria || (filePath && element.criteria.test(filePath))) {\n indices.push(i);\n }\n }\n\n return indices;\n}\n\n/**\n * Check if a value is a non-null object.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is a non-null object.\n */\nfunction isNonNullObject(x) {\n return typeof x === \"object\" && x !== null;\n}\n\n/**\n * Merge two objects.\n *\n * Assign every property values of `y` to `x` if `x` doesn't have the property.\n * If `x`'s property value is an object, it does recursive.\n * @param {Object} target The destination to merge\n * @param {Object|undefined} source The source to merge.\n * @returns {void}\n */\nfunction mergeWithoutOverwrite(target, source) {\n if (!isNonNullObject(source)) {\n return;\n }\n\n for (const key of Object.keys(source)) {\n if (key === \"__proto__\") {\n continue;\n }\n\n if (isNonNullObject(target[key])) {\n mergeWithoutOverwrite(target[key], source[key]);\n } else if (target[key] === void 0) {\n if (isNonNullObject(source[key])) {\n target[key] = Array.isArray(source[key]) ? [] : {};\n mergeWithoutOverwrite(target[key], source[key]);\n } else if (source[key] !== void 0) {\n target[key] = source[key];\n }\n }\n }\n}\n\n/**\n * The error for plugin conflicts.\n */\nclass PluginConflictError extends Error {\n\n /**\n * Initialize this error object.\n * @param {string} pluginId The plugin ID.\n * @param {{filePath:string, importerName:string}[]} plugins The resolved plugins.\n */\n constructor(pluginId, plugins) {\n super(`Plugin \"${pluginId}\" was conflicted between ${plugins.map(p => `\"${p.importerName}\"`).join(\" and \")}.`);\n this.messageTemplate = \"plugin-conflict\";\n this.messageData = { pluginId, plugins };\n }\n}\n\n/**\n * Merge plugins.\n * `target`'s definition is prior to `source`'s.\n * @param {Record} target The destination to merge\n * @param {Record|undefined} source The source to merge.\n * @returns {void}\n */\nfunction mergePlugins(target, source) {\n if (!isNonNullObject(source)) {\n return;\n }\n\n for (const key of Object.keys(source)) {\n if (key === \"__proto__\") {\n continue;\n }\n const targetValue = target[key];\n const sourceValue = source[key];\n\n // Adopt the plugin which was found at first.\n if (targetValue === void 0) {\n if (sourceValue.error) {\n throw sourceValue.error;\n }\n target[key] = sourceValue;\n } else if (sourceValue.filePath !== targetValue.filePath) {\n throw new PluginConflictError(key, [\n {\n filePath: targetValue.filePath,\n importerName: targetValue.importerName\n },\n {\n filePath: sourceValue.filePath,\n importerName: sourceValue.importerName\n }\n ]);\n }\n }\n}\n\n/**\n * Merge rule configs.\n * `target`'s definition is prior to `source`'s.\n * @param {Record} target The destination to merge\n * @param {Record|undefined} source The source to merge.\n * @returns {void}\n */\nfunction mergeRuleConfigs(target, source) {\n if (!isNonNullObject(source)) {\n return;\n }\n\n for (const key of Object.keys(source)) {\n if (key === \"__proto__\") {\n continue;\n }\n const targetDef = target[key];\n const sourceDef = source[key];\n\n // Adopt the rule config which was found at first.\n if (targetDef === void 0) {\n if (Array.isArray(sourceDef)) {\n target[key] = [...sourceDef];\n } else {\n target[key] = [sourceDef];\n }\n\n /*\n * If the first found rule config is severity only and the current rule\n * config has options, merge the severity and the options.\n */\n } else if (\n targetDef.length === 1 &&\n Array.isArray(sourceDef) &&\n sourceDef.length >= 2\n ) {\n targetDef.push(...sourceDef.slice(1));\n }\n }\n}\n\n/**\n * Create the extracted config.\n * @param {ConfigArray} instance The config elements.\n * @param {number[]} indices The indices to use.\n * @returns {ExtractedConfig} The extracted config.\n */\nfunction createConfig(instance, indices) {\n const config = new ExtractedConfig();\n const ignorePatterns = [];\n\n // Merge elements.\n for (const index of indices) {\n const element = instance[index];\n\n // Adopt the parser which was found at first.\n if (!config.parser && element.parser) {\n if (element.parser.error) {\n throw element.parser.error;\n }\n config.parser = element.parser;\n }\n\n // Adopt the processor which was found at first.\n if (!config.processor && element.processor) {\n config.processor = element.processor;\n }\n\n // Adopt the noInlineConfig which was found at first.\n if (config.noInlineConfig === void 0 && element.noInlineConfig !== void 0) {\n config.noInlineConfig = element.noInlineConfig;\n config.configNameOfNoInlineConfig = element.name;\n }\n\n // Adopt the reportUnusedDisableDirectives which was found at first.\n if (config.reportUnusedDisableDirectives === void 0 && element.reportUnusedDisableDirectives !== void 0) {\n config.reportUnusedDisableDirectives = element.reportUnusedDisableDirectives;\n }\n\n // Collect ignorePatterns\n if (element.ignorePattern) {\n ignorePatterns.push(element.ignorePattern);\n }\n\n // Merge others.\n mergeWithoutOverwrite(config.env, element.env);\n mergeWithoutOverwrite(config.globals, element.globals);\n mergeWithoutOverwrite(config.parserOptions, element.parserOptions);\n mergeWithoutOverwrite(config.settings, element.settings);\n mergePlugins(config.plugins, element.plugins);\n mergeRuleConfigs(config.rules, element.rules);\n }\n\n // Create the predicate function for ignore patterns.\n if (ignorePatterns.length > 0) {\n config.ignores = IgnorePattern.createIgnore(ignorePatterns.reverse());\n }\n\n return config;\n}\n\n/**\n * Collect definitions.\n * @template T, U\n * @param {string} pluginId The plugin ID for prefix.\n * @param {Record} defs The definitions to collect.\n * @param {Map} map The map to output.\n * @param {function(T): U} [normalize] The normalize function for each value.\n * @returns {void}\n */\nfunction collect(pluginId, defs, map, normalize) {\n if (defs) {\n const prefix = pluginId && `${pluginId}/`;\n\n for (const [key, value] of Object.entries(defs)) {\n map.set(\n `${prefix}${key}`,\n normalize ? normalize(value) : value\n );\n }\n }\n}\n\n/**\n * Normalize a rule definition.\n * @param {Function|Rule} rule The rule definition to normalize.\n * @returns {Rule} The normalized rule definition.\n */\nfunction normalizePluginRule(rule) {\n return typeof rule === \"function\" ? { create: rule } : rule;\n}\n\n/**\n * Delete the mutation methods from a given map.\n * @param {Map} map The map object to delete.\n * @returns {void}\n */\nfunction deleteMutationMethods(map) {\n Object.defineProperties(map, {\n clear: { configurable: true, value: void 0 },\n delete: { configurable: true, value: void 0 },\n set: { configurable: true, value: void 0 }\n });\n}\n\n/**\n * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array.\n * @param {ConfigArrayElement[]} elements The config elements.\n * @param {ConfigArrayInternalSlots} slots The internal slots.\n * @returns {void}\n */\nfunction initPluginMemberMaps(elements, slots) {\n const processed = new Set();\n\n slots.envMap = new Map();\n slots.processorMap = new Map();\n slots.ruleMap = new Map();\n\n for (const element of elements) {\n if (!element.plugins) {\n continue;\n }\n\n for (const [pluginId, value] of Object.entries(element.plugins)) {\n const plugin = value.definition;\n\n if (!plugin || processed.has(pluginId)) {\n continue;\n }\n processed.add(pluginId);\n\n collect(pluginId, plugin.environments, slots.envMap);\n collect(pluginId, plugin.processors, slots.processorMap);\n collect(pluginId, plugin.rules, slots.ruleMap, normalizePluginRule);\n }\n }\n\n deleteMutationMethods(slots.envMap);\n deleteMutationMethods(slots.processorMap);\n deleteMutationMethods(slots.ruleMap);\n}\n\n/**\n * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array.\n * @param {ConfigArray} instance The config elements.\n * @returns {ConfigArrayInternalSlots} The extracted config.\n */\nfunction ensurePluginMemberMaps(instance) {\n const slots = internalSlotsMap.get(instance);\n\n if (!slots.ruleMap) {\n initPluginMemberMaps(instance, slots);\n }\n\n return slots;\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * The Config Array.\n *\n * `ConfigArray` instance contains all settings, parsers, and plugins.\n * You need to call `ConfigArray#extractConfig(filePath)` method in order to\n * extract, merge and get only the config data which is related to an arbitrary\n * file.\n * @extends {Array}\n */\nclass ConfigArray extends Array {\n\n /**\n * Get the plugin environments.\n * The returned map cannot be mutated.\n * @type {ReadonlyMap} The plugin environments.\n */\n get pluginEnvironments() {\n return ensurePluginMemberMaps(this).envMap;\n }\n\n /**\n * Get the plugin processors.\n * The returned map cannot be mutated.\n * @type {ReadonlyMap} The plugin processors.\n */\n get pluginProcessors() {\n return ensurePluginMemberMaps(this).processorMap;\n }\n\n /**\n * Get the plugin rules.\n * The returned map cannot be mutated.\n * @returns {ReadonlyMap} The plugin rules.\n */\n get pluginRules() {\n return ensurePluginMemberMaps(this).ruleMap;\n }\n\n /**\n * Check if this config has `root` flag.\n * @returns {boolean} `true` if this config array is root.\n */\n isRoot() {\n for (let i = this.length - 1; i >= 0; --i) {\n const root = this[i].root;\n\n if (typeof root === \"boolean\") {\n return root;\n }\n }\n return false;\n }\n\n /**\n * Extract the config data which is related to a given file.\n * @param {string} filePath The absolute path to the target file.\n * @returns {ExtractedConfig} The extracted config data.\n */\n extractConfig(filePath) {\n const { cache } = internalSlotsMap.get(this);\n const indices = getMatchedIndices(this, filePath);\n const cacheKey = indices.join(\",\");\n\n if (!cache.has(cacheKey)) {\n cache.set(cacheKey, createConfig(this, indices));\n }\n\n return cache.get(cacheKey);\n }\n\n /**\n * Check if a given path is an additional lint target.\n * @param {string} filePath The absolute path to the target file.\n * @returns {boolean} `true` if the file is an additional lint target.\n */\n isAdditionalTargetPath(filePath) {\n for (const { criteria, type } of this) {\n if (\n type === \"config\" &&\n criteria &&\n !criteria.endsWithWildcard &&\n criteria.test(filePath)\n ) {\n return true;\n }\n }\n return false;\n }\n}\n\n/**\n * Get the used extracted configs.\n * CLIEngine will use this method to collect used deprecated rules.\n * @param {ConfigArray} instance The config array object to get.\n * @returns {ExtractedConfig[]} The used extracted configs.\n * @private\n */\nfunction getUsedExtractedConfigs(instance) {\n const { cache } = internalSlotsMap.get(instance);\n\n return Array.from(cache.values());\n}\n\n\nexport {\n ConfigArray,\n getUsedExtractedConfigs\n};\n","/**\n * @fileoverview `ConfigDependency` class.\n *\n * `ConfigDependency` class expresses a loaded parser or plugin.\n *\n * If the parser or plugin was loaded successfully, it has `definition` property\n * and `filePath` property. Otherwise, it has `error` property.\n *\n * When `JSON.stringify()` converted a `ConfigDependency` object to a JSON, it\n * omits `definition` property.\n *\n * `ConfigArrayFactory` creates `ConfigDependency` objects when it loads parsers\n * or plugins.\n *\n * @author Toru Nagashima \n */\n\nimport util from \"util\";\n\n/**\n * The class is to store parsers or plugins.\n * This class hides the loaded object from `JSON.stringify()` and `console.log`.\n * @template T\n */\nclass ConfigDependency {\n\n /**\n * Initialize this instance.\n * @param {Object} data The dependency data.\n * @param {T} [data.definition] The dependency if the loading succeeded.\n * @param {Error} [data.error] The error object if the loading failed.\n * @param {string} [data.filePath] The actual path to the dependency if the loading succeeded.\n * @param {string} data.id The ID of this dependency.\n * @param {string} data.importerName The name of the config file which loads this dependency.\n * @param {string} data.importerPath The path to the config file which loads this dependency.\n */\n constructor({\n definition = null,\n error = null,\n filePath = null,\n id,\n importerName,\n importerPath\n }) {\n\n /**\n * The loaded dependency if the loading succeeded.\n * @type {T|null}\n */\n this.definition = definition;\n\n /**\n * The error object if the loading failed.\n * @type {Error|null}\n */\n this.error = error;\n\n /**\n * The loaded dependency if the loading succeeded.\n * @type {string|null}\n */\n this.filePath = filePath;\n\n /**\n * The ID of this dependency.\n * @type {string}\n */\n this.id = id;\n\n /**\n * The name of the config file which loads this dependency.\n * @type {string}\n */\n this.importerName = importerName;\n\n /**\n * The path to the config file which loads this dependency.\n * @type {string}\n */\n this.importerPath = importerPath;\n }\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @returns {Object} a JSON compatible object.\n */\n toJSON() {\n const obj = this[util.inspect.custom]();\n\n // Display `error.message` (`Error#message` is unenumerable).\n if (obj.error instanceof Error) {\n obj.error = { ...obj.error, message: obj.error.message };\n }\n\n return obj;\n }\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @returns {Object} an object to display by `console.log()`.\n */\n [util.inspect.custom]() {\n const {\n definition: _ignore, // eslint-disable-line no-unused-vars\n ...obj\n } = this;\n\n return obj;\n }\n}\n\n/** @typedef {ConfigDependency} DependentParser */\n/** @typedef {ConfigDependency} DependentPlugin */\n\nexport { ConfigDependency };\n","/**\n * @fileoverview `OverrideTester` class.\n *\n * `OverrideTester` class handles `files` property and `excludedFiles` property\n * of `overrides` config.\n *\n * It provides one method.\n *\n * - `test(filePath)`\n * Test if a file path matches the pair of `files` property and\n * `excludedFiles` property. The `filePath` argument must be an absolute\n * path.\n *\n * `ConfigArrayFactory` creates `OverrideTester` objects when it processes\n * `overrides` properties.\n *\n * @author Toru Nagashima \n */\n\nimport assert from \"assert\";\nimport path from \"path\";\nimport util from \"util\";\nimport minimatch from \"minimatch\";\n\nconst { Minimatch } = minimatch;\n\nconst minimatchOpts = { dot: true, matchBase: true };\n\n/**\n * @typedef {Object} Pattern\n * @property {InstanceType[] | null} includes The positive matchers.\n * @property {InstanceType[] | null} excludes The negative matchers.\n */\n\n/**\n * Normalize a given pattern to an array.\n * @param {string|string[]|undefined} patterns A glob pattern or an array of glob patterns.\n * @returns {string[]|null} Normalized patterns.\n * @private\n */\nfunction normalizePatterns(patterns) {\n if (Array.isArray(patterns)) {\n return patterns.filter(Boolean);\n }\n if (typeof patterns === \"string\" && patterns) {\n return [patterns];\n }\n return [];\n}\n\n/**\n * Create the matchers of given patterns.\n * @param {string[]} patterns The patterns.\n * @returns {InstanceType[] | null} The matchers.\n */\nfunction toMatcher(patterns) {\n if (patterns.length === 0) {\n return null;\n }\n return patterns.map(pattern => {\n if (/^\\.[/\\\\]/u.test(pattern)) {\n return new Minimatch(\n pattern.slice(2),\n\n // `./*.js` should not match with `subdir/foo.js`\n { ...minimatchOpts, matchBase: false }\n );\n }\n return new Minimatch(pattern, minimatchOpts);\n });\n}\n\n/**\n * Convert a given matcher to string.\n * @param {Pattern} matchers The matchers.\n * @returns {string} The string expression of the matcher.\n */\nfunction patternToJson({ includes, excludes }) {\n return {\n includes: includes && includes.map(m => m.pattern),\n excludes: excludes && excludes.map(m => m.pattern)\n };\n}\n\n/**\n * The class to test given paths are matched by the patterns.\n */\nclass OverrideTester {\n\n /**\n * Create a tester with given criteria.\n * If there are no criteria, returns `null`.\n * @param {string|string[]} files The glob patterns for included files.\n * @param {string|string[]} excludedFiles The glob patterns for excluded files.\n * @param {string} basePath The path to the base directory to test paths.\n * @returns {OverrideTester|null} The created instance or `null`.\n */\n static create(files, excludedFiles, basePath) {\n const includePatterns = normalizePatterns(files);\n const excludePatterns = normalizePatterns(excludedFiles);\n let endsWithWildcard = false;\n\n if (includePatterns.length === 0) {\n return null;\n }\n\n // Rejects absolute paths or relative paths to parents.\n for (const pattern of includePatterns) {\n if (path.isAbsolute(pattern) || pattern.includes(\"..\")) {\n throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`);\n }\n if (pattern.endsWith(\"*\")) {\n endsWithWildcard = true;\n }\n }\n for (const pattern of excludePatterns) {\n if (path.isAbsolute(pattern) || pattern.includes(\"..\")) {\n throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`);\n }\n }\n\n const includes = toMatcher(includePatterns);\n const excludes = toMatcher(excludePatterns);\n\n return new OverrideTester(\n [{ includes, excludes }],\n basePath,\n endsWithWildcard\n );\n }\n\n /**\n * Combine two testers by logical and.\n * If either of the testers was `null`, returns the other tester.\n * The `basePath` property of the two must be the same value.\n * @param {OverrideTester|null} a A tester.\n * @param {OverrideTester|null} b Another tester.\n * @returns {OverrideTester|null} Combined tester.\n */\n static and(a, b) {\n if (!b) {\n return a && new OverrideTester(\n a.patterns,\n a.basePath,\n a.endsWithWildcard\n );\n }\n if (!a) {\n return new OverrideTester(\n b.patterns,\n b.basePath,\n b.endsWithWildcard\n );\n }\n\n assert.strictEqual(a.basePath, b.basePath);\n return new OverrideTester(\n a.patterns.concat(b.patterns),\n a.basePath,\n a.endsWithWildcard || b.endsWithWildcard\n );\n }\n\n /**\n * Initialize this instance.\n * @param {Pattern[]} patterns The matchers.\n * @param {string} basePath The base path.\n * @param {boolean} endsWithWildcard If `true` then a pattern ends with `*`.\n */\n constructor(patterns, basePath, endsWithWildcard = false) {\n\n /** @type {Pattern[]} */\n this.patterns = patterns;\n\n /** @type {string} */\n this.basePath = basePath;\n\n /** @type {boolean} */\n this.endsWithWildcard = endsWithWildcard;\n }\n\n /**\n * Test if a given path is matched or not.\n * @param {string} filePath The absolute path to the target file.\n * @returns {boolean} `true` if the path was matched.\n */\n test(filePath) {\n if (typeof filePath !== \"string\" || !path.isAbsolute(filePath)) {\n throw new Error(`'filePath' should be an absolute path, but got ${filePath}.`);\n }\n const relativePath = path.relative(this.basePath, filePath);\n\n return this.patterns.every(({ includes, excludes }) => (\n (!includes || includes.some(m => m.match(relativePath))) &&\n (!excludes || !excludes.some(m => m.match(relativePath)))\n ));\n }\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @returns {Object} a JSON compatible object.\n */\n toJSON() {\n if (this.patterns.length === 1) {\n return {\n ...patternToJson(this.patterns[0]),\n basePath: this.basePath\n };\n }\n return {\n AND: this.patterns.map(patternToJson),\n basePath: this.basePath\n };\n }\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @returns {Object} an object to display by `console.log()`.\n */\n [util.inspect.custom]() {\n return this.toJSON();\n }\n}\n\nexport { OverrideTester };\n","/**\n * @fileoverview `ConfigArray` class.\n * @author Toru Nagashima \n */\n\nimport { ConfigArray, getUsedExtractedConfigs } from \"./config-array.js\";\nimport { ConfigDependency } from \"./config-dependency.js\";\nimport { ExtractedConfig } from \"./extracted-config.js\";\nimport { IgnorePattern } from \"./ignore-pattern.js\";\nimport { OverrideTester } from \"./override-tester.js\";\n\nexport {\n ConfigArray,\n ConfigDependency,\n ExtractedConfig,\n IgnorePattern,\n OverrideTester,\n getUsedExtractedConfigs\n};\n","/**\n * @fileoverview Config file operations. This file must be usable in the browser,\n * so no Node-specific code can be here.\n * @author Nicholas C. Zakas\n */\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\nconst RULE_SEVERITY_STRINGS = [\"off\", \"warn\", \"error\"],\n RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => {\n map[value] = index;\n return map;\n }, {}),\n VALID_SEVERITIES = [0, 1, 2, \"off\", \"warn\", \"error\"];\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * Normalizes the severity value of a rule's configuration to a number\n * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally\n * received from the user. A valid config value is either 0, 1, 2, the string \"off\" (treated the same as 0),\n * the string \"warn\" (treated the same as 1), the string \"error\" (treated the same as 2), or an array\n * whose first element is one of the above values. Strings are matched case-insensitively.\n * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0.\n */\nfunction getRuleSeverity(ruleConfig) {\n const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (severityValue === 0 || severityValue === 1 || severityValue === 2) {\n return severityValue;\n }\n\n if (typeof severityValue === \"string\") {\n return RULE_SEVERITY[severityValue.toLowerCase()] || 0;\n }\n\n return 0;\n}\n\n/**\n * Converts old-style severity settings (0, 1, 2) into new-style\n * severity settings (off, warn, error) for all rules. Assumption is that severity\n * values have already been validated as correct.\n * @param {Object} config The config object to normalize.\n * @returns {void}\n */\nfunction normalizeToStrings(config) {\n\n if (config.rules) {\n Object.keys(config.rules).forEach(ruleId => {\n const ruleConfig = config.rules[ruleId];\n\n if (typeof ruleConfig === \"number\") {\n config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0];\n } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === \"number\") {\n ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0];\n }\n });\n }\n}\n\n/**\n * Determines if the severity for the given rule configuration represents an error.\n * @param {int|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} True if the rule represents an error, false if not.\n */\nfunction isErrorSeverity(ruleConfig) {\n return getRuleSeverity(ruleConfig) === 2;\n}\n\n/**\n * Checks whether a given config has valid severity or not.\n * @param {number|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isValidSeverity(ruleConfig) {\n let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (typeof severity === \"string\") {\n severity = severity.toLowerCase();\n }\n return VALID_SEVERITIES.indexOf(severity) !== -1;\n}\n\n/**\n * Checks whether every rule of a given config has valid severity or not.\n * @param {Object} config The configuration for rules.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isEverySeverityValid(config) {\n return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId]));\n}\n\n/**\n * Normalizes a value for a global in a config\n * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in\n * a global directive comment\n * @returns {(\"readable\"|\"writeable\"|\"off\")} The value normalized as a string\n * @throws Error if global value is invalid\n */\nfunction normalizeConfigGlobal(configuredValue) {\n switch (configuredValue) {\n case \"off\":\n return \"off\";\n\n case true:\n case \"true\":\n case \"writeable\":\n case \"writable\":\n return \"writable\";\n\n case null:\n case false:\n case \"false\":\n case \"readable\":\n case \"readonly\":\n return \"readonly\";\n\n default:\n throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`);\n }\n}\n\nexport {\n getRuleSeverity,\n normalizeToStrings,\n isErrorSeverity,\n isValidSeverity,\n isEverySeverityValid,\n normalizeConfigGlobal\n};\n","/**\n * @fileoverview Provide the function that emits deprecation warnings.\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport path from \"path\";\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\n// Defitions for deprecation warnings.\nconst deprecationWarningMessages = {\n ESLINT_LEGACY_ECMAFEATURES:\n \"The 'ecmaFeatures' config file property is deprecated and has no effect.\",\n ESLINT_PERSONAL_CONFIG_LOAD:\n \"'~/.eslintrc.*' config files have been deprecated. \" +\n \"Please use a config file per project or the '--config' option.\",\n ESLINT_PERSONAL_CONFIG_SUPPRESS:\n \"'~/.eslintrc.*' config files have been deprecated. \" +\n \"Please remove it or add 'root:true' to the config files in your \" +\n \"projects in order to avoid loading '~/.eslintrc.*' accidentally.\"\n};\n\nconst sourceFileErrorCache = new Set();\n\n/**\n * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted\n * for each unique file path, but repeated invocations with the same file path have no effect.\n * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active.\n * @param {string} source The name of the configuration source to report the warning for.\n * @param {string} errorCode The warning message to show.\n * @returns {void}\n */\nfunction emitDeprecationWarning(source, errorCode) {\n const cacheKey = JSON.stringify({ source, errorCode });\n\n if (sourceFileErrorCache.has(cacheKey)) {\n return;\n }\n sourceFileErrorCache.add(cacheKey);\n\n const rel = path.relative(process.cwd(), source);\n const message = deprecationWarningMessages[errorCode];\n\n process.emitWarning(\n `${message} (found in \"${rel}\")`,\n \"DeprecationWarning\",\n errorCode\n );\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport {\n emitDeprecationWarning\n};\n","/**\n * @fileoverview The instance of Ajv validator.\n * @author Evgeny Poberezkin\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport Ajv from \"ajv\";\n\n//-----------------------------------------------------------------------------\n// Helpers\n//-----------------------------------------------------------------------------\n\n/*\n * Copied from ajv/lib/refs/json-schema-draft-04.json\n * The MIT License (MIT)\n * Copyright (c) 2015-2017 Evgeny Poberezkin\n */\nconst metaSchema = {\n id: \"http://json-schema.org/draft-04/schema#\",\n $schema: \"http://json-schema.org/draft-04/schema#\",\n description: \"Core schema meta-schema\",\n definitions: {\n schemaArray: {\n type: \"array\",\n minItems: 1,\n items: { $ref: \"#\" }\n },\n positiveInteger: {\n type: \"integer\",\n minimum: 0\n },\n positiveIntegerDefault0: {\n allOf: [{ $ref: \"#/definitions/positiveInteger\" }, { default: 0 }]\n },\n simpleTypes: {\n enum: [\"array\", \"boolean\", \"integer\", \"null\", \"number\", \"object\", \"string\"]\n },\n stringArray: {\n type: \"array\",\n items: { type: \"string\" },\n minItems: 1,\n uniqueItems: true\n }\n },\n type: \"object\",\n properties: {\n id: {\n type: \"string\"\n },\n $schema: {\n type: \"string\"\n },\n title: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n default: { },\n multipleOf: {\n type: \"number\",\n minimum: 0,\n exclusiveMinimum: true\n },\n maximum: {\n type: \"number\"\n },\n exclusiveMaximum: {\n type: \"boolean\",\n default: false\n },\n minimum: {\n type: \"number\"\n },\n exclusiveMinimum: {\n type: \"boolean\",\n default: false\n },\n maxLength: { $ref: \"#/definitions/positiveInteger\" },\n minLength: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n pattern: {\n type: \"string\",\n format: \"regex\"\n },\n additionalItems: {\n anyOf: [\n { type: \"boolean\" },\n { $ref: \"#\" }\n ],\n default: { }\n },\n items: {\n anyOf: [\n { $ref: \"#\" },\n { $ref: \"#/definitions/schemaArray\" }\n ],\n default: { }\n },\n maxItems: { $ref: \"#/definitions/positiveInteger\" },\n minItems: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n uniqueItems: {\n type: \"boolean\",\n default: false\n },\n maxProperties: { $ref: \"#/definitions/positiveInteger\" },\n minProperties: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n required: { $ref: \"#/definitions/stringArray\" },\n additionalProperties: {\n anyOf: [\n { type: \"boolean\" },\n { $ref: \"#\" }\n ],\n default: { }\n },\n definitions: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n properties: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n patternProperties: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n dependencies: {\n type: \"object\",\n additionalProperties: {\n anyOf: [\n { $ref: \"#\" },\n { $ref: \"#/definitions/stringArray\" }\n ]\n }\n },\n enum: {\n type: \"array\",\n minItems: 1,\n uniqueItems: true\n },\n type: {\n anyOf: [\n { $ref: \"#/definitions/simpleTypes\" },\n {\n type: \"array\",\n items: { $ref: \"#/definitions/simpleTypes\" },\n minItems: 1,\n uniqueItems: true\n }\n ]\n },\n format: { type: \"string\" },\n allOf: { $ref: \"#/definitions/schemaArray\" },\n anyOf: { $ref: \"#/definitions/schemaArray\" },\n oneOf: { $ref: \"#/definitions/schemaArray\" },\n not: { $ref: \"#\" }\n },\n dependencies: {\n exclusiveMaximum: [\"maximum\"],\n exclusiveMinimum: [\"minimum\"]\n },\n default: { }\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport default (additionalOptions = {}) => {\n const ajv = new Ajv({\n meta: false,\n useDefaults: true,\n validateSchema: false,\n missingRefs: \"ignore\",\n verbose: true,\n schemaId: \"auto\",\n ...additionalOptions\n });\n\n ajv.addMetaSchema(metaSchema);\n // eslint-disable-next-line no-underscore-dangle\n ajv._opts.defaultMeta = metaSchema.id;\n\n return ajv;\n};\n","/**\n * @fileoverview Defines a schema for configs.\n * @author Sylvan Mably\n */\n\nconst baseConfigProperties = {\n $schema: { type: \"string\" },\n env: { type: \"object\" },\n extends: { $ref: \"#/definitions/stringOrStrings\" },\n globals: { type: \"object\" },\n overrides: {\n type: \"array\",\n items: { $ref: \"#/definitions/overrideConfig\" },\n additionalItems: false\n },\n parser: { type: [\"string\", \"null\"] },\n parserOptions: { type: \"object\" },\n plugins: { type: \"array\" },\n processor: { type: \"string\" },\n rules: { type: \"object\" },\n settings: { type: \"object\" },\n noInlineConfig: { type: \"boolean\" },\n reportUnusedDisableDirectives: { type: \"boolean\" },\n\n ecmaFeatures: { type: \"object\" } // deprecated; logs a warning when used\n};\n\nconst configSchema = {\n definitions: {\n stringOrStrings: {\n oneOf: [\n { type: \"string\" },\n {\n type: \"array\",\n items: { type: \"string\" },\n additionalItems: false\n }\n ]\n },\n stringOrStringsRequired: {\n oneOf: [\n { type: \"string\" },\n {\n type: \"array\",\n items: { type: \"string\" },\n additionalItems: false,\n minItems: 1\n }\n ]\n },\n\n // Config at top-level.\n objectConfig: {\n type: \"object\",\n properties: {\n root: { type: \"boolean\" },\n ignorePatterns: { $ref: \"#/definitions/stringOrStrings\" },\n ...baseConfigProperties\n },\n additionalProperties: false\n },\n\n // Config in `overrides`.\n overrideConfig: {\n type: \"object\",\n properties: {\n excludedFiles: { $ref: \"#/definitions/stringOrStrings\" },\n files: { $ref: \"#/definitions/stringOrStringsRequired\" },\n ...baseConfigProperties\n },\n required: [\"files\"],\n additionalProperties: false\n }\n },\n\n $ref: \"#/definitions/objectConfig\"\n};\n\nexport default configSchema;\n","/**\n * @fileoverview Defines environment settings and globals.\n * @author Elan Shanker\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport globals from \"globals\";\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Get the object that has difference.\n * @param {Record} current The newer object.\n * @param {Record} prev The older object.\n * @returns {Record} The difference object.\n */\nfunction getDiff(current, prev) {\n const retv = {};\n\n for (const [key, value] of Object.entries(current)) {\n if (!Object.hasOwnProperty.call(prev, key)) {\n retv[key] = value;\n }\n }\n\n return retv;\n}\n\nconst newGlobals2015 = getDiff(globals.es2015, globals.es5); // 19 variables such as Promise, Map, ...\nconst newGlobals2017 = {\n Atomics: false,\n SharedArrayBuffer: false\n};\nconst newGlobals2020 = {\n BigInt: false,\n BigInt64Array: false,\n BigUint64Array: false,\n globalThis: false\n};\n\nconst newGlobals2021 = {\n AggregateError: false,\n FinalizationRegistry: false,\n WeakRef: false\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/** @type {Map} */\nexport default new Map(Object.entries({\n\n // Language\n builtin: {\n globals: globals.es5\n },\n es6: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2015: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2016: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 7\n }\n },\n es2017: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 8\n }\n },\n es2018: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 9\n }\n },\n es2019: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 10\n }\n },\n es2020: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 },\n parserOptions: {\n ecmaVersion: 11\n }\n },\n es2021: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 12\n }\n },\n es2022: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 13\n }\n },\n\n // Platforms\n browser: {\n globals: globals.browser\n },\n node: {\n globals: globals.node,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n \"shared-node-browser\": {\n globals: globals[\"shared-node-browser\"]\n },\n worker: {\n globals: globals.worker\n },\n serviceworker: {\n globals: globals.serviceworker\n },\n\n // Frameworks\n commonjs: {\n globals: globals.commonjs,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n amd: {\n globals: globals.amd\n },\n mocha: {\n globals: globals.mocha\n },\n jasmine: {\n globals: globals.jasmine\n },\n jest: {\n globals: globals.jest\n },\n phantomjs: {\n globals: globals.phantomjs\n },\n jquery: {\n globals: globals.jquery\n },\n qunit: {\n globals: globals.qunit\n },\n prototypejs: {\n globals: globals.prototypejs\n },\n shelljs: {\n globals: globals.shelljs\n },\n meteor: {\n globals: globals.meteor\n },\n mongo: {\n globals: globals.mongo\n },\n protractor: {\n globals: globals.protractor\n },\n applescript: {\n globals: globals.applescript\n },\n nashorn: {\n globals: globals.nashorn\n },\n atomtest: {\n globals: globals.atomtest\n },\n embertest: {\n globals: globals.embertest\n },\n webextensions: {\n globals: globals.webextensions\n },\n greasemonkey: {\n globals: globals.greasemonkey\n }\n}));\n","/**\n * @fileoverview Validates configs.\n * @author Brandon Mills\n */\n\n/* eslint class-methods-use-this: \"off\" */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport util from \"util\";\nimport * as ConfigOps from \"./config-ops.js\";\nimport { emitDeprecationWarning } from \"./deprecation-warnings.js\";\nimport ajvOrig from \"./ajv.js\";\nimport configSchema from \"../../conf/config-schema.js\";\nimport BuiltInEnvironments from \"../../conf/environments.js\";\n\nconst ajv = ajvOrig();\n\nconst ruleValidators = new WeakMap();\nconst noop = Function.prototype;\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\nlet validateSchema;\nconst severityMap = {\n error: 2,\n warn: 1,\n off: 0\n};\n\nconst validated = new WeakSet();\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\nexport default class ConfigValidator {\n constructor({ builtInRules = new Map() } = {}) {\n this.builtInRules = builtInRules;\n }\n\n /**\n * Gets a complete options schema for a rule.\n * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object\n * @returns {Object} JSON Schema for the rule's options.\n */\n getRuleOptionsSchema(rule) {\n if (!rule) {\n return null;\n }\n\n const schema = rule.schema || rule.meta && rule.meta.schema;\n\n // Given a tuple of schemas, insert warning level at the beginning\n if (Array.isArray(schema)) {\n if (schema.length) {\n return {\n type: \"array\",\n items: schema,\n minItems: 0,\n maxItems: schema.length\n };\n }\n return {\n type: \"array\",\n minItems: 0,\n maxItems: 0\n };\n\n }\n\n // Given a full schema, leave it alone\n return schema || null;\n }\n\n /**\n * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid.\n * @param {options} options The given options for the rule.\n * @returns {number|string} The rule's severity value\n */\n validateRuleSeverity(options) {\n const severity = Array.isArray(options) ? options[0] : options;\n const normSeverity = typeof severity === \"string\" ? severityMap[severity.toLowerCase()] : severity;\n\n if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {\n return normSeverity;\n }\n\n throw new Error(`\\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, \"\\\"\").replace(/\\n/gu, \"\")}').\\n`);\n\n }\n\n /**\n * Validates the non-severity options passed to a rule, based on its schema.\n * @param {{create: Function}} rule The rule to validate\n * @param {Array} localOptions The options for the rule, excluding severity\n * @returns {void}\n */\n validateRuleSchema(rule, localOptions) {\n if (!ruleValidators.has(rule)) {\n const schema = this.getRuleOptionsSchema(rule);\n\n if (schema) {\n ruleValidators.set(rule, ajv.compile(schema));\n }\n }\n\n const validateRule = ruleValidators.get(rule);\n\n if (validateRule) {\n validateRule(localOptions);\n if (validateRule.errors) {\n throw new Error(validateRule.errors.map(\n error => `\\tValue ${JSON.stringify(error.data)} ${error.message}.\\n`\n ).join(\"\"));\n }\n }\n }\n\n /**\n * Validates a rule's options against its schema.\n * @param {{create: Function}|null} rule The rule that the config is being validated for\n * @param {string} ruleId The rule's unique name.\n * @param {Array|number} options The given options for the rule.\n * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined,\n * no source is prepended to the message.\n * @returns {void}\n */\n validateRuleOptions(rule, ruleId, options, source = null) {\n try {\n const severity = this.validateRuleSeverity(options);\n\n if (severity !== 0) {\n this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []);\n }\n } catch (err) {\n const enhancedMessage = `Configuration for rule \"${ruleId}\" is invalid:\\n${err.message}`;\n\n if (typeof source === \"string\") {\n throw new Error(`${source}:\\n\\t${enhancedMessage}`);\n } else {\n throw new Error(enhancedMessage);\n }\n }\n }\n\n /**\n * Validates an environment object\n * @param {Object} environment The environment config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments.\n * @returns {void}\n */\n validateEnvironment(\n environment,\n source,\n getAdditionalEnv = noop\n ) {\n\n // not having an environment is ok\n if (!environment) {\n return;\n }\n\n Object.keys(environment).forEach(id => {\n const env = getAdditionalEnv(id) || BuiltInEnvironments.get(id) || null;\n\n if (!env) {\n const message = `${source}:\\n\\tEnvironment key \"${id}\" is unknown\\n`;\n\n throw new Error(message);\n }\n });\n }\n\n /**\n * Validates a rules config object\n * @param {Object} rulesConfig The rules config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules\n * @returns {void}\n */\n validateRules(\n rulesConfig,\n source,\n getAdditionalRule = noop\n ) {\n if (!rulesConfig) {\n return;\n }\n\n Object.keys(rulesConfig).forEach(id => {\n const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null;\n\n this.validateRuleOptions(rule, id, rulesConfig[id], source);\n });\n }\n\n /**\n * Validates a `globals` section of a config file\n * @param {Object} globalsConfig The `globals` section\n * @param {string|null} source The name of the configuration source to report in the event of an error.\n * @returns {void}\n */\n validateGlobals(globalsConfig, source = null) {\n if (!globalsConfig) {\n return;\n }\n\n Object.entries(globalsConfig)\n .forEach(([configuredGlobal, configuredValue]) => {\n try {\n ConfigOps.normalizeConfigGlobal(configuredValue);\n } catch (err) {\n throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\\n${err.message}`);\n }\n });\n }\n\n /**\n * Validate `processor` configuration.\n * @param {string|undefined} processorName The processor name.\n * @param {string} source The name of config file.\n * @param {function(id:string): Processor} getProcessor The getter of defined processors.\n * @returns {void}\n */\n validateProcessor(processorName, source, getProcessor) {\n if (processorName && !getProcessor(processorName)) {\n throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`);\n }\n }\n\n /**\n * Formats an array of schema validation errors.\n * @param {Array} errors An array of error messages to format.\n * @returns {string} Formatted error message\n */\n formatErrors(errors) {\n return errors.map(error => {\n if (error.keyword === \"additionalProperties\") {\n const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty;\n\n return `Unexpected top-level property \"${formattedPropertyPath}\"`;\n }\n if (error.keyword === \"type\") {\n const formattedField = error.dataPath.slice(1);\n const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join(\"/\") : error.schema;\n const formattedValue = JSON.stringify(error.data);\n\n return `Property \"${formattedField}\" is the wrong type (expected ${formattedExpectedType} but got \\`${formattedValue}\\`)`;\n }\n\n const field = error.dataPath[0] === \".\" ? error.dataPath.slice(1) : error.dataPath;\n\n return `\"${field}\" ${error.message}. Value: ${JSON.stringify(error.data)}`;\n }).map(message => `\\t- ${message}.\\n`).join(\"\");\n }\n\n /**\n * Validates the top level properties of the config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @returns {void}\n */\n validateConfigSchema(config, source = null) {\n validateSchema = validateSchema || ajv.compile(configSchema);\n\n if (!validateSchema(config)) {\n throw new Error(`ESLint configuration in ${source} is invalid:\\n${this.formatErrors(validateSchema.errors)}`);\n }\n\n if (Object.hasOwnProperty.call(config, \"ecmaFeatures\")) {\n emitDeprecationWarning(source, \"ESLINT_LEGACY_ECMAFEATURES\");\n }\n }\n\n /**\n * Validates an entire config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules.\n * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs.\n * @returns {void}\n */\n validate(config, source, getAdditionalRule, getAdditionalEnv) {\n this.validateConfigSchema(config, source);\n this.validateRules(config.rules, source, getAdditionalRule);\n this.validateEnvironment(config.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n\n for (const override of config.overrides || []) {\n this.validateRules(override.rules, source, getAdditionalRule);\n this.validateEnvironment(override.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n }\n }\n\n /**\n * Validate config array object.\n * @param {ConfigArray} configArray The config array to validate.\n * @returns {void}\n */\n validateConfigArray(configArray) {\n const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments);\n const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors);\n const getPluginRule = Map.prototype.get.bind(configArray.pluginRules);\n\n // Validate.\n for (const element of configArray) {\n if (validated.has(element)) {\n continue;\n }\n validated.add(element);\n\n this.validateEnvironment(element.env, element.name, getPluginEnv);\n this.validateGlobals(element.globals, element.name);\n this.validateProcessor(element.processor, element.name, getPluginProcessor);\n this.validateRules(element.rules, element.name, getPluginRule);\n }\n }\n\n}\n","/**\n * @fileoverview Common helpers for naming of plugins, formatters and configs\n */\n\nconst NAMESPACE_REGEX = /^@.*\\//iu;\n\n/**\n * Brings package name to correct format based on prefix\n * @param {string} name The name of the package.\n * @param {string} prefix Can be either \"eslint-plugin\", \"eslint-config\" or \"eslint-formatter\"\n * @returns {string} Normalized name of the package\n * @private\n */\nfunction normalizePackageName(name, prefix) {\n let normalizedName = name;\n\n /**\n * On Windows, name can come in with Windows slashes instead of Unix slashes.\n * Normalize to Unix first to avoid errors later on.\n * https://github.com/eslint/eslint/issues/5644\n */\n if (normalizedName.includes(\"\\\\\")) {\n normalizedName = normalizedName.replace(/\\\\/gu, \"/\");\n }\n\n if (normalizedName.charAt(0) === \"@\") {\n\n /**\n * it's a scoped package\n * package name is the prefix, or just a username\n */\n const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, \"u\"),\n scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, \"u\");\n\n if (scopedPackageShortcutRegex.test(normalizedName)) {\n normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`);\n } else if (!scopedPackageNameRegex.test(normalizedName.split(\"/\")[1])) {\n\n /**\n * for scoped packages, insert the prefix after the first / unless\n * the path is already @scope/eslint or @scope/eslint-xxx-yyy\n */\n normalizedName = normalizedName.replace(/^@([^/]+)\\/(.*)$/u, `@$1/${prefix}-$2`);\n }\n } else if (!normalizedName.startsWith(`${prefix}-`)) {\n normalizedName = `${prefix}-${normalizedName}`;\n }\n\n return normalizedName;\n}\n\n/**\n * Removes the prefix from a fullname.\n * @param {string} fullname The term which may have the prefix.\n * @param {string} prefix The prefix to remove.\n * @returns {string} The term without prefix.\n */\nfunction getShorthandName(fullname, prefix) {\n if (fullname[0] === \"@\") {\n let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, \"u\").exec(fullname);\n\n if (matchResult) {\n return matchResult[1];\n }\n\n matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, \"u\").exec(fullname);\n if (matchResult) {\n return `${matchResult[1]}/${matchResult[2]}`;\n }\n } else if (fullname.startsWith(`${prefix}-`)) {\n return fullname.slice(prefix.length + 1);\n }\n\n return fullname;\n}\n\n/**\n * Gets the scope (namespace) of a term.\n * @param {string} term The term which may have the namespace.\n * @returns {string} The namespace of the term if it has one.\n */\nfunction getNamespaceFromTerm(term) {\n const match = term.match(NAMESPACE_REGEX);\n\n return match ? match[0] : \"\";\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport {\n normalizePackageName,\n getShorthandName,\n getNamespaceFromTerm\n};\n","/**\n * Utility for resolving a module relative to another module\n * @author Teddy Katz\n */\n\nimport Module from \"module\";\n\n/*\n * `Module.createRequire` is added in v12.2.0. It supports URL as well.\n * We only support the case where the argument is a filepath, not a URL.\n */\nconst createRequire = Module.createRequire;\n\n/**\n * Resolves a Node module relative to another module\n * @param {string} moduleName The name of a Node module, or a path to a Node module.\n * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be\n * a file rather than a directory, but the file need not actually exist.\n * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath`\n */\nfunction resolve(moduleName, relativeToPath) {\n try {\n return createRequire(relativeToPath).resolve(moduleName);\n } catch (error) {\n\n // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future.\n if (\n typeof error === \"object\" &&\n error !== null &&\n error.code === \"MODULE_NOT_FOUND\" &&\n !error.requireStack &&\n error.message.includes(moduleName)\n ) {\n error.message += `\\nRequire stack:\\n- ${relativeToPath}`;\n }\n throw error;\n }\n}\n\nexport {\n resolve\n};\n","/**\n * @fileoverview The factory of `ConfigArray` objects.\n *\n * This class provides methods to create `ConfigArray` instance.\n *\n * - `create(configData, options)`\n * Create a `ConfigArray` instance from a config data. This is to handle CLI\n * options except `--config`.\n * - `loadFile(filePath, options)`\n * Create a `ConfigArray` instance from a config file. This is to handle\n * `--config` option. If the file was not found, throws the following error:\n * - If the filename was `*.js`, a `MODULE_NOT_FOUND` error.\n * - If the filename was `package.json`, an IO error or an\n * `ESLINT_CONFIG_FIELD_NOT_FOUND` error.\n * - Otherwise, an IO error such as `ENOENT`.\n * - `loadInDirectory(directoryPath, options)`\n * Create a `ConfigArray` instance from a config file which is on a given\n * directory. This tries to load `.eslintrc.*` or `package.json`. If not\n * found, returns an empty `ConfigArray`.\n * - `loadESLintIgnore(filePath)`\n * Create a `ConfigArray` instance from a config file that is `.eslintignore`\n * format. This is to handle `--ignore-path` option.\n * - `loadDefaultESLintIgnore()`\n * Create a `ConfigArray` instance from `.eslintignore` or `package.json` in\n * the current working directory.\n *\n * `ConfigArrayFactory` class has the responsibility that loads configuration\n * files, including loading `extends`, `parser`, and `plugins`. The created\n * `ConfigArray` instance has the loaded `extends`, `parser`, and `plugins`.\n *\n * But this class doesn't handle cascading. `CascadingConfigArrayFactory` class\n * handles cascading and hierarchy.\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport debugOrig from \"debug\";\nimport fs from \"fs\";\nimport importFresh from \"import-fresh\";\nimport { createRequire } from \"module\";\nimport path from \"path\";\nimport stripComments from \"strip-json-comments\";\n\nimport {\n ConfigArray,\n ConfigDependency,\n IgnorePattern,\n OverrideTester\n} from \"./config-array/index.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport * as naming from \"./shared/naming.js\";\nimport * as ModuleResolver from \"./shared/relative-module-resolver.js\";\n\nconst require = createRequire(import.meta.url);\n\nconst debug = debugOrig(\"eslintrc:config-array-factory\");\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\nconst configFilenames = [\n \".eslintrc.js\",\n \".eslintrc.cjs\",\n \".eslintrc.yaml\",\n \".eslintrc.yml\",\n \".eslintrc.json\",\n \".eslintrc\",\n \"package.json\"\n];\n\n// Define types for VSCode IntelliSense.\n/** @typedef {import(\"./shared/types\").ConfigData} ConfigData */\n/** @typedef {import(\"./shared/types\").OverrideConfigData} OverrideConfigData */\n/** @typedef {import(\"./shared/types\").Parser} Parser */\n/** @typedef {import(\"./shared/types\").Plugin} Plugin */\n/** @typedef {import(\"./shared/types\").Rule} Rule */\n/** @typedef {import(\"./config-array/config-dependency\").DependentParser} DependentParser */\n/** @typedef {import(\"./config-array/config-dependency\").DependentPlugin} DependentPlugin */\n/** @typedef {ConfigArray[0]} ConfigArrayElement */\n\n/**\n * @typedef {Object} ConfigArrayFactoryOptions\n * @property {Map} [additionalPluginPool] The map for additional plugins.\n * @property {string} [cwd] The path to the current working directory.\n * @property {string} [resolvePluginsRelativeTo] A path to the directory that plugins should be resolved from. Defaults to `cwd`.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/**\n * @typedef {Object} ConfigArrayFactoryInternalSlots\n * @property {Map} additionalPluginPool The map for additional plugins.\n * @property {string} cwd The path to the current working directory.\n * @property {string | undefined} resolvePluginsRelativeTo An absolute path the the directory that plugins should be resolved from.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/**\n * @typedef {Object} ConfigArrayFactoryLoadingContext\n * @property {string} filePath The path to the current configuration.\n * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @property {string} name The name of the current configuration.\n * @property {string} pluginBasePath The base path to resolve plugins.\n * @property {\"config\" | \"ignore\" | \"implicit-processor\"} type The type of the current configuration. This is `\"config\"` in normal. This is `\"ignore\"` if it came from `.eslintignore`. This is `\"implicit-processor\"` if it came from legacy file-extension processors.\n */\n\n/**\n * @typedef {Object} ConfigArrayFactoryLoadingContext\n * @property {string} filePath The path to the current configuration.\n * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @property {string} name The name of the current configuration.\n * @property {\"config\" | \"ignore\" | \"implicit-processor\"} type The type of the current configuration. This is `\"config\"` in normal. This is `\"ignore\"` if it came from `.eslintignore`. This is `\"implicit-processor\"` if it came from legacy file-extension processors.\n */\n\n/** @type {WeakMap} */\nconst internalSlotsMap = new WeakMap();\n\n/**\n * Check if a given string is a file path.\n * @param {string} nameOrPath A module name or file path.\n * @returns {boolean} `true` if the `nameOrPath` is a file path.\n */\nfunction isFilePath(nameOrPath) {\n return (\n /^\\.{1,2}[/\\\\]/u.test(nameOrPath) ||\n path.isAbsolute(nameOrPath)\n );\n}\n\n/**\n * Convenience wrapper for synchronously reading file contents.\n * @param {string} filePath The filename to read.\n * @returns {string} The file contents, with the BOM removed.\n * @private\n */\nfunction readFile(filePath) {\n return fs.readFileSync(filePath, \"utf8\").replace(/^\\ufeff/u, \"\");\n}\n\n/**\n * Loads a YAML configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadYAMLConfigFile(filePath) {\n debug(`Loading YAML config file: ${filePath}`);\n\n // lazy load YAML to improve performance when not used\n const yaml = require(\"js-yaml\");\n\n try {\n\n // empty YAML file can be null, so always use\n return yaml.load(readFile(filePath)) || {};\n } catch (e) {\n debug(`Error reading YAML file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a JSON configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadJSONConfigFile(filePath) {\n debug(`Loading JSON config file: ${filePath}`);\n\n try {\n return JSON.parse(stripComments(readFile(filePath)));\n } catch (e) {\n debug(`Error reading JSON file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n e.messageTemplate = \"failed-to-read-json\";\n e.messageData = {\n path: filePath,\n message: e.message\n };\n throw e;\n }\n}\n\n/**\n * Loads a legacy (.eslintrc) configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadLegacyConfigFile(filePath) {\n debug(`Loading legacy config file: ${filePath}`);\n\n // lazy load YAML to improve performance when not used\n const yaml = require(\"js-yaml\");\n\n try {\n return yaml.load(stripComments(readFile(filePath))) || /* istanbul ignore next */ {};\n } catch (e) {\n debug(\"Error reading YAML file: %s\\n%o\", filePath, e);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a JavaScript configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadJSConfigFile(filePath) {\n debug(`Loading JS config file: ${filePath}`);\n try {\n return importFresh(filePath);\n } catch (e) {\n debug(`Error reading JavaScript file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a configuration from a package.json file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadPackageJSONConfigFile(filePath) {\n debug(`Loading package.json config file: ${filePath}`);\n try {\n const packageData = loadJSONConfigFile(filePath);\n\n if (!Object.hasOwnProperty.call(packageData, \"eslintConfig\")) {\n throw Object.assign(\n new Error(\"package.json file doesn't have 'eslintConfig' field.\"),\n { code: \"ESLINT_CONFIG_FIELD_NOT_FOUND\" }\n );\n }\n\n return packageData.eslintConfig;\n } catch (e) {\n debug(`Error reading package.json file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a `.eslintignore` from a file.\n * @param {string} filePath The filename to load.\n * @returns {string[]} The ignore patterns from the file.\n * @private\n */\nfunction loadESLintIgnoreFile(filePath) {\n debug(`Loading .eslintignore file: ${filePath}`);\n\n try {\n return readFile(filePath)\n .split(/\\r?\\n/gu)\n .filter(line => line.trim() !== \"\" && !line.startsWith(\"#\"));\n } catch (e) {\n debug(`Error reading .eslintignore file: ${filePath}`);\n e.message = `Cannot read .eslintignore file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Creates an error to notify about a missing config to extend from.\n * @param {string} configName The name of the missing config.\n * @param {string} importerName The name of the config that imported the missing config\n * @param {string} messageTemplate The text template to source error strings from.\n * @returns {Error} The error object to throw\n * @private\n */\nfunction configInvalidError(configName, importerName, messageTemplate) {\n return Object.assign(\n new Error(`Failed to load config \"${configName}\" to extend from.`),\n {\n messageTemplate,\n messageData: { configName, importerName }\n }\n );\n}\n\n/**\n * Loads a configuration file regardless of the source. Inspects the file path\n * to determine the correctly way to load the config file.\n * @param {string} filePath The path to the configuration.\n * @returns {ConfigData|null} The configuration information.\n * @private\n */\nfunction loadConfigFile(filePath) {\n switch (path.extname(filePath)) {\n case \".js\":\n case \".cjs\":\n return loadJSConfigFile(filePath);\n\n case \".json\":\n if (path.basename(filePath) === \"package.json\") {\n return loadPackageJSONConfigFile(filePath);\n }\n return loadJSONConfigFile(filePath);\n\n case \".yaml\":\n case \".yml\":\n return loadYAMLConfigFile(filePath);\n\n default:\n return loadLegacyConfigFile(filePath);\n }\n}\n\n/**\n * Write debug log.\n * @param {string} request The requested module name.\n * @param {string} relativeTo The file path to resolve the request relative to.\n * @param {string} filePath The resolved file path.\n * @returns {void}\n */\nfunction writeDebugLogForLoading(request, relativeTo, filePath) {\n /* istanbul ignore next */\n if (debug.enabled) {\n let nameAndVersion = null;\n\n try {\n const packageJsonPath = ModuleResolver.resolve(\n `${request}/package.json`,\n relativeTo\n );\n const { version = \"unknown\" } = require(packageJsonPath);\n\n nameAndVersion = `${request}@${version}`;\n } catch (error) {\n debug(\"package.json was not found:\", error.message);\n nameAndVersion = request;\n }\n\n debug(\"Loaded: %s (%s)\", nameAndVersion, filePath);\n }\n}\n\n/**\n * Create a new context with default values.\n * @param {ConfigArrayFactoryInternalSlots} slots The internal slots.\n * @param {\"config\" | \"ignore\" | \"implicit-processor\" | undefined} providedType The type of the current configuration. Default is `\"config\"`.\n * @param {string | undefined} providedName The name of the current configuration. Default is the relative path from `cwd` to `filePath`.\n * @param {string | undefined} providedFilePath The path to the current configuration. Default is empty string.\n * @param {string | undefined} providedMatchBasePath The type of the current configuration. Default is the directory of `filePath` or `cwd`.\n * @returns {ConfigArrayFactoryLoadingContext} The created context.\n */\nfunction createContext(\n { cwd, resolvePluginsRelativeTo },\n providedType,\n providedName,\n providedFilePath,\n providedMatchBasePath\n) {\n const filePath = providedFilePath\n ? path.resolve(cwd, providedFilePath)\n : \"\";\n const matchBasePath =\n (providedMatchBasePath && path.resolve(cwd, providedMatchBasePath)) ||\n (filePath && path.dirname(filePath)) ||\n cwd;\n const name =\n providedName ||\n (filePath && path.relative(cwd, filePath)) ||\n \"\";\n const pluginBasePath =\n resolvePluginsRelativeTo ||\n (filePath && path.dirname(filePath)) ||\n cwd;\n const type = providedType || \"config\";\n\n return { filePath, matchBasePath, name, pluginBasePath, type };\n}\n\n/**\n * Normalize a given plugin.\n * - Ensure the object to have four properties: configs, environments, processors, and rules.\n * - Ensure the object to not have other properties.\n * @param {Plugin} plugin The plugin to normalize.\n * @returns {Plugin} The normalized plugin.\n */\nfunction normalizePlugin(plugin) {\n return {\n configs: plugin.configs || {},\n environments: plugin.environments || {},\n processors: plugin.processors || {},\n rules: plugin.rules || {}\n };\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * The factory of `ConfigArray` objects.\n */\nclass ConfigArrayFactory {\n\n /**\n * Initialize this instance.\n * @param {ConfigArrayFactoryOptions} [options] The map for additional plugins.\n */\n constructor({\n additionalPluginPool = new Map(),\n cwd = process.cwd(),\n resolvePluginsRelativeTo,\n builtInRules,\n resolver = ModuleResolver,\n eslintAllPath,\n getEslintAllConfig,\n eslintRecommendedPath,\n getEslintRecommendedConfig\n } = {}) {\n internalSlotsMap.set(this, {\n additionalPluginPool,\n cwd,\n resolvePluginsRelativeTo:\n resolvePluginsRelativeTo &&\n path.resolve(cwd, resolvePluginsRelativeTo),\n builtInRules,\n resolver,\n eslintAllPath,\n getEslintAllConfig,\n eslintRecommendedPath,\n getEslintRecommendedConfig\n });\n }\n\n /**\n * Create `ConfigArray` instance from a config data.\n * @param {ConfigData|null} configData The config data to create.\n * @param {Object} [options] The options.\n * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @param {string} [options.filePath] The path to this config data.\n * @param {string} [options.name] The config name.\n * @returns {ConfigArray} Loaded config.\n */\n create(configData, { basePath, filePath, name } = {}) {\n if (!configData) {\n return new ConfigArray();\n }\n\n const slots = internalSlotsMap.get(this);\n const ctx = createContext(slots, \"config\", name, filePath, basePath);\n const elements = this._normalizeConfigData(configData, ctx);\n\n return new ConfigArray(...elements);\n }\n\n /**\n * Load a config file.\n * @param {string} filePath The path to a config file.\n * @param {Object} [options] The options.\n * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @param {string} [options.name] The config name.\n * @returns {ConfigArray} Loaded config.\n */\n loadFile(filePath, { basePath, name } = {}) {\n const slots = internalSlotsMap.get(this);\n const ctx = createContext(slots, \"config\", name, filePath, basePath);\n\n return new ConfigArray(...this._loadConfigData(ctx));\n }\n\n /**\n * Load the config file on a given directory if exists.\n * @param {string} directoryPath The path to a directory.\n * @param {Object} [options] The options.\n * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @param {string} [options.name] The config name.\n * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.\n */\n loadInDirectory(directoryPath, { basePath, name } = {}) {\n const slots = internalSlotsMap.get(this);\n\n for (const filename of configFilenames) {\n const ctx = createContext(\n slots,\n \"config\",\n name,\n path.join(directoryPath, filename),\n basePath\n );\n\n if (fs.existsSync(ctx.filePath) && fs.statSync(ctx.filePath).isFile()) {\n let configData;\n\n try {\n configData = loadConfigFile(ctx.filePath);\n } catch (error) {\n if (!error || error.code !== \"ESLINT_CONFIG_FIELD_NOT_FOUND\") {\n throw error;\n }\n }\n\n if (configData) {\n debug(`Config file found: ${ctx.filePath}`);\n return new ConfigArray(\n ...this._normalizeConfigData(configData, ctx)\n );\n }\n }\n }\n\n debug(`Config file not found on ${directoryPath}`);\n return new ConfigArray();\n }\n\n /**\n * Check if a config file on a given directory exists or not.\n * @param {string} directoryPath The path to a directory.\n * @returns {string | null} The path to the found config file. If not found then null.\n */\n static getPathToConfigFileInDirectory(directoryPath) {\n for (const filename of configFilenames) {\n const filePath = path.join(directoryPath, filename);\n\n if (fs.existsSync(filePath)) {\n if (filename === \"package.json\") {\n try {\n loadPackageJSONConfigFile(filePath);\n return filePath;\n } catch { /* ignore */ }\n } else {\n return filePath;\n }\n }\n }\n return null;\n }\n\n /**\n * Load `.eslintignore` file.\n * @param {string} filePath The path to a `.eslintignore` file to load.\n * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.\n */\n loadESLintIgnore(filePath) {\n const slots = internalSlotsMap.get(this);\n const ctx = createContext(\n slots,\n \"ignore\",\n void 0,\n filePath,\n slots.cwd\n );\n const ignorePatterns = loadESLintIgnoreFile(ctx.filePath);\n\n return new ConfigArray(\n ...this._normalizeESLintIgnoreData(ignorePatterns, ctx)\n );\n }\n\n /**\n * Load `.eslintignore` file in the current working directory.\n * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.\n */\n loadDefaultESLintIgnore() {\n const slots = internalSlotsMap.get(this);\n const eslintIgnorePath = path.resolve(slots.cwd, \".eslintignore\");\n const packageJsonPath = path.resolve(slots.cwd, \"package.json\");\n\n if (fs.existsSync(eslintIgnorePath)) {\n return this.loadESLintIgnore(eslintIgnorePath);\n }\n if (fs.existsSync(packageJsonPath)) {\n const data = loadJSONConfigFile(packageJsonPath);\n\n if (Object.hasOwnProperty.call(data, \"eslintIgnore\")) {\n if (!Array.isArray(data.eslintIgnore)) {\n throw new Error(\"Package.json eslintIgnore property requires an array of paths\");\n }\n const ctx = createContext(\n slots,\n \"ignore\",\n \"eslintIgnore in package.json\",\n packageJsonPath,\n slots.cwd\n );\n\n return new ConfigArray(\n ...this._normalizeESLintIgnoreData(data.eslintIgnore, ctx)\n );\n }\n }\n\n return new ConfigArray();\n }\n\n /**\n * Load a given config file.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} Loaded config.\n * @private\n */\n _loadConfigData(ctx) {\n return this._normalizeConfigData(loadConfigFile(ctx.filePath), ctx);\n }\n\n /**\n * Normalize a given `.eslintignore` data to config array elements.\n * @param {string[]} ignorePatterns The patterns to ignore files.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n *_normalizeESLintIgnoreData(ignorePatterns, ctx) {\n const elements = this._normalizeObjectConfigData(\n { ignorePatterns },\n ctx\n );\n\n // Set `ignorePattern.loose` flag for backward compatibility.\n for (const element of elements) {\n if (element.ignorePattern) {\n element.ignorePattern.loose = true;\n }\n yield element;\n }\n }\n\n /**\n * Normalize a given config to an array.\n * @param {ConfigData} configData The config data to normalize.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _normalizeConfigData(configData, ctx) {\n const validator = new ConfigValidator();\n\n validator.validateConfigSchema(configData, ctx.name || ctx.filePath);\n return this._normalizeObjectConfigData(configData, ctx);\n }\n\n /**\n * Normalize a given config to an array.\n * @param {ConfigData|OverrideConfigData} configData The config data to normalize.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n *_normalizeObjectConfigData(configData, ctx) {\n const { files, excludedFiles, ...configBody } = configData;\n const criteria = OverrideTester.create(\n files,\n excludedFiles,\n ctx.matchBasePath\n );\n const elements = this._normalizeObjectConfigDataBody(configBody, ctx);\n\n // Apply the criteria to every element.\n for (const element of elements) {\n\n /*\n * Merge the criteria.\n * This is for the `overrides` entries that came from the\n * configurations of `overrides[].extends`.\n */\n element.criteria = OverrideTester.and(criteria, element.criteria);\n\n /*\n * Remove `root` property to ignore `root` settings which came from\n * `extends` in `overrides`.\n */\n if (element.criteria) {\n element.root = void 0;\n }\n\n yield element;\n }\n }\n\n /**\n * Normalize a given config to an array.\n * @param {ConfigData} configData The config data to normalize.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n *_normalizeObjectConfigDataBody(\n {\n env,\n extends: extend,\n globals,\n ignorePatterns,\n noInlineConfig,\n parser: parserName,\n parserOptions,\n plugins: pluginList,\n processor,\n reportUnusedDisableDirectives,\n root,\n rules,\n settings,\n overrides: overrideList = []\n },\n ctx\n ) {\n const extendList = Array.isArray(extend) ? extend : [extend];\n const ignorePattern = ignorePatterns && new IgnorePattern(\n Array.isArray(ignorePatterns) ? ignorePatterns : [ignorePatterns],\n ctx.matchBasePath\n );\n\n // Flatten `extends`.\n for (const extendName of extendList.filter(Boolean)) {\n yield* this._loadExtends(extendName, ctx);\n }\n\n // Load parser & plugins.\n const parser = parserName && this._loadParser(parserName, ctx);\n const plugins = pluginList && this._loadPlugins(pluginList, ctx);\n\n // Yield pseudo config data for file extension processors.\n if (plugins) {\n yield* this._takeFileExtensionProcessors(plugins, ctx);\n }\n\n // Yield the config data except `extends` and `overrides`.\n yield {\n\n // Debug information.\n type: ctx.type,\n name: ctx.name,\n filePath: ctx.filePath,\n\n // Config data.\n criteria: null,\n env,\n globals,\n ignorePattern,\n noInlineConfig,\n parser,\n parserOptions,\n plugins,\n processor,\n reportUnusedDisableDirectives,\n root,\n rules,\n settings\n };\n\n // Flatten `overries`.\n for (let i = 0; i < overrideList.length; ++i) {\n yield* this._normalizeObjectConfigData(\n overrideList[i],\n { ...ctx, name: `${ctx.name}#overrides[${i}]` }\n );\n }\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _loadExtends(extendName, ctx) {\n debug(\"Loading {extends:%j} relative to %s\", extendName, ctx.filePath);\n try {\n if (extendName.startsWith(\"eslint:\")) {\n return this._loadExtendedBuiltInConfig(extendName, ctx);\n }\n if (extendName.startsWith(\"plugin:\")) {\n return this._loadExtendedPluginConfig(extendName, ctx);\n }\n return this._loadExtendedShareableConfig(extendName, ctx);\n } catch (error) {\n error.message += `\\nReferenced from: ${ctx.filePath || ctx.name}`;\n throw error;\n }\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _loadExtendedBuiltInConfig(extendName, ctx) {\n const {\n eslintAllPath,\n getEslintAllConfig,\n eslintRecommendedPath,\n getEslintRecommendedConfig\n } = internalSlotsMap.get(this);\n\n if (extendName === \"eslint:recommended\") {\n const name = `${ctx.name} » ${extendName}`;\n\n if (getEslintRecommendedConfig) {\n if (typeof getEslintRecommendedConfig !== \"function\") {\n throw new Error(`getEslintRecommendedConfig must be a function instead of '${getEslintRecommendedConfig}'`);\n }\n return this._normalizeConfigData(getEslintRecommendedConfig(), { ...ctx, name, filePath: \"\" });\n }\n return this._loadConfigData({\n ...ctx,\n name,\n filePath: eslintRecommendedPath\n });\n }\n if (extendName === \"eslint:all\") {\n const name = `${ctx.name} » ${extendName}`;\n\n if (getEslintAllConfig) {\n if (typeof getEslintAllConfig !== \"function\") {\n throw new Error(`getEslintAllConfig must be a function instead of '${getEslintAllConfig}'`);\n }\n return this._normalizeConfigData(getEslintAllConfig(), { ...ctx, name, filePath: \"\" });\n }\n return this._loadConfigData({\n ...ctx,\n name,\n filePath: eslintAllPath\n });\n }\n\n throw configInvalidError(extendName, ctx.name, \"extend-config-missing\");\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _loadExtendedPluginConfig(extendName, ctx) {\n const slashIndex = extendName.lastIndexOf(\"/\");\n\n if (slashIndex === -1) {\n throw configInvalidError(extendName, ctx.filePath, \"plugin-invalid\");\n }\n\n const pluginName = extendName.slice(\"plugin:\".length, slashIndex);\n const configName = extendName.slice(slashIndex + 1);\n\n if (isFilePath(pluginName)) {\n throw new Error(\"'extends' cannot use a file path for plugins.\");\n }\n\n const plugin = this._loadPlugin(pluginName, ctx);\n const configData =\n plugin.definition &&\n plugin.definition.configs[configName];\n\n if (configData) {\n return this._normalizeConfigData(configData, {\n ...ctx,\n filePath: plugin.filePath || ctx.filePath,\n name: `${ctx.name} » plugin:${plugin.id}/${configName}`\n });\n }\n\n throw plugin.error || configInvalidError(extendName, ctx.filePath, \"extend-config-missing\");\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _loadExtendedShareableConfig(extendName, ctx) {\n const { cwd, resolver } = internalSlotsMap.get(this);\n const relativeTo = ctx.filePath || path.join(cwd, \"__placeholder__.js\");\n let request;\n\n if (isFilePath(extendName)) {\n request = extendName;\n } else if (extendName.startsWith(\".\")) {\n request = `./${extendName}`; // For backward compatibility. A ton of tests depended on this behavior.\n } else {\n request = naming.normalizePackageName(\n extendName,\n \"eslint-config\"\n );\n }\n\n let filePath;\n\n try {\n filePath = resolver.resolve(request, relativeTo);\n } catch (error) {\n /* istanbul ignore else */\n if (error && error.code === \"MODULE_NOT_FOUND\") {\n throw configInvalidError(extendName, ctx.filePath, \"extend-config-missing\");\n }\n throw error;\n }\n\n writeDebugLogForLoading(request, relativeTo, filePath);\n return this._loadConfigData({\n ...ctx,\n filePath,\n name: `${ctx.name} » ${request}`\n });\n }\n\n /**\n * Load given plugins.\n * @param {string[]} names The plugin names to load.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {Record} The loaded parser.\n * @private\n */\n _loadPlugins(names, ctx) {\n return names.reduce((map, name) => {\n if (isFilePath(name)) {\n throw new Error(\"Plugins array cannot includes file paths.\");\n }\n const plugin = this._loadPlugin(name, ctx);\n\n map[plugin.id] = plugin;\n\n return map;\n }, {});\n }\n\n /**\n * Load a given parser.\n * @param {string} nameOrPath The package name or the path to a parser file.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {DependentParser} The loaded parser.\n */\n _loadParser(nameOrPath, ctx) {\n debug(\"Loading parser %j from %s\", nameOrPath, ctx.filePath);\n\n const { cwd, resolver } = internalSlotsMap.get(this);\n const relativeTo = ctx.filePath || path.join(cwd, \"__placeholder__.js\");\n\n try {\n const filePath = resolver.resolve(nameOrPath, relativeTo);\n\n writeDebugLogForLoading(nameOrPath, relativeTo, filePath);\n\n return new ConfigDependency({\n definition: require(filePath),\n filePath,\n id: nameOrPath,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n } catch (error) {\n\n // If the parser name is \"espree\", load the espree of ESLint.\n if (nameOrPath === \"espree\") {\n debug(\"Fallback espree.\");\n return new ConfigDependency({\n definition: require(\"espree\"),\n filePath: require.resolve(\"espree\"),\n id: nameOrPath,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n debug(\"Failed to load parser '%s' declared in '%s'.\", nameOrPath, ctx.name);\n error.message = `Failed to load parser '${nameOrPath}' declared in '${ctx.name}': ${error.message}`;\n\n return new ConfigDependency({\n error,\n id: nameOrPath,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n }\n\n /**\n * Load a given plugin.\n * @param {string} name The plugin name to load.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {DependentPlugin} The loaded plugin.\n * @private\n */\n _loadPlugin(name, ctx) {\n debug(\"Loading plugin %j from %s\", name, ctx.filePath);\n\n const { additionalPluginPool, resolver } = internalSlotsMap.get(this);\n const request = naming.normalizePackageName(name, \"eslint-plugin\");\n const id = naming.getShorthandName(request, \"eslint-plugin\");\n const relativeTo = path.join(ctx.pluginBasePath, \"__placeholder__.js\");\n\n if (name.match(/\\s+/u)) {\n const error = Object.assign(\n new Error(`Whitespace found in plugin name '${name}'`),\n {\n messageTemplate: \"whitespace-found\",\n messageData: { pluginName: request }\n }\n );\n\n return new ConfigDependency({\n error,\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n // Check for additional pool.\n const plugin =\n additionalPluginPool.get(request) ||\n additionalPluginPool.get(id);\n\n if (plugin) {\n return new ConfigDependency({\n definition: normalizePlugin(plugin),\n filePath: \"\", // It's unknown where the plugin came from.\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n let filePath;\n let error;\n\n try {\n filePath = resolver.resolve(request, relativeTo);\n } catch (resolveError) {\n error = resolveError;\n /* istanbul ignore else */\n if (error && error.code === \"MODULE_NOT_FOUND\") {\n error.messageTemplate = \"plugin-missing\";\n error.messageData = {\n pluginName: request,\n resolvePluginsRelativeTo: ctx.pluginBasePath,\n importerName: ctx.name\n };\n }\n }\n\n if (filePath) {\n try {\n writeDebugLogForLoading(request, relativeTo, filePath);\n\n const startTime = Date.now();\n const pluginDefinition = require(filePath);\n\n debug(`Plugin ${filePath} loaded in: ${Date.now() - startTime}ms`);\n\n return new ConfigDependency({\n definition: normalizePlugin(pluginDefinition),\n filePath,\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n } catch (loadError) {\n error = loadError;\n }\n }\n\n debug(\"Failed to load plugin '%s' declared in '%s'.\", name, ctx.name);\n error.message = `Failed to load plugin '${name}' declared in '${ctx.name}': ${error.message}`;\n return new ConfigDependency({\n error,\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n /**\n * Take file expression processors as config array elements.\n * @param {Record} plugins The plugin definitions.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The config array elements of file expression processors.\n * @private\n */\n *_takeFileExtensionProcessors(plugins, ctx) {\n for (const pluginId of Object.keys(plugins)) {\n const processors =\n plugins[pluginId] &&\n plugins[pluginId].definition &&\n plugins[pluginId].definition.processors;\n\n if (!processors) {\n continue;\n }\n\n for (const processorId of Object.keys(processors)) {\n if (processorId.startsWith(\".\")) {\n yield* this._normalizeObjectConfigData(\n {\n files: [`*${processorId}`],\n processor: `${pluginId}/${processorId}`\n },\n {\n ...ctx,\n type: \"implicit-processor\",\n name: `${ctx.name}#processors[\"${pluginId}/${processorId}\"]`\n }\n );\n }\n }\n }\n }\n}\n\nexport { ConfigArrayFactory, createContext };\n","/**\n * @fileoverview `CascadingConfigArrayFactory` class.\n *\n * `CascadingConfigArrayFactory` class has a responsibility:\n *\n * 1. Handles cascading of config files.\n *\n * It provides two methods:\n *\n * - `getConfigArrayForFile(filePath)`\n * Get the corresponded configuration of a given file. This method doesn't\n * throw even if the given file didn't exist.\n * - `clearCache()`\n * Clear the internal cache. You have to call this method when\n * `additionalPluginPool` was updated if `baseConfig` or `cliConfig` depends\n * on the additional plugins. (`CLIEngine#addPlugin()` method calls this.)\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport debugOrig from \"debug\";\nimport os from \"os\";\nimport path from \"path\";\n\nimport { ConfigArrayFactory } from \"./config-array-factory.js\";\nimport {\n ConfigArray,\n ConfigDependency,\n IgnorePattern\n} from \"./config-array/index.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport { emitDeprecationWarning } from \"./shared/deprecation-warnings.js\";\n\nconst debug = debugOrig(\"eslintrc:cascading-config-array-factory\");\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n// Define types for VSCode IntelliSense.\n/** @typedef {import(\"./shared/types\").ConfigData} ConfigData */\n/** @typedef {import(\"./shared/types\").Parser} Parser */\n/** @typedef {import(\"./shared/types\").Plugin} Plugin */\n/** @typedef {import(\"./shared/types\").Rule} Rule */\n/** @typedef {ReturnType} ConfigArray */\n\n/**\n * @typedef {Object} CascadingConfigArrayFactoryOptions\n * @property {Map} [additionalPluginPool] The map for additional plugins.\n * @property {ConfigData} [baseConfig] The config by `baseConfig` option.\n * @property {ConfigData} [cliConfig] The config by CLI options (`--env`, `--global`, `--ignore-pattern`, `--parser`, `--parser-options`, `--plugin`, and `--rule`). CLI options overwrite the setting in config files.\n * @property {string} [cwd] The base directory to start lookup.\n * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`.\n * @property {string[]} [rulePaths] The value of `--rulesdir` option.\n * @property {string} [specificConfigPath] The value of `--config` option.\n * @property {boolean} [useEslintrc] if `false` then it doesn't load config files.\n * @property {Function} loadRules The function to use to load rules.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/**\n * @typedef {Object} CascadingConfigArrayFactoryInternalSlots\n * @property {ConfigArray} baseConfigArray The config array of `baseConfig` option.\n * @property {ConfigData} baseConfigData The config data of `baseConfig` option. This is used to reset `baseConfigArray`.\n * @property {ConfigArray} cliConfigArray The config array of CLI options.\n * @property {ConfigData} cliConfigData The config data of CLI options. This is used to reset `cliConfigArray`.\n * @property {ConfigArrayFactory} configArrayFactory The factory for config arrays.\n * @property {Map} configCache The cache from directory paths to config arrays.\n * @property {string} cwd The base directory to start lookup.\n * @property {WeakMap} finalizeCache The cache from config arrays to finalized config arrays.\n * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`.\n * @property {string[]|null} rulePaths The value of `--rulesdir` option. This is used to reset `baseConfigArray`.\n * @property {string|null} specificConfigPath The value of `--config` option. This is used to reset `cliConfigArray`.\n * @property {boolean} useEslintrc if `false` then it doesn't load config files.\n * @property {Function} loadRules The function to use to load rules.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/** @type {WeakMap} */\nconst internalSlotsMap = new WeakMap();\n\n/**\n * Create the config array from `baseConfig` and `rulePaths`.\n * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots.\n * @returns {ConfigArray} The config array of the base configs.\n */\nfunction createBaseConfigArray({\n configArrayFactory,\n baseConfigData,\n rulePaths,\n cwd,\n loadRules\n}) {\n const baseConfigArray = configArrayFactory.create(\n baseConfigData,\n { name: \"BaseConfig\" }\n );\n\n /*\n * Create the config array element for the default ignore patterns.\n * This element has `ignorePattern` property that ignores the default\n * patterns in the current working directory.\n */\n baseConfigArray.unshift(configArrayFactory.create(\n { ignorePatterns: IgnorePattern.DefaultPatterns },\n { name: \"DefaultIgnorePattern\" }\n )[0]);\n\n /*\n * Load rules `--rulesdir` option as a pseudo plugin.\n * Use a pseudo plugin to define rules of `--rulesdir`, so we can validate\n * the rule's options with only information in the config array.\n */\n if (rulePaths && rulePaths.length > 0) {\n baseConfigArray.push({\n type: \"config\",\n name: \"--rulesdir\",\n filePath: \"\",\n plugins: {\n \"\": new ConfigDependency({\n definition: {\n rules: rulePaths.reduce(\n (map, rulesPath) => Object.assign(\n map,\n loadRules(rulesPath, cwd)\n ),\n {}\n )\n },\n filePath: \"\",\n id: \"\",\n importerName: \"--rulesdir\",\n importerPath: \"\"\n })\n }\n });\n }\n\n return baseConfigArray;\n}\n\n/**\n * Create the config array from CLI options.\n * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots.\n * @returns {ConfigArray} The config array of the base configs.\n */\nfunction createCLIConfigArray({\n cliConfigData,\n configArrayFactory,\n cwd,\n ignorePath,\n specificConfigPath\n}) {\n const cliConfigArray = configArrayFactory.create(\n cliConfigData,\n { name: \"CLIOptions\" }\n );\n\n cliConfigArray.unshift(\n ...(ignorePath\n ? configArrayFactory.loadESLintIgnore(ignorePath)\n : configArrayFactory.loadDefaultESLintIgnore())\n );\n\n if (specificConfigPath) {\n cliConfigArray.unshift(\n ...configArrayFactory.loadFile(\n specificConfigPath,\n { name: \"--config\", basePath: cwd }\n )\n );\n }\n\n return cliConfigArray;\n}\n\n/**\n * The error type when there are files matched by a glob, but all of them have been ignored.\n */\nclass ConfigurationNotFoundError extends Error {\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @param {string} directoryPath The directory path.\n */\n constructor(directoryPath) {\n super(`No ESLint configuration found in ${directoryPath}.`);\n this.messageTemplate = \"no-config-found\";\n this.messageData = { directoryPath };\n }\n}\n\n/**\n * This class provides the functionality that enumerates every file which is\n * matched by given glob patterns and that configuration.\n */\nclass CascadingConfigArrayFactory {\n\n /**\n * Initialize this enumerator.\n * @param {CascadingConfigArrayFactoryOptions} options The options.\n */\n constructor({\n additionalPluginPool = new Map(),\n baseConfig: baseConfigData = null,\n cliConfig: cliConfigData = null,\n cwd = process.cwd(),\n ignorePath,\n resolvePluginsRelativeTo,\n rulePaths = [],\n specificConfigPath = null,\n useEslintrc = true,\n builtInRules = new Map(),\n loadRules,\n resolver,\n eslintRecommendedPath,\n getEslintRecommendedConfig,\n eslintAllPath,\n getEslintAllConfig\n } = {}) {\n const configArrayFactory = new ConfigArrayFactory({\n additionalPluginPool,\n cwd,\n resolvePluginsRelativeTo,\n builtInRules,\n resolver,\n eslintRecommendedPath,\n getEslintRecommendedConfig,\n eslintAllPath,\n getEslintAllConfig\n });\n\n internalSlotsMap.set(this, {\n baseConfigArray: createBaseConfigArray({\n baseConfigData,\n configArrayFactory,\n cwd,\n rulePaths,\n loadRules,\n resolver\n }),\n baseConfigData,\n cliConfigArray: createCLIConfigArray({\n cliConfigData,\n configArrayFactory,\n cwd,\n ignorePath,\n specificConfigPath\n }),\n cliConfigData,\n configArrayFactory,\n configCache: new Map(),\n cwd,\n finalizeCache: new WeakMap(),\n ignorePath,\n rulePaths,\n specificConfigPath,\n useEslintrc,\n builtInRules,\n loadRules\n });\n }\n\n /**\n * The path to the current working directory.\n * This is used by tests.\n * @type {string}\n */\n get cwd() {\n const { cwd } = internalSlotsMap.get(this);\n\n return cwd;\n }\n\n /**\n * Get the config array of a given file.\n * If `filePath` was not given, it returns the config which contains only\n * `baseConfigData` and `cliConfigData`.\n * @param {string} [filePath] The file path to a file.\n * @param {Object} [options] The options.\n * @param {boolean} [options.ignoreNotFoundError] If `true` then it doesn't throw `ConfigurationNotFoundError`.\n * @returns {ConfigArray} The config array of the file.\n */\n getConfigArrayForFile(filePath, { ignoreNotFoundError = false } = {}) {\n const {\n baseConfigArray,\n cliConfigArray,\n cwd\n } = internalSlotsMap.get(this);\n\n if (!filePath) {\n return new ConfigArray(...baseConfigArray, ...cliConfigArray);\n }\n\n const directoryPath = path.dirname(path.resolve(cwd, filePath));\n\n debug(`Load config files for ${directoryPath}.`);\n\n return this._finalizeConfigArray(\n this._loadConfigInAncestors(directoryPath),\n directoryPath,\n ignoreNotFoundError\n );\n }\n\n /**\n * Set the config data to override all configs.\n * Require to call `clearCache()` method after this method is called.\n * @param {ConfigData} configData The config data to override all configs.\n * @returns {void}\n */\n setOverrideConfig(configData) {\n const slots = internalSlotsMap.get(this);\n\n slots.cliConfigData = configData;\n }\n\n /**\n * Clear config cache.\n * @returns {void}\n */\n clearCache() {\n const slots = internalSlotsMap.get(this);\n\n slots.baseConfigArray = createBaseConfigArray(slots);\n slots.cliConfigArray = createCLIConfigArray(slots);\n slots.configCache.clear();\n }\n\n /**\n * Load and normalize config files from the ancestor directories.\n * @param {string} directoryPath The path to a leaf directory.\n * @param {boolean} configsExistInSubdirs `true` if configurations exist in subdirectories.\n * @returns {ConfigArray} The loaded config.\n * @private\n */\n _loadConfigInAncestors(directoryPath, configsExistInSubdirs = false) {\n const {\n baseConfigArray,\n configArrayFactory,\n configCache,\n cwd,\n useEslintrc\n } = internalSlotsMap.get(this);\n\n if (!useEslintrc) {\n return baseConfigArray;\n }\n\n let configArray = configCache.get(directoryPath);\n\n // Hit cache.\n if (configArray) {\n debug(`Cache hit: ${directoryPath}.`);\n return configArray;\n }\n debug(`No cache found: ${directoryPath}.`);\n\n const homePath = os.homedir();\n\n // Consider this is root.\n if (directoryPath === homePath && cwd !== homePath) {\n debug(\"Stop traversing because of considered root.\");\n if (configsExistInSubdirs) {\n const filePath = ConfigArrayFactory.getPathToConfigFileInDirectory(directoryPath);\n\n if (filePath) {\n emitDeprecationWarning(\n filePath,\n \"ESLINT_PERSONAL_CONFIG_SUPPRESS\"\n );\n }\n }\n return this._cacheConfig(directoryPath, baseConfigArray);\n }\n\n // Load the config on this directory.\n try {\n configArray = configArrayFactory.loadInDirectory(directoryPath);\n } catch (error) {\n /* istanbul ignore next */\n if (error.code === \"EACCES\") {\n debug(\"Stop traversing because of 'EACCES' error.\");\n return this._cacheConfig(directoryPath, baseConfigArray);\n }\n throw error;\n }\n\n if (configArray.length > 0 && configArray.isRoot()) {\n debug(\"Stop traversing because of 'root:true'.\");\n configArray.unshift(...baseConfigArray);\n return this._cacheConfig(directoryPath, configArray);\n }\n\n // Load from the ancestors and merge it.\n const parentPath = path.dirname(directoryPath);\n const parentConfigArray = parentPath && parentPath !== directoryPath\n ? this._loadConfigInAncestors(\n parentPath,\n configsExistInSubdirs || configArray.length > 0\n )\n : baseConfigArray;\n\n if (configArray.length > 0) {\n configArray.unshift(...parentConfigArray);\n } else {\n configArray = parentConfigArray;\n }\n\n // Cache and return.\n return this._cacheConfig(directoryPath, configArray);\n }\n\n /**\n * Freeze and cache a given config.\n * @param {string} directoryPath The path to a directory as a cache key.\n * @param {ConfigArray} configArray The config array as a cache value.\n * @returns {ConfigArray} The `configArray` (frozen).\n */\n _cacheConfig(directoryPath, configArray) {\n const { configCache } = internalSlotsMap.get(this);\n\n Object.freeze(configArray);\n configCache.set(directoryPath, configArray);\n\n return configArray;\n }\n\n /**\n * Finalize a given config array.\n * Concatenate `--config` and other CLI options.\n * @param {ConfigArray} configArray The parent config array.\n * @param {string} directoryPath The path to the leaf directory to find config files.\n * @param {boolean} ignoreNotFoundError If `true` then it doesn't throw `ConfigurationNotFoundError`.\n * @returns {ConfigArray} The loaded config.\n * @private\n */\n _finalizeConfigArray(configArray, directoryPath, ignoreNotFoundError) {\n const {\n cliConfigArray,\n configArrayFactory,\n finalizeCache,\n useEslintrc,\n builtInRules\n } = internalSlotsMap.get(this);\n\n let finalConfigArray = finalizeCache.get(configArray);\n\n if (!finalConfigArray) {\n finalConfigArray = configArray;\n\n // Load the personal config if there are no regular config files.\n if (\n useEslintrc &&\n configArray.every(c => !c.filePath) &&\n cliConfigArray.every(c => !c.filePath) // `--config` option can be a file.\n ) {\n const homePath = os.homedir();\n\n debug(\"Loading the config file of the home directory:\", homePath);\n\n const personalConfigArray = configArrayFactory.loadInDirectory(\n homePath,\n { name: \"PersonalConfig\" }\n );\n\n if (\n personalConfigArray.length > 0 &&\n !directoryPath.startsWith(homePath)\n ) {\n const lastElement =\n personalConfigArray[personalConfigArray.length - 1];\n\n emitDeprecationWarning(\n lastElement.filePath,\n \"ESLINT_PERSONAL_CONFIG_LOAD\"\n );\n }\n\n finalConfigArray = finalConfigArray.concat(personalConfigArray);\n }\n\n // Apply CLI options.\n if (cliConfigArray.length > 0) {\n finalConfigArray = finalConfigArray.concat(cliConfigArray);\n }\n\n // Validate rule settings and environments.\n const validator = new ConfigValidator({\n builtInRules\n });\n\n validator.validateConfigArray(finalConfigArray);\n\n // Cache it.\n Object.freeze(finalConfigArray);\n finalizeCache.set(configArray, finalConfigArray);\n\n debug(\n \"Configuration was determined: %o on %s\",\n finalConfigArray,\n directoryPath\n );\n }\n\n // At least one element (the default ignore patterns) exists.\n if (!ignoreNotFoundError && useEslintrc && finalConfigArray.length <= 1) {\n throw new ConfigurationNotFoundError(directoryPath);\n }\n\n return finalConfigArray;\n }\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport { CascadingConfigArrayFactory };\n","/**\n * @fileoverview Compatibility class for flat config.\n * @author Nicholas C. Zakas\n */\n\n//-----------------------------------------------------------------------------\n// Requirements\n//-----------------------------------------------------------------------------\n\nimport createDebug from \"debug\";\nimport path from \"path\";\n\nimport environments from \"../conf/environments.js\";\nimport { ConfigArrayFactory } from \"./config-array-factory.js\";\n\n//-----------------------------------------------------------------------------\n// Helpers\n//-----------------------------------------------------------------------------\n\n/** @typedef {import(\"../../shared/types\").Environment} Environment */\n/** @typedef {import(\"../../shared/types\").Processor} Processor */\n\nconst debug = createDebug(\"eslintrc:flat-compat\");\nconst cafactory = Symbol(\"cafactory\");\n\n/**\n * Translates an ESLintRC-style config object into a flag-config-style config\n * object.\n * @param {Object} eslintrcConfig An ESLintRC-style config object.\n * @param {Object} options Options to help translate the config.\n * @param {string} options.resolveConfigRelativeTo To the directory to resolve\n * configs from.\n * @param {string} options.resolvePluginsRelativeTo The directory to resolve\n * plugins from.\n * @param {ReadOnlyMap} options.pluginEnvironments A map of plugin environment\n * names to objects.\n * @param {ReadOnlyMap} options.pluginProcessors A map of plugin processor\n * names to objects.\n * @returns {Object} A flag-config-style config object.\n */\nfunction translateESLintRC(eslintrcConfig, {\n resolveConfigRelativeTo,\n resolvePluginsRelativeTo,\n pluginEnvironments,\n pluginProcessors\n}) {\n\n const flatConfig = {};\n const configs = [];\n const languageOptions = {};\n const linterOptions = {};\n const keysToCopy = [\"settings\", \"rules\", \"processor\"];\n const languageOptionsKeysToCopy = [\"globals\", \"parser\", \"parserOptions\"];\n const linterOptionsKeysToCopy = [\"noInlineConfig\", \"reportUnusedDisableDirectives\"];\n\n // check for special settings for eslint:all and eslint:recommended:\n if (eslintrcConfig.settings) {\n if (eslintrcConfig.settings[\"eslint:all\"] === true) {\n return [\"eslint:all\"];\n }\n\n if (eslintrcConfig.settings[\"eslint:recommended\"] === true) {\n return [\"eslint:recommended\"];\n }\n }\n\n // copy over simple translations\n for (const key of keysToCopy) {\n if (key in eslintrcConfig && typeof eslintrcConfig[key] !== \"undefined\") {\n flatConfig[key] = eslintrcConfig[key];\n }\n }\n\n // copy over languageOptions\n for (const key of languageOptionsKeysToCopy) {\n if (key in eslintrcConfig && typeof eslintrcConfig[key] !== \"undefined\") {\n\n // create the languageOptions key in the flat config\n flatConfig.languageOptions = languageOptions;\n\n if (key === \"parser\") {\n debug(`Resolving parser '${languageOptions[key]}' relative to ${resolveConfigRelativeTo}`);\n\n if (eslintrcConfig[key].error) {\n throw eslintrcConfig[key].error;\n }\n\n languageOptions[key] = eslintrcConfig[key].definition;\n continue;\n }\n\n // clone any object values that are in the eslintrc config\n if (eslintrcConfig[key] && typeof eslintrcConfig[key] === \"object\") {\n languageOptions[key] = {\n ...eslintrcConfig[key]\n };\n } else {\n languageOptions[key] = eslintrcConfig[key];\n }\n }\n }\n\n // copy over linterOptions\n for (const key of linterOptionsKeysToCopy) {\n if (key in eslintrcConfig && typeof eslintrcConfig[key] !== \"undefined\") {\n flatConfig.linterOptions = linterOptions;\n linterOptions[key] = eslintrcConfig[key];\n }\n }\n\n // move ecmaVersion a level up\n if (languageOptions.parserOptions) {\n\n if (\"ecmaVersion\" in languageOptions.parserOptions) {\n languageOptions.ecmaVersion = languageOptions.parserOptions.ecmaVersion;\n delete languageOptions.parserOptions.ecmaVersion;\n }\n\n if (\"sourceType\" in languageOptions.parserOptions) {\n languageOptions.sourceType = languageOptions.parserOptions.sourceType;\n delete languageOptions.parserOptions.sourceType;\n }\n\n // check to see if we even need parserOptions anymore and remove it if not\n if (Object.keys(languageOptions.parserOptions).length === 0) {\n delete languageOptions.parserOptions;\n }\n }\n\n // overrides\n if (eslintrcConfig.criteria) {\n flatConfig.files = [absoluteFilePath => eslintrcConfig.criteria.test(absoluteFilePath)];\n }\n\n // translate plugins\n if (eslintrcConfig.plugins && typeof eslintrcConfig.plugins === \"object\") {\n debug(`Translating plugins: ${eslintrcConfig.plugins}`);\n\n flatConfig.plugins = {};\n\n for (const pluginName of Object.keys(eslintrcConfig.plugins)) {\n\n debug(`Translating plugin: ${pluginName}`);\n debug(`Resolving plugin '${pluginName} relative to ${resolvePluginsRelativeTo}`);\n\n const { definition: plugin, error } = eslintrcConfig.plugins[pluginName];\n\n if (error) {\n throw error;\n }\n\n flatConfig.plugins[pluginName] = plugin;\n\n // create a config for any processors\n if (plugin.processors) {\n for (const processorName of Object.keys(plugin.processors)) {\n if (processorName.startsWith(\".\")) {\n debug(`Assigning processor: ${pluginName}/${processorName}`);\n\n configs.unshift({\n files: [`**/*${processorName}`],\n processor: pluginProcessors.get(`${pluginName}/${processorName}`)\n });\n }\n\n }\n }\n }\n }\n\n // translate env - must come after plugins\n if (eslintrcConfig.env && typeof eslintrcConfig.env === \"object\") {\n for (const envName of Object.keys(eslintrcConfig.env)) {\n\n // only add environments that are true\n if (eslintrcConfig.env[envName]) {\n debug(`Translating environment: ${envName}`);\n\n if (environments.has(envName)) {\n\n // built-in environments should be defined first\n configs.unshift(...translateESLintRC(environments.get(envName), {\n resolveConfigRelativeTo,\n resolvePluginsRelativeTo\n }));\n } else if (pluginEnvironments.has(envName)) {\n\n // if the environment comes from a plugin, it should come after the plugin config\n configs.push(...translateESLintRC(pluginEnvironments.get(envName), {\n resolveConfigRelativeTo,\n resolvePluginsRelativeTo\n }));\n }\n }\n }\n }\n\n // only add if there are actually keys in the config\n if (Object.keys(flatConfig).length > 0) {\n configs.push(flatConfig);\n }\n\n return configs;\n}\n\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\n/**\n * A compatibility class for working with configs.\n */\nclass FlatCompat {\n\n constructor({\n baseDirectory = process.cwd(),\n resolvePluginsRelativeTo = baseDirectory\n } = {}) {\n this.baseDirectory = baseDirectory;\n this.resolvePluginsRelativeTo = resolvePluginsRelativeTo;\n this[cafactory] = new ConfigArrayFactory({\n cwd: baseDirectory,\n resolvePluginsRelativeTo,\n getEslintAllConfig: () => ({ settings: { \"eslint:all\": true } }),\n getEslintRecommendedConfig: () => ({ settings: { \"eslint:recommended\": true } })\n });\n }\n\n /**\n * Translates an ESLintRC-style config into a flag-config-style config.\n * @param {Object} eslintrcConfig The ESLintRC-style config object.\n * @returns {Object} A flag-config-style config object.\n */\n config(eslintrcConfig) {\n const eslintrcArray = this[cafactory].create(eslintrcConfig, {\n basePath: this.baseDirectory\n });\n\n const flatArray = [];\n let hasIgnorePatterns = false;\n\n eslintrcArray.forEach(configData => {\n if (configData.type === \"config\") {\n hasIgnorePatterns = hasIgnorePatterns || configData.ignorePattern;\n flatArray.push(...translateESLintRC(configData, {\n resolveConfigRelativeTo: path.join(this.baseDirectory, \"__placeholder.js\"),\n resolvePluginsRelativeTo: path.join(this.resolvePluginsRelativeTo, \"__placeholder.js\"),\n pluginEnvironments: eslintrcArray.pluginEnvironments,\n pluginProcessors: eslintrcArray.pluginProcessors\n }));\n }\n });\n\n // combine ignorePatterns to emulate ESLintRC behavior better\n if (hasIgnorePatterns) {\n flatArray.unshift({\n ignores: [filePath => {\n\n // Compute the final config for this file.\n // This filters config array elements by `files`/`excludedFiles` then merges the elements.\n const finalConfig = eslintrcArray.extractConfig(filePath);\n\n // Test the `ignorePattern` properties of the final config.\n return Boolean(finalConfig.ignores) && finalConfig.ignores(filePath);\n }]\n });\n }\n\n return flatArray;\n }\n\n /**\n * Translates the `env` section of an ESLintRC-style config.\n * @param {Object} envConfig The `env` section of an ESLintRC config.\n * @returns {Object} A flag-config object representing the environments.\n */\n env(envConfig) {\n return this.config({\n env: envConfig\n });\n }\n\n /**\n * Translates the `extends` section of an ESLintRC-style config.\n * @param {...string} configsToExtend The names of the configs to load.\n * @returns {Object} A flag-config object representing the config.\n */\n extends(...configsToExtend) {\n return this.config({\n extends: configsToExtend\n });\n }\n\n /**\n * Translates the `plugins` section of an ESLintRC-style config.\n * @param {...string} plugins The names of the plugins to load.\n * @returns {Object} A flag-config object representing the plugins.\n */\n plugins(...plugins) {\n return this.config({\n plugins\n });\n }\n}\n\nexport { FlatCompat };\n","/**\n * @fileoverview Package exports for @eslint/eslintrc\n * @author Nicholas C. Zakas\n */\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport {\n ConfigArrayFactory,\n createContext as createConfigArrayFactoryContext\n} from \"./config-array-factory.js\";\n\nimport { CascadingConfigArrayFactory } from \"./cascading-config-array-factory.js\";\nimport * as ModuleResolver from \"./shared/relative-module-resolver.js\";\nimport { ConfigArray, getUsedExtractedConfigs } from \"./config-array/index.js\";\nimport { ConfigDependency } from \"./config-array/config-dependency.js\";\nimport { ExtractedConfig } from \"./config-array/extracted-config.js\";\nimport { IgnorePattern } from \"./config-array/ignore-pattern.js\";\nimport { OverrideTester } from \"./config-array/override-tester.js\";\nimport * as ConfigOps from \"./shared/config-ops.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport * as naming from \"./shared/naming.js\";\nimport { FlatCompat } from \"./flat-compat.js\";\nimport environments from \"../conf/environments.js\";\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\nconst Legacy = {\n ConfigArray,\n createConfigArrayFactoryContext,\n CascadingConfigArrayFactory,\n ConfigArrayFactory,\n ConfigDependency,\n ExtractedConfig,\n IgnorePattern,\n OverrideTester,\n getUsedExtractedConfigs,\n environments,\n\n // shared\n ConfigOps,\n ConfigValidator,\n ModuleResolver,\n naming\n};\n\nexport {\n\n Legacy,\n\n FlatCompat\n\n};\n"],"names":["debug","debugOrig","path","ignore","assert","internalSlotsMap","util","minimatch","Ajv","globals","BuiltInEnvironments","ConfigOps.normalizeConfigGlobal","Module","require","createRequire","fs","stripComments","importFresh","ModuleResolver.resolve","naming.normalizePackageName","naming.getShorthandName","os","createDebug","createConfigArrayFactoryContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA,MAAMA,OAAK,GAAGC,6BAAS,CAAC,yBAAyB,CAAC,CAAC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB,CAAC,WAAW,EAAE;AAC5C,IAAI,IAAI,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAChC;AACA,IAAI,KAAK,IAAI,CAAC,GAAG,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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAsBA;AACA,MAAMC,SAAO,GAAGC,oBAAa,CAAC,mDAAe,CAAC,CAAC;AAC/C;AACA,MAAMd,OAAK,GAAGC,6BAAS,CAAC,+BAA+B,CAAC,CAAC;AACzD;AACA;AACA;AACA;AACA;AACA,MAAM,eAAe,GAAG;AACxB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,WAAW;AACf,IAAI,cAAc;AAClB,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,kBAAgB,GAAG,IAAI,OAAO,EAAE,CAAC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,UAAU,EAAE;AAChC,IAAI;AACJ,QAAQ,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC;AACzC,QAAQH,wBAAI,CAAC,UAAU,CAAC,UAAU,CAAC;AACnC,MAAM;AACN,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ,CAAC,QAAQ,EAAE;AAC5B,IAAI,OAAOa,sBAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AACrE,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,kBAAkB,CAAC,QAAQ,E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AAC/B,IAAI,kBAAkB;AACtB,IAAI,gBAAgB;AACpB,IAAI,eAAe;AACnB,IAAI,aAAa;AACjB,IAAI,cAAc;AAClB,IAAI,uBAAuB;AAC3B,IAAI,YAAY;AAChB;AACA;AACA,IAAI,SAAS;AACb,IAAI,eAAe;AACnB,IAAI,cAAc;AAClB,IAAI,MAAM;AACV;;;;;"} +\ No newline at end of file ++{"version":3,"file":"eslintrc.cjs","sources":["../lib/config-array/ignore-pattern.js","../lib/config-array/extracted-config.js","../lib/config-array/config-array.js","../lib/config-array/config-dependency.js","../lib/config-array/override-tester.js","../lib/config-array/index.js","../lib/shared/config-ops.js","../lib/shared/deprecation-warnings.js","../lib/shared/ajv.js","../conf/config-schema.js","../conf/environments.js","../lib/shared/config-validator.js","../lib/shared/naming.js","../lib/shared/relative-module-resolver.js","../lib/config-array-factory.js","../lib/cascading-config-array-factory.js","../lib/flat-compat.js","../lib/index.js"],"sourcesContent":["/**\n * @fileoverview `IgnorePattern` class.\n *\n * `IgnorePattern` class has the set of glob patterns and the base path.\n *\n * It provides two static methods.\n *\n * - `IgnorePattern.createDefaultIgnore(cwd)`\n * Create the default predicate function.\n * - `IgnorePattern.createIgnore(ignorePatterns)`\n * Create the predicate function from multiple `IgnorePattern` objects.\n *\n * It provides two properties and a method.\n *\n * - `patterns`\n * The glob patterns that ignore to lint.\n * - `basePath`\n * The base path of the glob patterns. If absolute paths existed in the\n * glob patterns, those are handled as relative paths to the base path.\n * - `getPatternsRelativeTo(basePath)`\n * Get `patterns` as modified for a given base path. It modifies the\n * absolute paths in the patterns as prepending the difference of two base\n * paths.\n *\n * `ConfigArrayFactory` creates `IgnorePattern` objects when it processes\n * `ignorePatterns` properties.\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport assert from \"assert\";\nimport path from \"path\";\nimport ignore from \"ignore\";\nimport debugOrig from \"debug\";\n\nconst debug = debugOrig(\"eslintrc:ignore-pattern\");\n\n/** @typedef {ReturnType} Ignore */\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Get the path to the common ancestor directory of given paths.\n * @param {string[]} sourcePaths The paths to calculate the common ancestor.\n * @returns {string} The path to the common ancestor directory.\n */\nfunction getCommonAncestorPath(sourcePaths) {\n let result = sourcePaths[0];\n\n for (let i = 1; i < sourcePaths.length; ++i) {\n const a = result;\n const b = sourcePaths[i];\n\n // Set the shorter one (it's the common ancestor if one includes the other).\n result = a.length < b.length ? a : b;\n\n // Set the common ancestor.\n for (let j = 0, lastSepPos = 0; j < a.length && j < b.length; ++j) {\n if (a[j] !== b[j]) {\n result = a.slice(0, lastSepPos);\n break;\n }\n if (a[j] === path.sep) {\n lastSepPos = j;\n }\n }\n }\n\n let resolvedResult = result || path.sep;\n\n // if Windows common ancestor is root of drive must have trailing slash to be absolute.\n if (resolvedResult && resolvedResult.endsWith(\":\") && process.platform === \"win32\") {\n resolvedResult += path.sep;\n }\n return resolvedResult;\n}\n\n/**\n * Make relative path.\n * @param {string} from The source path to get relative path.\n * @param {string} to The destination path to get relative path.\n * @returns {string} The relative path.\n */\nfunction relative(from, to) {\n const relPath = path.relative(from, to);\n\n if (path.sep === \"/\") {\n return relPath;\n }\n return relPath.split(path.sep).join(\"/\");\n}\n\n/**\n * Get the trailing slash if existed.\n * @param {string} filePath The path to check.\n * @returns {string} The trailing slash if existed.\n */\nfunction dirSuffix(filePath) {\n const isDir = (\n filePath.endsWith(path.sep) ||\n (process.platform === \"win32\" && filePath.endsWith(\"/\"))\n );\n\n return isDir ? \"/\" : \"\";\n}\n\nconst DefaultPatterns = Object.freeze([\"/**/node_modules/*\"]);\nconst DotPatterns = Object.freeze([\".*\", \"!.eslintrc.*\", \"!../\"]);\n\n//------------------------------------------------------------------------------\n// Public\n//------------------------------------------------------------------------------\n\nclass IgnorePattern {\n\n /**\n * The default patterns.\n * @type {string[]}\n */\n static get DefaultPatterns() {\n return DefaultPatterns;\n }\n\n /**\n * Create the default predicate function.\n * @param {string} cwd The current working directory.\n * @returns {((filePath:string, dot:boolean) => boolean) & {basePath:string; patterns:string[]}}\n * The preficate function.\n * The first argument is an absolute path that is checked.\n * The second argument is the flag to not ignore dotfiles.\n * If the predicate function returned `true`, it means the path should be ignored.\n */\n static createDefaultIgnore(cwd) {\n return this.createIgnore([new IgnorePattern(DefaultPatterns, cwd)]);\n }\n\n /**\n * Create the predicate function from multiple `IgnorePattern` objects.\n * @param {IgnorePattern[]} ignorePatterns The list of ignore patterns.\n * @returns {((filePath:string, dot?:boolean) => boolean) & {basePath:string; patterns:string[]}}\n * The preficate function.\n * The first argument is an absolute path that is checked.\n * The second argument is the flag to not ignore dotfiles.\n * If the predicate function returned `true`, it means the path should be ignored.\n */\n static createIgnore(ignorePatterns) {\n debug(\"Create with: %o\", ignorePatterns);\n\n const basePath = getCommonAncestorPath(ignorePatterns.map(p => p.basePath));\n const patterns = [].concat(\n ...ignorePatterns.map(p => p.getPatternsRelativeTo(basePath))\n );\n const ig = ignore({ allowRelativePaths: true }).add([...DotPatterns, ...patterns]);\n const dotIg = ignore({ allowRelativePaths: true }).add(patterns);\n\n debug(\" processed: %o\", { basePath, patterns });\n\n return Object.assign(\n (filePath, dot = false) => {\n assert(path.isAbsolute(filePath), \"'filePath' should be an absolute path.\");\n const relPathRaw = relative(basePath, filePath);\n const relPath = relPathRaw && (relPathRaw + dirSuffix(filePath));\n const adoptedIg = dot ? dotIg : ig;\n const result = relPath !== \"\" && adoptedIg.ignores(relPath);\n\n debug(\"Check\", { filePath, dot, relativePath: relPath, result });\n return result;\n },\n { basePath, patterns }\n );\n }\n\n /**\n * Initialize a new `IgnorePattern` instance.\n * @param {string[]} patterns The glob patterns that ignore to lint.\n * @param {string} basePath The base path of `patterns`.\n */\n constructor(patterns, basePath) {\n assert(path.isAbsolute(basePath), \"'basePath' should be an absolute path.\");\n\n /**\n * The glob patterns that ignore to lint.\n * @type {string[]}\n */\n this.patterns = patterns;\n\n /**\n * The base path of `patterns`.\n * @type {string}\n */\n this.basePath = basePath;\n\n /**\n * If `true` then patterns which don't start with `/` will match the paths to the outside of `basePath`. Defaults to `false`.\n *\n * It's set `true` for `.eslintignore`, `package.json`, and `--ignore-path` for backward compatibility.\n * It's `false` as-is for `ignorePatterns` property in config files.\n * @type {boolean}\n */\n this.loose = false;\n }\n\n /**\n * Get `patterns` as modified for a given base path. It modifies the\n * absolute paths in the patterns as prepending the difference of two base\n * paths.\n * @param {string} newBasePath The base path.\n * @returns {string[]} Modifired patterns.\n */\n getPatternsRelativeTo(newBasePath) {\n assert(path.isAbsolute(newBasePath), \"'newBasePath' should be an absolute path.\");\n const { basePath, loose, patterns } = this;\n\n if (newBasePath === basePath) {\n return patterns;\n }\n const prefix = `/${relative(newBasePath, basePath)}`;\n\n return patterns.map(pattern => {\n const negative = pattern.startsWith(\"!\");\n const head = negative ? \"!\" : \"\";\n const body = negative ? pattern.slice(1) : pattern;\n\n if (body.startsWith(\"/\") || body.startsWith(\"../\")) {\n return `${head}${prefix}${body}`;\n }\n return loose ? pattern : `${head}${prefix}/**/${body}`;\n });\n }\n}\n\nexport { IgnorePattern };\n","/**\n * @fileoverview `ExtractedConfig` class.\n *\n * `ExtractedConfig` class expresses a final configuration for a specific file.\n *\n * It provides one method.\n *\n * - `toCompatibleObjectAsConfigFileContent()`\n * Convert this configuration to the compatible object as the content of\n * config files. It converts the loaded parser and plugins to strings.\n * `CLIEngine#getConfigForFile(filePath)` method uses this method.\n *\n * `ConfigArray#extractConfig(filePath)` creates a `ExtractedConfig` instance.\n *\n * @author Toru Nagashima \n */\n\nimport { IgnorePattern } from \"./ignore-pattern.js\";\n\n// For VSCode intellisense\n/** @typedef {import(\"../../shared/types\").ConfigData} ConfigData */\n/** @typedef {import(\"../../shared/types\").GlobalConf} GlobalConf */\n/** @typedef {import(\"../../shared/types\").SeverityConf} SeverityConf */\n/** @typedef {import(\"./config-dependency\").DependentParser} DependentParser */\n/** @typedef {import(\"./config-dependency\").DependentPlugin} DependentPlugin */\n\n/**\n * Check if `xs` starts with `ys`.\n * @template T\n * @param {T[]} xs The array to check.\n * @param {T[]} ys The array that may be the first part of `xs`.\n * @returns {boolean} `true` if `xs` starts with `ys`.\n */\nfunction startsWith(xs, ys) {\n return xs.length >= ys.length && ys.every((y, i) => y === xs[i]);\n}\n\n/**\n * The class for extracted config data.\n */\nclass ExtractedConfig {\n constructor() {\n\n /**\n * The config name what `noInlineConfig` setting came from.\n * @type {string}\n */\n this.configNameOfNoInlineConfig = \"\";\n\n /**\n * Environments.\n * @type {Record}\n */\n this.env = {};\n\n /**\n * Global variables.\n * @type {Record}\n */\n this.globals = {};\n\n /**\n * The glob patterns that ignore to lint.\n * @type {(((filePath:string, dot?:boolean) => boolean) & { basePath:string; patterns:string[] }) | undefined}\n */\n this.ignores = void 0;\n\n /**\n * The flag that disables directive comments.\n * @type {boolean|undefined}\n */\n this.noInlineConfig = void 0;\n\n /**\n * Parser definition.\n * @type {DependentParser|null}\n */\n this.parser = null;\n\n /**\n * Options for the parser.\n * @type {Object}\n */\n this.parserOptions = {};\n\n /**\n * Plugin definitions.\n * @type {Record}\n */\n this.plugins = {};\n\n /**\n * Processor ID.\n * @type {string|null}\n */\n this.processor = null;\n\n /**\n * The flag that reports unused `eslint-disable` directive comments.\n * @type {boolean|undefined}\n */\n this.reportUnusedDisableDirectives = void 0;\n\n /**\n * Rule settings.\n * @type {Record}\n */\n this.rules = {};\n\n /**\n * Shared settings.\n * @type {Object}\n */\n this.settings = {};\n }\n\n /**\n * Convert this config to the compatible object as a config file content.\n * @returns {ConfigData} The converted object.\n */\n toCompatibleObjectAsConfigFileContent() {\n const {\n /* eslint-disable no-unused-vars */\n configNameOfNoInlineConfig: _ignore1,\n processor: _ignore2,\n /* eslint-enable no-unused-vars */\n ignores,\n ...config\n } = this;\n\n config.parser = config.parser && config.parser.filePath;\n config.plugins = Object.keys(config.plugins).filter(Boolean).reverse();\n config.ignorePatterns = ignores ? ignores.patterns : [];\n\n // Strip the default patterns from `ignorePatterns`.\n if (startsWith(config.ignorePatterns, IgnorePattern.DefaultPatterns)) {\n config.ignorePatterns =\n config.ignorePatterns.slice(IgnorePattern.DefaultPatterns.length);\n }\n\n return config;\n }\n}\n\nexport { ExtractedConfig };\n","/**\n * @fileoverview `ConfigArray` class.\n *\n * `ConfigArray` class expresses the full of a configuration. It has the entry\n * config file, base config files that were extended, loaded parsers, and loaded\n * plugins.\n *\n * `ConfigArray` class provides three properties and two methods.\n *\n * - `pluginEnvironments`\n * - `pluginProcessors`\n * - `pluginRules`\n * The `Map` objects that contain the members of all plugins that this\n * config array contains. Those map objects don't have mutation methods.\n * Those keys are the member ID such as `pluginId/memberName`.\n * - `isRoot()`\n * If `true` then this configuration has `root:true` property.\n * - `extractConfig(filePath)`\n * Extract the final configuration for a given file. This means merging\n * every config array element which that `criteria` property matched. The\n * `filePath` argument must be an absolute path.\n *\n * `ConfigArrayFactory` provides the loading logic of config files.\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport { ExtractedConfig } from \"./extracted-config.js\";\nimport { IgnorePattern } from \"./ignore-pattern.js\";\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n// Define types for VSCode IntelliSense.\n/** @typedef {import(\"../../shared/types\").Environment} Environment */\n/** @typedef {import(\"../../shared/types\").GlobalConf} GlobalConf */\n/** @typedef {import(\"../../shared/types\").RuleConf} RuleConf */\n/** @typedef {import(\"../../shared/types\").Rule} Rule */\n/** @typedef {import(\"../../shared/types\").Plugin} Plugin */\n/** @typedef {import(\"../../shared/types\").Processor} Processor */\n/** @typedef {import(\"./config-dependency\").DependentParser} DependentParser */\n/** @typedef {import(\"./config-dependency\").DependentPlugin} DependentPlugin */\n/** @typedef {import(\"./override-tester\")[\"OverrideTester\"]} OverrideTester */\n\n/**\n * @typedef {Object} ConfigArrayElement\n * @property {string} name The name of this config element.\n * @property {string} filePath The path to the source file of this config element.\n * @property {InstanceType|null} criteria The tester for the `files` and `excludedFiles` of this config element.\n * @property {Record|undefined} env The environment settings.\n * @property {Record|undefined} globals The global variable settings.\n * @property {IgnorePattern|undefined} ignorePattern The ignore patterns.\n * @property {boolean|undefined} noInlineConfig The flag that disables directive comments.\n * @property {DependentParser|undefined} parser The parser loader.\n * @property {Object|undefined} parserOptions The parser options.\n * @property {Record|undefined} plugins The plugin loaders.\n * @property {string|undefined} processor The processor name to refer plugin's processor.\n * @property {boolean|undefined} reportUnusedDisableDirectives The flag to report unused `eslint-disable` comments.\n * @property {boolean|undefined} root The flag to express root.\n * @property {Record|undefined} rules The rule settings\n * @property {Object|undefined} settings The shared settings.\n * @property {\"config\" | \"ignore\" | \"implicit-processor\"} type The element type.\n */\n\n/**\n * @typedef {Object} ConfigArrayInternalSlots\n * @property {Map} cache The cache to extract configs.\n * @property {ReadonlyMap|null} envMap The map from environment ID to environment definition.\n * @property {ReadonlyMap|null} processorMap The map from processor ID to environment definition.\n * @property {ReadonlyMap|null} ruleMap The map from rule ID to rule definition.\n */\n\n/** @type {WeakMap} */\nconst internalSlotsMap = new class extends WeakMap {\n get(key) {\n let value = super.get(key);\n\n if (!value) {\n value = {\n cache: new Map(),\n envMap: null,\n processorMap: null,\n ruleMap: null\n };\n super.set(key, value);\n }\n\n return value;\n }\n}();\n\n/**\n * Get the indices which are matched to a given file.\n * @param {ConfigArrayElement[]} elements The elements.\n * @param {string} filePath The path to a target file.\n * @returns {number[]} The indices.\n */\nfunction getMatchedIndices(elements, filePath) {\n const indices = [];\n\n for (let i = elements.length - 1; i >= 0; --i) {\n const element = elements[i];\n\n if (!element.criteria || (filePath && element.criteria.test(filePath))) {\n indices.push(i);\n }\n }\n\n return indices;\n}\n\n/**\n * Check if a value is a non-null object.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is a non-null object.\n */\nfunction isNonNullObject(x) {\n return typeof x === \"object\" && x !== null;\n}\n\n/**\n * Merge two objects.\n *\n * Assign every property values of `y` to `x` if `x` doesn't have the property.\n * If `x`'s property value is an object, it does recursive.\n * @param {Object} target The destination to merge\n * @param {Object|undefined} source The source to merge.\n * @returns {void}\n */\nfunction mergeWithoutOverwrite(target, source) {\n if (!isNonNullObject(source)) {\n return;\n }\n\n for (const key of Object.keys(source)) {\n if (key === \"__proto__\") {\n continue;\n }\n\n if (isNonNullObject(target[key])) {\n mergeWithoutOverwrite(target[key], source[key]);\n } else if (target[key] === void 0) {\n if (isNonNullObject(source[key])) {\n target[key] = Array.isArray(source[key]) ? [] : {};\n mergeWithoutOverwrite(target[key], source[key]);\n } else if (source[key] !== void 0) {\n target[key] = source[key];\n }\n }\n }\n}\n\n/**\n * The error for plugin conflicts.\n */\nclass PluginConflictError extends Error {\n\n /**\n * Initialize this error object.\n * @param {string} pluginId The plugin ID.\n * @param {{filePath:string, importerName:string}[]} plugins The resolved plugins.\n */\n constructor(pluginId, plugins) {\n super(`Plugin \"${pluginId}\" was conflicted between ${plugins.map(p => `\"${p.importerName}\"`).join(\" and \")}.`);\n this.messageTemplate = \"plugin-conflict\";\n this.messageData = { pluginId, plugins };\n }\n}\n\n/**\n * Merge plugins.\n * `target`'s definition is prior to `source`'s.\n * @param {Record} target The destination to merge\n * @param {Record|undefined} source The source to merge.\n * @returns {void}\n */\nfunction mergePlugins(target, source) {\n if (!isNonNullObject(source)) {\n return;\n }\n\n for (const key of Object.keys(source)) {\n if (key === \"__proto__\") {\n continue;\n }\n const targetValue = target[key];\n const sourceValue = source[key];\n\n // Adopt the plugin which was found at first.\n if (targetValue === void 0) {\n if (sourceValue.error) {\n throw sourceValue.error;\n }\n target[key] = sourceValue;\n } else if (sourceValue.filePath !== targetValue.filePath) {\n throw new PluginConflictError(key, [\n {\n filePath: targetValue.filePath,\n importerName: targetValue.importerName\n },\n {\n filePath: sourceValue.filePath,\n importerName: sourceValue.importerName\n }\n ]);\n }\n }\n}\n\n/**\n * Merge rule configs.\n * `target`'s definition is prior to `source`'s.\n * @param {Record} target The destination to merge\n * @param {Record|undefined} source The source to merge.\n * @returns {void}\n */\nfunction mergeRuleConfigs(target, source) {\n if (!isNonNullObject(source)) {\n return;\n }\n\n for (const key of Object.keys(source)) {\n if (key === \"__proto__\") {\n continue;\n }\n const targetDef = target[key];\n const sourceDef = source[key];\n\n // Adopt the rule config which was found at first.\n if (targetDef === void 0) {\n if (Array.isArray(sourceDef)) {\n target[key] = [...sourceDef];\n } else {\n target[key] = [sourceDef];\n }\n\n /*\n * If the first found rule config is severity only and the current rule\n * config has options, merge the severity and the options.\n */\n } else if (\n targetDef.length === 1 &&\n Array.isArray(sourceDef) &&\n sourceDef.length >= 2\n ) {\n targetDef.push(...sourceDef.slice(1));\n }\n }\n}\n\n/**\n * Create the extracted config.\n * @param {ConfigArray} instance The config elements.\n * @param {number[]} indices The indices to use.\n * @returns {ExtractedConfig} The extracted config.\n */\nfunction createConfig(instance, indices) {\n const config = new ExtractedConfig();\n const ignorePatterns = [];\n\n // Merge elements.\n for (const index of indices) {\n const element = instance[index];\n\n // Adopt the parser which was found at first.\n if (!config.parser && element.parser) {\n if (element.parser.error) {\n throw element.parser.error;\n }\n config.parser = element.parser;\n }\n\n // Adopt the processor which was found at first.\n if (!config.processor && element.processor) {\n config.processor = element.processor;\n }\n\n // Adopt the noInlineConfig which was found at first.\n if (config.noInlineConfig === void 0 && element.noInlineConfig !== void 0) {\n config.noInlineConfig = element.noInlineConfig;\n config.configNameOfNoInlineConfig = element.name;\n }\n\n // Adopt the reportUnusedDisableDirectives which was found at first.\n if (config.reportUnusedDisableDirectives === void 0 && element.reportUnusedDisableDirectives !== void 0) {\n config.reportUnusedDisableDirectives = element.reportUnusedDisableDirectives;\n }\n\n // Collect ignorePatterns\n if (element.ignorePattern) {\n ignorePatterns.push(element.ignorePattern);\n }\n\n // Merge others.\n mergeWithoutOverwrite(config.env, element.env);\n mergeWithoutOverwrite(config.globals, element.globals);\n mergeWithoutOverwrite(config.parserOptions, element.parserOptions);\n mergeWithoutOverwrite(config.settings, element.settings);\n mergePlugins(config.plugins, element.plugins);\n mergeRuleConfigs(config.rules, element.rules);\n }\n\n // Create the predicate function for ignore patterns.\n if (ignorePatterns.length > 0) {\n config.ignores = IgnorePattern.createIgnore(ignorePatterns.reverse());\n }\n\n return config;\n}\n\n/**\n * Collect definitions.\n * @template T, U\n * @param {string} pluginId The plugin ID for prefix.\n * @param {Record} defs The definitions to collect.\n * @param {Map} map The map to output.\n * @param {function(T): U} [normalize] The normalize function for each value.\n * @returns {void}\n */\nfunction collect(pluginId, defs, map, normalize) {\n if (defs) {\n const prefix = pluginId && `${pluginId}/`;\n\n for (const [key, value] of Object.entries(defs)) {\n map.set(\n `${prefix}${key}`,\n normalize ? normalize(value) : value\n );\n }\n }\n}\n\n/**\n * Normalize a rule definition.\n * @param {Function|Rule} rule The rule definition to normalize.\n * @returns {Rule} The normalized rule definition.\n */\nfunction normalizePluginRule(rule) {\n return typeof rule === \"function\" ? { create: rule } : rule;\n}\n\n/**\n * Delete the mutation methods from a given map.\n * @param {Map} map The map object to delete.\n * @returns {void}\n */\nfunction deleteMutationMethods(map) {\n Object.defineProperties(map, {\n clear: { configurable: true, value: void 0 },\n delete: { configurable: true, value: void 0 },\n set: { configurable: true, value: void 0 }\n });\n}\n\n/**\n * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array.\n * @param {ConfigArrayElement[]} elements The config elements.\n * @param {ConfigArrayInternalSlots} slots The internal slots.\n * @returns {void}\n */\nfunction initPluginMemberMaps(elements, slots) {\n const processed = new Set();\n\n slots.envMap = new Map();\n slots.processorMap = new Map();\n slots.ruleMap = new Map();\n\n for (const element of elements) {\n if (!element.plugins) {\n continue;\n }\n\n for (const [pluginId, value] of Object.entries(element.plugins)) {\n const plugin = value.definition;\n\n if (!plugin || processed.has(pluginId)) {\n continue;\n }\n processed.add(pluginId);\n\n collect(pluginId, plugin.environments, slots.envMap);\n collect(pluginId, plugin.processors, slots.processorMap);\n collect(pluginId, plugin.rules, slots.ruleMap, normalizePluginRule);\n }\n }\n\n deleteMutationMethods(slots.envMap);\n deleteMutationMethods(slots.processorMap);\n deleteMutationMethods(slots.ruleMap);\n}\n\n/**\n * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array.\n * @param {ConfigArray} instance The config elements.\n * @returns {ConfigArrayInternalSlots} The extracted config.\n */\nfunction ensurePluginMemberMaps(instance) {\n const slots = internalSlotsMap.get(instance);\n\n if (!slots.ruleMap) {\n initPluginMemberMaps(instance, slots);\n }\n\n return slots;\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * The Config Array.\n *\n * `ConfigArray` instance contains all settings, parsers, and plugins.\n * You need to call `ConfigArray#extractConfig(filePath)` method in order to\n * extract, merge and get only the config data which is related to an arbitrary\n * file.\n * @extends {Array}\n */\nclass ConfigArray extends Array {\n\n /**\n * Get the plugin environments.\n * The returned map cannot be mutated.\n * @type {ReadonlyMap} The plugin environments.\n */\n get pluginEnvironments() {\n return ensurePluginMemberMaps(this).envMap;\n }\n\n /**\n * Get the plugin processors.\n * The returned map cannot be mutated.\n * @type {ReadonlyMap} The plugin processors.\n */\n get pluginProcessors() {\n return ensurePluginMemberMaps(this).processorMap;\n }\n\n /**\n * Get the plugin rules.\n * The returned map cannot be mutated.\n * @returns {ReadonlyMap} The plugin rules.\n */\n get pluginRules() {\n return ensurePluginMemberMaps(this).ruleMap;\n }\n\n /**\n * Check if this config has `root` flag.\n * @returns {boolean} `true` if this config array is root.\n */\n isRoot() {\n for (let i = this.length - 1; i >= 0; --i) {\n const root = this[i].root;\n\n if (typeof root === \"boolean\") {\n return root;\n }\n }\n return false;\n }\n\n /**\n * Extract the config data which is related to a given file.\n * @param {string} filePath The absolute path to the target file.\n * @returns {ExtractedConfig} The extracted config data.\n */\n extractConfig(filePath) {\n const { cache } = internalSlotsMap.get(this);\n const indices = getMatchedIndices(this, filePath);\n const cacheKey = indices.join(\",\");\n\n if (!cache.has(cacheKey)) {\n cache.set(cacheKey, createConfig(this, indices));\n }\n\n return cache.get(cacheKey);\n }\n\n /**\n * Check if a given path is an additional lint target.\n * @param {string} filePath The absolute path to the target file.\n * @returns {boolean} `true` if the file is an additional lint target.\n */\n isAdditionalTargetPath(filePath) {\n for (const { criteria, type } of this) {\n if (\n type === \"config\" &&\n criteria &&\n !criteria.endsWithWildcard &&\n criteria.test(filePath)\n ) {\n return true;\n }\n }\n return false;\n }\n}\n\n/**\n * Get the used extracted configs.\n * CLIEngine will use this method to collect used deprecated rules.\n * @param {ConfigArray} instance The config array object to get.\n * @returns {ExtractedConfig[]} The used extracted configs.\n * @private\n */\nfunction getUsedExtractedConfigs(instance) {\n const { cache } = internalSlotsMap.get(instance);\n\n return Array.from(cache.values());\n}\n\n\nexport {\n ConfigArray,\n getUsedExtractedConfigs\n};\n","/**\n * @fileoverview `ConfigDependency` class.\n *\n * `ConfigDependency` class expresses a loaded parser or plugin.\n *\n * If the parser or plugin was loaded successfully, it has `definition` property\n * and `filePath` property. Otherwise, it has `error` property.\n *\n * When `JSON.stringify()` converted a `ConfigDependency` object to a JSON, it\n * omits `definition` property.\n *\n * `ConfigArrayFactory` creates `ConfigDependency` objects when it loads parsers\n * or plugins.\n *\n * @author Toru Nagashima \n */\n\nimport util from \"util\";\n\n/**\n * The class is to store parsers or plugins.\n * This class hides the loaded object from `JSON.stringify()` and `console.log`.\n * @template T\n */\nclass ConfigDependency {\n\n /**\n * Initialize this instance.\n * @param {Object} data The dependency data.\n * @param {T} [data.definition] The dependency if the loading succeeded.\n * @param {Error} [data.error] The error object if the loading failed.\n * @param {string} [data.filePath] The actual path to the dependency if the loading succeeded.\n * @param {string} data.id The ID of this dependency.\n * @param {string} data.importerName The name of the config file which loads this dependency.\n * @param {string} data.importerPath The path to the config file which loads this dependency.\n */\n constructor({\n definition = null,\n error = null,\n filePath = null,\n id,\n importerName,\n importerPath\n }) {\n\n /**\n * The loaded dependency if the loading succeeded.\n * @type {T|null}\n */\n this.definition = definition;\n\n /**\n * The error object if the loading failed.\n * @type {Error|null}\n */\n this.error = error;\n\n /**\n * The loaded dependency if the loading succeeded.\n * @type {string|null}\n */\n this.filePath = filePath;\n\n /**\n * The ID of this dependency.\n * @type {string}\n */\n this.id = id;\n\n /**\n * The name of the config file which loads this dependency.\n * @type {string}\n */\n this.importerName = importerName;\n\n /**\n * The path to the config file which loads this dependency.\n * @type {string}\n */\n this.importerPath = importerPath;\n }\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @returns {Object} a JSON compatible object.\n */\n toJSON() {\n const obj = this[util.inspect.custom]();\n\n // Display `error.message` (`Error#message` is unenumerable).\n if (obj.error instanceof Error) {\n obj.error = { ...obj.error, message: obj.error.message };\n }\n\n return obj;\n }\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @returns {Object} an object to display by `console.log()`.\n */\n [util.inspect.custom]() {\n const {\n definition: _ignore, // eslint-disable-line no-unused-vars\n ...obj\n } = this;\n\n return obj;\n }\n}\n\n/** @typedef {ConfigDependency} DependentParser */\n/** @typedef {ConfigDependency} DependentPlugin */\n\nexport { ConfigDependency };\n","/**\n * @fileoverview `OverrideTester` class.\n *\n * `OverrideTester` class handles `files` property and `excludedFiles` property\n * of `overrides` config.\n *\n * It provides one method.\n *\n * - `test(filePath)`\n * Test if a file path matches the pair of `files` property and\n * `excludedFiles` property. The `filePath` argument must be an absolute\n * path.\n *\n * `ConfigArrayFactory` creates `OverrideTester` objects when it processes\n * `overrides` properties.\n *\n * @author Toru Nagashima \n */\n\nimport assert from \"assert\";\nimport path from \"path\";\nimport util from \"util\";\nimport minimatch from \"minimatch\";\n\nconst { Minimatch } = minimatch;\n\nconst minimatchOpts = { dot: true, matchBase: true };\n\n/**\n * @typedef {Object} Pattern\n * @property {InstanceType[] | null} includes The positive matchers.\n * @property {InstanceType[] | null} excludes The negative matchers.\n */\n\n/**\n * Normalize a given pattern to an array.\n * @param {string|string[]|undefined} patterns A glob pattern or an array of glob patterns.\n * @returns {string[]|null} Normalized patterns.\n * @private\n */\nfunction normalizePatterns(patterns) {\n if (Array.isArray(patterns)) {\n return patterns.filter(Boolean);\n }\n if (typeof patterns === \"string\" && patterns) {\n return [patterns];\n }\n return [];\n}\n\n/**\n * Create the matchers of given patterns.\n * @param {string[]} patterns The patterns.\n * @returns {InstanceType[] | null} The matchers.\n */\nfunction toMatcher(patterns) {\n if (patterns.length === 0) {\n return null;\n }\n return patterns.map(pattern => {\n if (/^\\.[/\\\\]/u.test(pattern)) {\n return new Minimatch(\n pattern.slice(2),\n\n // `./*.js` should not match with `subdir/foo.js`\n { ...minimatchOpts, matchBase: false }\n );\n }\n return new Minimatch(pattern, minimatchOpts);\n });\n}\n\n/**\n * Convert a given matcher to string.\n * @param {Pattern} matchers The matchers.\n * @returns {string} The string expression of the matcher.\n */\nfunction patternToJson({ includes, excludes }) {\n return {\n includes: includes && includes.map(m => m.pattern),\n excludes: excludes && excludes.map(m => m.pattern)\n };\n}\n\n/**\n * The class to test given paths are matched by the patterns.\n */\nclass OverrideTester {\n\n /**\n * Create a tester with given criteria.\n * If there are no criteria, returns `null`.\n * @param {string|string[]} files The glob patterns for included files.\n * @param {string|string[]} excludedFiles The glob patterns for excluded files.\n * @param {string} basePath The path to the base directory to test paths.\n * @returns {OverrideTester|null} The created instance or `null`.\n */\n static create(files, excludedFiles, basePath) {\n const includePatterns = normalizePatterns(files);\n const excludePatterns = normalizePatterns(excludedFiles);\n let endsWithWildcard = false;\n\n if (includePatterns.length === 0) {\n return null;\n }\n\n // Rejects absolute paths or relative paths to parents.\n for (const pattern of includePatterns) {\n if (path.isAbsolute(pattern) || pattern.includes(\"..\")) {\n throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`);\n }\n if (pattern.endsWith(\"*\")) {\n endsWithWildcard = true;\n }\n }\n for (const pattern of excludePatterns) {\n if (path.isAbsolute(pattern) || pattern.includes(\"..\")) {\n throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`);\n }\n }\n\n const includes = toMatcher(includePatterns);\n const excludes = toMatcher(excludePatterns);\n\n return new OverrideTester(\n [{ includes, excludes }],\n basePath,\n endsWithWildcard\n );\n }\n\n /**\n * Combine two testers by logical and.\n * If either of the testers was `null`, returns the other tester.\n * The `basePath` property of the two must be the same value.\n * @param {OverrideTester|null} a A tester.\n * @param {OverrideTester|null} b Another tester.\n * @returns {OverrideTester|null} Combined tester.\n */\n static and(a, b) {\n if (!b) {\n return a && new OverrideTester(\n a.patterns,\n a.basePath,\n a.endsWithWildcard\n );\n }\n if (!a) {\n return new OverrideTester(\n b.patterns,\n b.basePath,\n b.endsWithWildcard\n );\n }\n\n assert.strictEqual(a.basePath, b.basePath);\n return new OverrideTester(\n a.patterns.concat(b.patterns),\n a.basePath,\n a.endsWithWildcard || b.endsWithWildcard\n );\n }\n\n /**\n * Initialize this instance.\n * @param {Pattern[]} patterns The matchers.\n * @param {string} basePath The base path.\n * @param {boolean} endsWithWildcard If `true` then a pattern ends with `*`.\n */\n constructor(patterns, basePath, endsWithWildcard = false) {\n\n /** @type {Pattern[]} */\n this.patterns = patterns;\n\n /** @type {string} */\n this.basePath = basePath;\n\n /** @type {boolean} */\n this.endsWithWildcard = endsWithWildcard;\n }\n\n /**\n * Test if a given path is matched or not.\n * @param {string} filePath The absolute path to the target file.\n * @returns {boolean} `true` if the path was matched.\n */\n test(filePath) {\n if (typeof filePath !== \"string\" || !path.isAbsolute(filePath)) {\n throw new Error(`'filePath' should be an absolute path, but got ${filePath}.`);\n }\n const relativePath = path.relative(this.basePath, filePath);\n\n return this.patterns.every(({ includes, excludes }) => (\n (!includes || includes.some(m => m.match(relativePath))) &&\n (!excludes || !excludes.some(m => m.match(relativePath)))\n ));\n }\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @returns {Object} a JSON compatible object.\n */\n toJSON() {\n if (this.patterns.length === 1) {\n return {\n ...patternToJson(this.patterns[0]),\n basePath: this.basePath\n };\n }\n return {\n AND: this.patterns.map(patternToJson),\n basePath: this.basePath\n };\n }\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @returns {Object} an object to display by `console.log()`.\n */\n [util.inspect.custom]() {\n return this.toJSON();\n }\n}\n\nexport { OverrideTester };\n","/**\n * @fileoverview `ConfigArray` class.\n * @author Toru Nagashima \n */\n\nimport { ConfigArray, getUsedExtractedConfigs } from \"./config-array.js\";\nimport { ConfigDependency } from \"./config-dependency.js\";\nimport { ExtractedConfig } from \"./extracted-config.js\";\nimport { IgnorePattern } from \"./ignore-pattern.js\";\nimport { OverrideTester } from \"./override-tester.js\";\n\nexport {\n ConfigArray,\n ConfigDependency,\n ExtractedConfig,\n IgnorePattern,\n OverrideTester,\n getUsedExtractedConfigs\n};\n","/**\n * @fileoverview Config file operations. This file must be usable in the browser,\n * so no Node-specific code can be here.\n * @author Nicholas C. Zakas\n */\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\nconst RULE_SEVERITY_STRINGS = [\"off\", \"warn\", \"error\"],\n RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => {\n map[value] = index;\n return map;\n }, {}),\n VALID_SEVERITIES = [0, 1, 2, \"off\", \"warn\", \"error\"];\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * Normalizes the severity value of a rule's configuration to a number\n * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally\n * received from the user. A valid config value is either 0, 1, 2, the string \"off\" (treated the same as 0),\n * the string \"warn\" (treated the same as 1), the string \"error\" (treated the same as 2), or an array\n * whose first element is one of the above values. Strings are matched case-insensitively.\n * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0.\n */\nfunction getRuleSeverity(ruleConfig) {\n const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (severityValue === 0 || severityValue === 1 || severityValue === 2) {\n return severityValue;\n }\n\n if (typeof severityValue === \"string\") {\n return RULE_SEVERITY[severityValue.toLowerCase()] || 0;\n }\n\n return 0;\n}\n\n/**\n * Converts old-style severity settings (0, 1, 2) into new-style\n * severity settings (off, warn, error) for all rules. Assumption is that severity\n * values have already been validated as correct.\n * @param {Object} config The config object to normalize.\n * @returns {void}\n */\nfunction normalizeToStrings(config) {\n\n if (config.rules) {\n Object.keys(config.rules).forEach(ruleId => {\n const ruleConfig = config.rules[ruleId];\n\n if (typeof ruleConfig === \"number\") {\n config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0];\n } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === \"number\") {\n ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0];\n }\n });\n }\n}\n\n/**\n * Determines if the severity for the given rule configuration represents an error.\n * @param {int|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} True if the rule represents an error, false if not.\n */\nfunction isErrorSeverity(ruleConfig) {\n return getRuleSeverity(ruleConfig) === 2;\n}\n\n/**\n * Checks whether a given config has valid severity or not.\n * @param {number|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isValidSeverity(ruleConfig) {\n let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (typeof severity === \"string\") {\n severity = severity.toLowerCase();\n }\n return VALID_SEVERITIES.indexOf(severity) !== -1;\n}\n\n/**\n * Checks whether every rule of a given config has valid severity or not.\n * @param {Object} config The configuration for rules.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isEverySeverityValid(config) {\n return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId]));\n}\n\n/**\n * Normalizes a value for a global in a config\n * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in\n * a global directive comment\n * @returns {(\"readable\"|\"writeable\"|\"off\")} The value normalized as a string\n * @throws Error if global value is invalid\n */\nfunction normalizeConfigGlobal(configuredValue) {\n switch (configuredValue) {\n case \"off\":\n return \"off\";\n\n case true:\n case \"true\":\n case \"writeable\":\n case \"writable\":\n return \"writable\";\n\n case null:\n case false:\n case \"false\":\n case \"readable\":\n case \"readonly\":\n return \"readonly\";\n\n default:\n throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`);\n }\n}\n\nexport {\n getRuleSeverity,\n normalizeToStrings,\n isErrorSeverity,\n isValidSeverity,\n isEverySeverityValid,\n normalizeConfigGlobal\n};\n","/**\n * @fileoverview Provide the function that emits deprecation warnings.\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport path from \"path\";\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\n// Defitions for deprecation warnings.\nconst deprecationWarningMessages = {\n ESLINT_LEGACY_ECMAFEATURES:\n \"The 'ecmaFeatures' config file property is deprecated and has no effect.\",\n ESLINT_PERSONAL_CONFIG_LOAD:\n \"'~/.eslintrc.*' config files have been deprecated. \" +\n \"Please use a config file per project or the '--config' option.\",\n ESLINT_PERSONAL_CONFIG_SUPPRESS:\n \"'~/.eslintrc.*' config files have been deprecated. \" +\n \"Please remove it or add 'root:true' to the config files in your \" +\n \"projects in order to avoid loading '~/.eslintrc.*' accidentally.\"\n};\n\nconst sourceFileErrorCache = new Set();\n\n/**\n * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted\n * for each unique file path, but repeated invocations with the same file path have no effect.\n * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active.\n * @param {string} source The name of the configuration source to report the warning for.\n * @param {string} errorCode The warning message to show.\n * @returns {void}\n */\nfunction emitDeprecationWarning(source, errorCode) {\n const cacheKey = JSON.stringify({ source, errorCode });\n\n if (sourceFileErrorCache.has(cacheKey)) {\n return;\n }\n sourceFileErrorCache.add(cacheKey);\n\n const rel = path.relative(process.cwd(), source);\n const message = deprecationWarningMessages[errorCode];\n\n process.emitWarning(\n `${message} (found in \"${rel}\")`,\n \"DeprecationWarning\",\n errorCode\n );\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport {\n emitDeprecationWarning\n};\n","/**\n * @fileoverview The instance of Ajv validator.\n * @author Evgeny Poberezkin\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport Ajv from \"ajv\";\n\n//-----------------------------------------------------------------------------\n// Helpers\n//-----------------------------------------------------------------------------\n\n/*\n * Copied from ajv/lib/refs/json-schema-draft-04.json\n * The MIT License (MIT)\n * Copyright (c) 2015-2017 Evgeny Poberezkin\n */\nconst metaSchema = {\n id: \"http://json-schema.org/draft-04/schema#\",\n $schema: \"http://json-schema.org/draft-04/schema#\",\n description: \"Core schema meta-schema\",\n definitions: {\n schemaArray: {\n type: \"array\",\n minItems: 1,\n items: { $ref: \"#\" }\n },\n positiveInteger: {\n type: \"integer\",\n minimum: 0\n },\n positiveIntegerDefault0: {\n allOf: [{ $ref: \"#/definitions/positiveInteger\" }, { default: 0 }]\n },\n simpleTypes: {\n enum: [\"array\", \"boolean\", \"integer\", \"null\", \"number\", \"object\", \"string\"]\n },\n stringArray: {\n type: \"array\",\n items: { type: \"string\" },\n minItems: 1,\n uniqueItems: true\n }\n },\n type: \"object\",\n properties: {\n id: {\n type: \"string\"\n },\n $schema: {\n type: \"string\"\n },\n title: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n default: { },\n multipleOf: {\n type: \"number\",\n minimum: 0,\n exclusiveMinimum: true\n },\n maximum: {\n type: \"number\"\n },\n exclusiveMaximum: {\n type: \"boolean\",\n default: false\n },\n minimum: {\n type: \"number\"\n },\n exclusiveMinimum: {\n type: \"boolean\",\n default: false\n },\n maxLength: { $ref: \"#/definitions/positiveInteger\" },\n minLength: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n pattern: {\n type: \"string\",\n format: \"regex\"\n },\n additionalItems: {\n anyOf: [\n { type: \"boolean\" },\n { $ref: \"#\" }\n ],\n default: { }\n },\n items: {\n anyOf: [\n { $ref: \"#\" },\n { $ref: \"#/definitions/schemaArray\" }\n ],\n default: { }\n },\n maxItems: { $ref: \"#/definitions/positiveInteger\" },\n minItems: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n uniqueItems: {\n type: \"boolean\",\n default: false\n },\n maxProperties: { $ref: \"#/definitions/positiveInteger\" },\n minProperties: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n required: { $ref: \"#/definitions/stringArray\" },\n additionalProperties: {\n anyOf: [\n { type: \"boolean\" },\n { $ref: \"#\" }\n ],\n default: { }\n },\n definitions: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n properties: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n patternProperties: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n dependencies: {\n type: \"object\",\n additionalProperties: {\n anyOf: [\n { $ref: \"#\" },\n { $ref: \"#/definitions/stringArray\" }\n ]\n }\n },\n enum: {\n type: \"array\",\n minItems: 1,\n uniqueItems: true\n },\n type: {\n anyOf: [\n { $ref: \"#/definitions/simpleTypes\" },\n {\n type: \"array\",\n items: { $ref: \"#/definitions/simpleTypes\" },\n minItems: 1,\n uniqueItems: true\n }\n ]\n },\n format: { type: \"string\" },\n allOf: { $ref: \"#/definitions/schemaArray\" },\n anyOf: { $ref: \"#/definitions/schemaArray\" },\n oneOf: { $ref: \"#/definitions/schemaArray\" },\n not: { $ref: \"#\" }\n },\n dependencies: {\n exclusiveMaximum: [\"maximum\"],\n exclusiveMinimum: [\"minimum\"]\n },\n default: { }\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport default (additionalOptions = {}) => {\n const ajv = new Ajv({\n meta: false,\n useDefaults: true,\n validateSchema: false,\n missingRefs: \"ignore\",\n verbose: true,\n schemaId: \"auto\",\n ...additionalOptions\n });\n\n ajv.addMetaSchema(metaSchema);\n // eslint-disable-next-line no-underscore-dangle\n ajv._opts.defaultMeta = metaSchema.id;\n\n return ajv;\n};\n","/**\n * @fileoverview Defines a schema for configs.\n * @author Sylvan Mably\n */\n\nconst baseConfigProperties = {\n $schema: { type: \"string\" },\n env: { type: \"object\" },\n extends: { $ref: \"#/definitions/stringOrStrings\" },\n globals: { type: \"object\" },\n overrides: {\n type: \"array\",\n items: { $ref: \"#/definitions/overrideConfig\" },\n additionalItems: false\n },\n parser: { type: [\"string\", \"null\"] },\n parserOptions: { type: \"object\" },\n plugins: { type: \"array\" },\n processor: { type: \"string\" },\n rules: { type: \"object\" },\n settings: { type: \"object\" },\n noInlineConfig: { type: \"boolean\" },\n reportUnusedDisableDirectives: { type: \"boolean\" },\n\n ecmaFeatures: { type: \"object\" } // deprecated; logs a warning when used\n};\n\nconst configSchema = {\n definitions: {\n stringOrStrings: {\n oneOf: [\n { type: \"string\" },\n {\n type: \"array\",\n items: { type: \"string\" },\n additionalItems: false\n }\n ]\n },\n stringOrStringsRequired: {\n oneOf: [\n { type: \"string\" },\n {\n type: \"array\",\n items: { type: \"string\" },\n additionalItems: false,\n minItems: 1\n }\n ]\n },\n\n // Config at top-level.\n objectConfig: {\n type: \"object\",\n properties: {\n root: { type: \"boolean\" },\n ignorePatterns: { $ref: \"#/definitions/stringOrStrings\" },\n ...baseConfigProperties\n },\n additionalProperties: false\n },\n\n // Config in `overrides`.\n overrideConfig: {\n type: \"object\",\n properties: {\n excludedFiles: { $ref: \"#/definitions/stringOrStrings\" },\n files: { $ref: \"#/definitions/stringOrStringsRequired\" },\n ...baseConfigProperties\n },\n required: [\"files\"],\n additionalProperties: false\n }\n },\n\n $ref: \"#/definitions/objectConfig\"\n};\n\nexport default configSchema;\n","/**\n * @fileoverview Defines environment settings and globals.\n * @author Elan Shanker\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport globals from \"globals\";\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Get the object that has difference.\n * @param {Record} current The newer object.\n * @param {Record} prev The older object.\n * @returns {Record} The difference object.\n */\nfunction getDiff(current, prev) {\n const retv = {};\n\n for (const [key, value] of Object.entries(current)) {\n if (!Object.hasOwnProperty.call(prev, key)) {\n retv[key] = value;\n }\n }\n\n return retv;\n}\n\nconst newGlobals2015 = getDiff(globals.es2015, globals.es5); // 19 variables such as Promise, Map, ...\nconst newGlobals2017 = {\n Atomics: false,\n SharedArrayBuffer: false\n};\nconst newGlobals2020 = {\n BigInt: false,\n BigInt64Array: false,\n BigUint64Array: false,\n globalThis: false\n};\n\nconst newGlobals2021 = {\n AggregateError: false,\n FinalizationRegistry: false,\n WeakRef: false\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/** @type {Map} */\nexport default new Map(Object.entries({\n\n // Language\n builtin: {\n globals: globals.es5\n },\n es6: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2015: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2016: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 7\n }\n },\n es2017: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 8\n }\n },\n es2018: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 9\n }\n },\n es2019: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 10\n }\n },\n es2020: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 },\n parserOptions: {\n ecmaVersion: 11\n }\n },\n es2021: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 12\n }\n },\n es2022: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 13\n }\n },\n\n // Platforms\n browser: {\n globals: globals.browser\n },\n node: {\n globals: globals.node,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n \"shared-node-browser\": {\n globals: globals[\"shared-node-browser\"]\n },\n worker: {\n globals: globals.worker\n },\n serviceworker: {\n globals: globals.serviceworker\n },\n\n // Frameworks\n commonjs: {\n globals: globals.commonjs,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n amd: {\n globals: globals.amd\n },\n mocha: {\n globals: globals.mocha\n },\n jasmine: {\n globals: globals.jasmine\n },\n jest: {\n globals: globals.jest\n },\n phantomjs: {\n globals: globals.phantomjs\n },\n jquery: {\n globals: globals.jquery\n },\n qunit: {\n globals: globals.qunit\n },\n prototypejs: {\n globals: globals.prototypejs\n },\n shelljs: {\n globals: globals.shelljs\n },\n meteor: {\n globals: globals.meteor\n },\n mongo: {\n globals: globals.mongo\n },\n protractor: {\n globals: globals.protractor\n },\n applescript: {\n globals: globals.applescript\n },\n nashorn: {\n globals: globals.nashorn\n },\n atomtest: {\n globals: globals.atomtest\n },\n embertest: {\n globals: globals.embertest\n },\n webextensions: {\n globals: globals.webextensions\n },\n greasemonkey: {\n globals: globals.greasemonkey\n }\n}));\n","/**\n * @fileoverview Validates configs.\n * @author Brandon Mills\n */\n\n/* eslint class-methods-use-this: \"off\" */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport util from \"util\";\nimport * as ConfigOps from \"./config-ops.js\";\nimport { emitDeprecationWarning } from \"./deprecation-warnings.js\";\nimport ajvOrig from \"./ajv.js\";\nimport configSchema from \"../../conf/config-schema.js\";\nimport BuiltInEnvironments from \"../../conf/environments.js\";\n\nconst ajv = ajvOrig();\n\nconst ruleValidators = new WeakMap();\nconst noop = Function.prototype;\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\nlet validateSchema;\nconst severityMap = {\n error: 2,\n warn: 1,\n off: 0\n};\n\nconst validated = new WeakSet();\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\nexport default class ConfigValidator {\n constructor({ builtInRules = new Map() } = {}) {\n this.builtInRules = builtInRules;\n }\n\n /**\n * Gets a complete options schema for a rule.\n * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object\n * @returns {Object} JSON Schema for the rule's options.\n */\n getRuleOptionsSchema(rule) {\n if (!rule) {\n return null;\n }\n\n const schema = rule.schema || rule.meta && rule.meta.schema;\n\n // Given a tuple of schemas, insert warning level at the beginning\n if (Array.isArray(schema)) {\n if (schema.length) {\n return {\n type: \"array\",\n items: schema,\n minItems: 0,\n maxItems: schema.length\n };\n }\n return {\n type: \"array\",\n minItems: 0,\n maxItems: 0\n };\n\n }\n\n // Given a full schema, leave it alone\n return schema || null;\n }\n\n /**\n * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid.\n * @param {options} options The given options for the rule.\n * @returns {number|string} The rule's severity value\n */\n validateRuleSeverity(options) {\n const severity = Array.isArray(options) ? options[0] : options;\n const normSeverity = typeof severity === \"string\" ? severityMap[severity.toLowerCase()] : severity;\n\n if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {\n return normSeverity;\n }\n\n throw new Error(`\\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, \"\\\"\").replace(/\\n/gu, \"\")}').\\n`);\n\n }\n\n /**\n * Validates the non-severity options passed to a rule, based on its schema.\n * @param {{create: Function}} rule The rule to validate\n * @param {Array} localOptions The options for the rule, excluding severity\n * @returns {void}\n */\n validateRuleSchema(rule, localOptions) {\n if (!ruleValidators.has(rule)) {\n const schema = this.getRuleOptionsSchema(rule);\n\n if (schema) {\n ruleValidators.set(rule, ajv.compile(schema));\n }\n }\n\n const validateRule = ruleValidators.get(rule);\n\n if (validateRule) {\n validateRule(localOptions);\n if (validateRule.errors) {\n throw new Error(validateRule.errors.map(\n error => `\\tValue ${JSON.stringify(error.data)} ${error.message}.\\n`\n ).join(\"\"));\n }\n }\n }\n\n /**\n * Validates a rule's options against its schema.\n * @param {{create: Function}|null} rule The rule that the config is being validated for\n * @param {string} ruleId The rule's unique name.\n * @param {Array|number} options The given options for the rule.\n * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined,\n * no source is prepended to the message.\n * @returns {void}\n */\n validateRuleOptions(rule, ruleId, options, source = null) {\n try {\n const severity = this.validateRuleSeverity(options);\n\n if (severity !== 0) {\n this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []);\n }\n } catch (err) {\n const enhancedMessage = `Configuration for rule \"${ruleId}\" is invalid:\\n${err.message}`;\n\n if (typeof source === \"string\") {\n throw new Error(`${source}:\\n\\t${enhancedMessage}`);\n } else {\n throw new Error(enhancedMessage);\n }\n }\n }\n\n /**\n * Validates an environment object\n * @param {Object} environment The environment config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments.\n * @returns {void}\n */\n validateEnvironment(\n environment,\n source,\n getAdditionalEnv = noop\n ) {\n\n // not having an environment is ok\n if (!environment) {\n return;\n }\n\n Object.keys(environment).forEach(id => {\n const env = getAdditionalEnv(id) || BuiltInEnvironments.get(id) || null;\n\n if (!env) {\n const message = `${source}:\\n\\tEnvironment key \"${id}\" is unknown\\n`;\n\n throw new Error(message);\n }\n });\n }\n\n /**\n * Validates a rules config object\n * @param {Object} rulesConfig The rules config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules\n * @returns {void}\n */\n validateRules(\n rulesConfig,\n source,\n getAdditionalRule = noop\n ) {\n if (!rulesConfig) {\n return;\n }\n\n Object.keys(rulesConfig).forEach(id => {\n const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null;\n\n this.validateRuleOptions(rule, id, rulesConfig[id], source);\n });\n }\n\n /**\n * Validates a `globals` section of a config file\n * @param {Object} globalsConfig The `globals` section\n * @param {string|null} source The name of the configuration source to report in the event of an error.\n * @returns {void}\n */\n validateGlobals(globalsConfig, source = null) {\n if (!globalsConfig) {\n return;\n }\n\n Object.entries(globalsConfig)\n .forEach(([configuredGlobal, configuredValue]) => {\n try {\n ConfigOps.normalizeConfigGlobal(configuredValue);\n } catch (err) {\n throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\\n${err.message}`);\n }\n });\n }\n\n /**\n * Validate `processor` configuration.\n * @param {string|undefined} processorName The processor name.\n * @param {string} source The name of config file.\n * @param {function(id:string): Processor} getProcessor The getter of defined processors.\n * @returns {void}\n */\n validateProcessor(processorName, source, getProcessor) {\n if (processorName && !getProcessor(processorName)) {\n throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`);\n }\n }\n\n /**\n * Formats an array of schema validation errors.\n * @param {Array} errors An array of error messages to format.\n * @returns {string} Formatted error message\n */\n formatErrors(errors) {\n return errors.map(error => {\n if (error.keyword === \"additionalProperties\") {\n const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty;\n\n return `Unexpected top-level property \"${formattedPropertyPath}\"`;\n }\n if (error.keyword === \"type\") {\n const formattedField = error.dataPath.slice(1);\n const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join(\"/\") : error.schema;\n const formattedValue = JSON.stringify(error.data);\n\n return `Property \"${formattedField}\" is the wrong type (expected ${formattedExpectedType} but got \\`${formattedValue}\\`)`;\n }\n\n const field = error.dataPath[0] === \".\" ? error.dataPath.slice(1) : error.dataPath;\n\n return `\"${field}\" ${error.message}. Value: ${JSON.stringify(error.data)}`;\n }).map(message => `\\t- ${message}.\\n`).join(\"\");\n }\n\n /**\n * Validates the top level properties of the config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @returns {void}\n */\n validateConfigSchema(config, source = null) {\n validateSchema = validateSchema || ajv.compile(configSchema);\n\n if (!validateSchema(config)) {\n throw new Error(`ESLint configuration in ${source} is invalid:\\n${this.formatErrors(validateSchema.errors)}`);\n }\n\n if (Object.hasOwnProperty.call(config, \"ecmaFeatures\")) {\n emitDeprecationWarning(source, \"ESLINT_LEGACY_ECMAFEATURES\");\n }\n }\n\n /**\n * Validates an entire config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules.\n * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs.\n * @returns {void}\n */\n validate(config, source, getAdditionalRule, getAdditionalEnv) {\n this.validateConfigSchema(config, source);\n this.validateRules(config.rules, source, getAdditionalRule);\n this.validateEnvironment(config.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n\n for (const override of config.overrides || []) {\n this.validateRules(override.rules, source, getAdditionalRule);\n this.validateEnvironment(override.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n }\n }\n\n /**\n * Validate config array object.\n * @param {ConfigArray} configArray The config array to validate.\n * @returns {void}\n */\n validateConfigArray(configArray) {\n const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments);\n const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors);\n const getPluginRule = Map.prototype.get.bind(configArray.pluginRules);\n\n // Validate.\n for (const element of configArray) {\n if (validated.has(element)) {\n continue;\n }\n validated.add(element);\n\n this.validateEnvironment(element.env, element.name, getPluginEnv);\n this.validateGlobals(element.globals, element.name);\n this.validateProcessor(element.processor, element.name, getPluginProcessor);\n this.validateRules(element.rules, element.name, getPluginRule);\n }\n }\n\n}\n","/**\n * @fileoverview Common helpers for naming of plugins, formatters and configs\n */\n\nconst NAMESPACE_REGEX = /^@.*\\//iu;\n\n/**\n * Brings package name to correct format based on prefix\n * @param {string} name The name of the package.\n * @param {string} prefix Can be either \"eslint-plugin\", \"eslint-config\" or \"eslint-formatter\"\n * @returns {string} Normalized name of the package\n * @private\n */\nfunction normalizePackageName(name, prefix) {\n let normalizedName = name;\n\n /**\n * On Windows, name can come in with Windows slashes instead of Unix slashes.\n * Normalize to Unix first to avoid errors later on.\n * https://github.com/eslint/eslint/issues/5644\n */\n if (normalizedName.includes(\"\\\\\")) {\n normalizedName = normalizedName.replace(/\\\\/gu, \"/\");\n }\n\n if (normalizedName.charAt(0) === \"@\") {\n\n /**\n * it's a scoped package\n * package name is the prefix, or just a username\n */\n const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, \"u\"),\n scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, \"u\");\n\n if (scopedPackageShortcutRegex.test(normalizedName)) {\n normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`);\n } else if (!scopedPackageNameRegex.test(normalizedName.split(\"/\")[1])) {\n\n /**\n * for scoped packages, insert the prefix after the first / unless\n * the path is already @scope/eslint or @scope/eslint-xxx-yyy\n */\n normalizedName = normalizedName.replace(/^@([^/]+)\\/(.*)$/u, `@$1/${prefix}-$2`);\n }\n } else if (!normalizedName.startsWith(`${prefix}-`)) {\n normalizedName = `${prefix}-${normalizedName}`;\n }\n\n return normalizedName;\n}\n\n/**\n * Removes the prefix from a fullname.\n * @param {string} fullname The term which may have the prefix.\n * @param {string} prefix The prefix to remove.\n * @returns {string} The term without prefix.\n */\nfunction getShorthandName(fullname, prefix) {\n if (fullname[0] === \"@\") {\n let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, \"u\").exec(fullname);\n\n if (matchResult) {\n return matchResult[1];\n }\n\n matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, \"u\").exec(fullname);\n if (matchResult) {\n return `${matchResult[1]}/${matchResult[2]}`;\n }\n } else if (fullname.startsWith(`${prefix}-`)) {\n return fullname.slice(prefix.length + 1);\n }\n\n return fullname;\n}\n\n/**\n * Gets the scope (namespace) of a term.\n * @param {string} term The term which may have the namespace.\n * @returns {string} The namespace of the term if it has one.\n */\nfunction getNamespaceFromTerm(term) {\n const match = term.match(NAMESPACE_REGEX);\n\n return match ? match[0] : \"\";\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport {\n normalizePackageName,\n getShorthandName,\n getNamespaceFromTerm\n};\n","/**\n * Utility for resolving a module relative to another module\n * @author Teddy Katz\n */\n\nimport Module from \"module\";\n\n/*\n * `Module.createRequire` is added in v12.2.0. It supports URL as well.\n * We only support the case where the argument is a filepath, not a URL.\n */\nconst createRequire = Module.createRequire;\n\n/**\n * Resolves a Node module relative to another module\n * @param {string} moduleName The name of a Node module, or a path to a Node module.\n * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be\n * a file rather than a directory, but the file need not actually exist.\n * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath`\n */\nfunction resolve(moduleName, relativeToPath) {\n try {\n return createRequire(relativeToPath).resolve(moduleName);\n } catch (error) {\n\n // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future.\n if (\n typeof error === \"object\" &&\n error !== null &&\n error.code === \"MODULE_NOT_FOUND\" &&\n !error.requireStack &&\n error.message.includes(moduleName)\n ) {\n error.message += `\\nRequire stack:\\n- ${relativeToPath}`;\n }\n throw error;\n }\n}\n\nexport {\n resolve\n};\n","/**\n * @fileoverview The factory of `ConfigArray` objects.\n *\n * This class provides methods to create `ConfigArray` instance.\n *\n * - `create(configData, options)`\n * Create a `ConfigArray` instance from a config data. This is to handle CLI\n * options except `--config`.\n * - `loadFile(filePath, options)`\n * Create a `ConfigArray` instance from a config file. This is to handle\n * `--config` option. If the file was not found, throws the following error:\n * - If the filename was `*.js`, a `MODULE_NOT_FOUND` error.\n * - If the filename was `package.json`, an IO error or an\n * `ESLINT_CONFIG_FIELD_NOT_FOUND` error.\n * - Otherwise, an IO error such as `ENOENT`.\n * - `loadInDirectory(directoryPath, options)`\n * Create a `ConfigArray` instance from a config file which is on a given\n * directory. This tries to load `.eslintrc.*` or `package.json`. If not\n * found, returns an empty `ConfigArray`.\n * - `loadESLintIgnore(filePath)`\n * Create a `ConfigArray` instance from a config file that is `.eslintignore`\n * format. This is to handle `--ignore-path` option.\n * - `loadDefaultESLintIgnore()`\n * Create a `ConfigArray` instance from `.eslintignore` or `package.json` in\n * the current working directory.\n *\n * `ConfigArrayFactory` class has the responsibility that loads configuration\n * files, including loading `extends`, `parser`, and `plugins`. The created\n * `ConfigArray` instance has the loaded `extends`, `parser`, and `plugins`.\n *\n * But this class doesn't handle cascading. `CascadingConfigArrayFactory` class\n * handles cascading and hierarchy.\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport debugOrig from \"debug\";\nimport fs from \"fs\";\nimport { createRequire } from \"module\";\nimport path from \"path\";\nimport stripComments from \"strip-json-comments\";\n\nimport {\n ConfigArray,\n ConfigDependency,\n IgnorePattern,\n OverrideTester\n} from \"./config-array/index.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport * as naming from \"./shared/naming.js\";\nimport * as ModuleResolver from \"./shared/relative-module-resolver.js\";\n\nconst require = createRequire(import.meta.url);\n\nconst debug = debugOrig(\"eslintrc:config-array-factory\");\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\nconst configFilenames = [\n \".eslintrc.js\",\n \".eslintrc.cjs\",\n \".eslintrc.yaml\",\n \".eslintrc.yml\",\n \".eslintrc.json\",\n \".eslintrc\",\n \"package.json\"\n];\n\n// Define types for VSCode IntelliSense.\n/** @typedef {import(\"./shared/types\").ConfigData} ConfigData */\n/** @typedef {import(\"./shared/types\").OverrideConfigData} OverrideConfigData */\n/** @typedef {import(\"./shared/types\").Parser} Parser */\n/** @typedef {import(\"./shared/types\").Plugin} Plugin */\n/** @typedef {import(\"./shared/types\").Rule} Rule */\n/** @typedef {import(\"./config-array/config-dependency\").DependentParser} DependentParser */\n/** @typedef {import(\"./config-array/config-dependency\").DependentPlugin} DependentPlugin */\n/** @typedef {ConfigArray[0]} ConfigArrayElement */\n\n/**\n * @typedef {Object} ConfigArrayFactoryOptions\n * @property {Map} [additionalPluginPool] The map for additional plugins.\n * @property {string} [cwd] The path to the current working directory.\n * @property {string} [resolvePluginsRelativeTo] A path to the directory that plugins should be resolved from. Defaults to `cwd`.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/**\n * @typedef {Object} ConfigArrayFactoryInternalSlots\n * @property {Map} additionalPluginPool The map for additional plugins.\n * @property {string} cwd The path to the current working directory.\n * @property {string | undefined} resolvePluginsRelativeTo An absolute path the the directory that plugins should be resolved from.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/**\n * @typedef {Object} ConfigArrayFactoryLoadingContext\n * @property {string} filePath The path to the current configuration.\n * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @property {string} name The name of the current configuration.\n * @property {string} pluginBasePath The base path to resolve plugins.\n * @property {\"config\" | \"ignore\" | \"implicit-processor\"} type The type of the current configuration. This is `\"config\"` in normal. This is `\"ignore\"` if it came from `.eslintignore`. This is `\"implicit-processor\"` if it came from legacy file-extension processors.\n */\n\n/**\n * @typedef {Object} ConfigArrayFactoryLoadingContext\n * @property {string} filePath The path to the current configuration.\n * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @property {string} name The name of the current configuration.\n * @property {\"config\" | \"ignore\" | \"implicit-processor\"} type The type of the current configuration. This is `\"config\"` in normal. This is `\"ignore\"` if it came from `.eslintignore`. This is `\"implicit-processor\"` if it came from legacy file-extension processors.\n */\n\n/** @type {WeakMap} */\nconst internalSlotsMap = new WeakMap();\n\n/**\n * Check if a given string is a file path.\n * @param {string} nameOrPath A module name or file path.\n * @returns {boolean} `true` if the `nameOrPath` is a file path.\n */\nfunction isFilePath(nameOrPath) {\n return (\n /^\\.{1,2}[/\\\\]/u.test(nameOrPath) ||\n path.isAbsolute(nameOrPath)\n );\n}\n\n/**\n * Convenience wrapper for synchronously reading file contents.\n * @param {string} filePath The filename to read.\n * @returns {string} The file contents, with the BOM removed.\n * @private\n */\nfunction readFile(filePath) {\n return fs.readFileSync(filePath, \"utf8\").replace(/^\\ufeff/u, \"\");\n}\n\n/**\n * Loads a YAML configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadYAMLConfigFile(filePath) {\n debug(`Loading YAML config file: ${filePath}`);\n\n // lazy load YAML to improve performance when not used\n const yaml = require(\"js-yaml\");\n\n try {\n\n // empty YAML file can be null, so always use\n return yaml.load(readFile(filePath)) || {};\n } catch (e) {\n debug(`Error reading YAML file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a JSON configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadJSONConfigFile(filePath) {\n debug(`Loading JSON config file: ${filePath}`);\n\n try {\n return JSON.parse(stripComments(readFile(filePath)));\n } catch (e) {\n debug(`Error reading JSON file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n e.messageTemplate = \"failed-to-read-json\";\n e.messageData = {\n path: filePath,\n message: e.message\n };\n throw e;\n }\n}\n\n/**\n * Loads a legacy (.eslintrc) configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadLegacyConfigFile(filePath) {\n debug(`Loading legacy config file: ${filePath}`);\n\n // lazy load YAML to improve performance when not used\n const yaml = require(\"js-yaml\");\n\n try {\n return yaml.load(stripComments(readFile(filePath))) || /* istanbul ignore next */ {};\n } catch (e) {\n debug(\"Error reading YAML file: %s\\n%o\", filePath, e);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a JavaScript configuration from a file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadJSConfigFile(filePath) {\n debug(`Loading JS config file: ${filePath}`);\n try {\n return require(filePath);\n } catch (e) {\n debug(`Error reading JavaScript file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a configuration from a package.json file.\n * @param {string} filePath The filename to load.\n * @returns {ConfigData} The configuration object from the file.\n * @throws {Error} If the file cannot be read.\n * @private\n */\nfunction loadPackageJSONConfigFile(filePath) {\n debug(`Loading package.json config file: ${filePath}`);\n try {\n const packageData = loadJSONConfigFile(filePath);\n\n if (!Object.hasOwnProperty.call(packageData, \"eslintConfig\")) {\n throw Object.assign(\n new Error(\"package.json file doesn't have 'eslintConfig' field.\"),\n { code: \"ESLINT_CONFIG_FIELD_NOT_FOUND\" }\n );\n }\n\n return packageData.eslintConfig;\n } catch (e) {\n debug(`Error reading package.json file: ${filePath}`);\n e.message = `Cannot read config file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Loads a `.eslintignore` from a file.\n * @param {string} filePath The filename to load.\n * @returns {string[]} The ignore patterns from the file.\n * @private\n */\nfunction loadESLintIgnoreFile(filePath) {\n debug(`Loading .eslintignore file: ${filePath}`);\n\n try {\n return readFile(filePath)\n .split(/\\r?\\n/gu)\n .filter(line => line.trim() !== \"\" && !line.startsWith(\"#\"));\n } catch (e) {\n debug(`Error reading .eslintignore file: ${filePath}`);\n e.message = `Cannot read .eslintignore file: ${filePath}\\nError: ${e.message}`;\n throw e;\n }\n}\n\n/**\n * Creates an error to notify about a missing config to extend from.\n * @param {string} configName The name of the missing config.\n * @param {string} importerName The name of the config that imported the missing config\n * @param {string} messageTemplate The text template to source error strings from.\n * @returns {Error} The error object to throw\n * @private\n */\nfunction configInvalidError(configName, importerName, messageTemplate) {\n return Object.assign(\n new Error(`Failed to load config \"${configName}\" to extend from.`),\n {\n messageTemplate,\n messageData: { configName, importerName }\n }\n );\n}\n\n/**\n * Loads a configuration file regardless of the source. Inspects the file path\n * to determine the correctly way to load the config file.\n * @param {string} filePath The path to the configuration.\n * @returns {ConfigData|null} The configuration information.\n * @private\n */\nfunction loadConfigFile(filePath) {\n switch (path.extname(filePath)) {\n case \".js\":\n case \".cjs\":\n return loadJSConfigFile(filePath);\n\n case \".json\":\n if (path.basename(filePath) === \"package.json\") {\n return loadPackageJSONConfigFile(filePath);\n }\n return loadJSONConfigFile(filePath);\n\n case \".yaml\":\n case \".yml\":\n return loadYAMLConfigFile(filePath);\n\n default:\n return loadLegacyConfigFile(filePath);\n }\n}\n\n/**\n * Write debug log.\n * @param {string} request The requested module name.\n * @param {string} relativeTo The file path to resolve the request relative to.\n * @param {string} filePath The resolved file path.\n * @returns {void}\n */\nfunction writeDebugLogForLoading(request, relativeTo, filePath) {\n /* istanbul ignore next */\n if (debug.enabled) {\n let nameAndVersion = null;\n\n try {\n const packageJsonPath = ModuleResolver.resolve(\n `${request}/package.json`,\n relativeTo\n );\n const { version = \"unknown\" } = require(packageJsonPath);\n\n nameAndVersion = `${request}@${version}`;\n } catch (error) {\n debug(\"package.json was not found:\", error.message);\n nameAndVersion = request;\n }\n\n debug(\"Loaded: %s (%s)\", nameAndVersion, filePath);\n }\n}\n\n/**\n * Create a new context with default values.\n * @param {ConfigArrayFactoryInternalSlots} slots The internal slots.\n * @param {\"config\" | \"ignore\" | \"implicit-processor\" | undefined} providedType The type of the current configuration. Default is `\"config\"`.\n * @param {string | undefined} providedName The name of the current configuration. Default is the relative path from `cwd` to `filePath`.\n * @param {string | undefined} providedFilePath The path to the current configuration. Default is empty string.\n * @param {string | undefined} providedMatchBasePath The type of the current configuration. Default is the directory of `filePath` or `cwd`.\n * @returns {ConfigArrayFactoryLoadingContext} The created context.\n */\nfunction createContext(\n { cwd, resolvePluginsRelativeTo },\n providedType,\n providedName,\n providedFilePath,\n providedMatchBasePath\n) {\n const filePath = providedFilePath\n ? path.resolve(cwd, providedFilePath)\n : \"\";\n const matchBasePath =\n (providedMatchBasePath && path.resolve(cwd, providedMatchBasePath)) ||\n (filePath && path.dirname(filePath)) ||\n cwd;\n const name =\n providedName ||\n (filePath && path.relative(cwd, filePath)) ||\n \"\";\n const pluginBasePath =\n resolvePluginsRelativeTo ||\n (filePath && path.dirname(filePath)) ||\n cwd;\n const type = providedType || \"config\";\n\n return { filePath, matchBasePath, name, pluginBasePath, type };\n}\n\n/**\n * Normalize a given plugin.\n * - Ensure the object to have four properties: configs, environments, processors, and rules.\n * - Ensure the object to not have other properties.\n * @param {Plugin} plugin The plugin to normalize.\n * @returns {Plugin} The normalized plugin.\n */\nfunction normalizePlugin(plugin) {\n return {\n configs: plugin.configs || {},\n environments: plugin.environments || {},\n processors: plugin.processors || {},\n rules: plugin.rules || {}\n };\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * The factory of `ConfigArray` objects.\n */\nclass ConfigArrayFactory {\n\n /**\n * Initialize this instance.\n * @param {ConfigArrayFactoryOptions} [options] The map for additional plugins.\n */\n constructor({\n additionalPluginPool = new Map(),\n cwd = process.cwd(),\n resolvePluginsRelativeTo,\n builtInRules,\n resolver = ModuleResolver,\n eslintAllPath,\n getEslintAllConfig,\n eslintRecommendedPath,\n getEslintRecommendedConfig\n } = {}) {\n internalSlotsMap.set(this, {\n additionalPluginPool,\n cwd,\n resolvePluginsRelativeTo:\n resolvePluginsRelativeTo &&\n path.resolve(cwd, resolvePluginsRelativeTo),\n builtInRules,\n resolver,\n eslintAllPath,\n getEslintAllConfig,\n eslintRecommendedPath,\n getEslintRecommendedConfig\n });\n }\n\n /**\n * Create `ConfigArray` instance from a config data.\n * @param {ConfigData|null} configData The config data to create.\n * @param {Object} [options] The options.\n * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @param {string} [options.filePath] The path to this config data.\n * @param {string} [options.name] The config name.\n * @returns {ConfigArray} Loaded config.\n */\n create(configData, { basePath, filePath, name } = {}) {\n if (!configData) {\n return new ConfigArray();\n }\n\n const slots = internalSlotsMap.get(this);\n const ctx = createContext(slots, \"config\", name, filePath, basePath);\n const elements = this._normalizeConfigData(configData, ctx);\n\n return new ConfigArray(...elements);\n }\n\n /**\n * Load a config file.\n * @param {string} filePath The path to a config file.\n * @param {Object} [options] The options.\n * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @param {string} [options.name] The config name.\n * @returns {ConfigArray} Loaded config.\n */\n loadFile(filePath, { basePath, name } = {}) {\n const slots = internalSlotsMap.get(this);\n const ctx = createContext(slots, \"config\", name, filePath, basePath);\n\n return new ConfigArray(...this._loadConfigData(ctx));\n }\n\n /**\n * Load the config file on a given directory if exists.\n * @param {string} directoryPath The path to a directory.\n * @param {Object} [options] The options.\n * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.\n * @param {string} [options.name] The config name.\n * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.\n */\n loadInDirectory(directoryPath, { basePath, name } = {}) {\n const slots = internalSlotsMap.get(this);\n\n for (const filename of configFilenames) {\n const ctx = createContext(\n slots,\n \"config\",\n name,\n path.join(directoryPath, filename),\n basePath\n );\n\n if (fs.existsSync(ctx.filePath) && fs.statSync(ctx.filePath).isFile()) {\n let configData;\n\n try {\n configData = loadConfigFile(ctx.filePath);\n } catch (error) {\n if (!error || error.code !== \"ESLINT_CONFIG_FIELD_NOT_FOUND\") {\n throw error;\n }\n }\n\n if (configData) {\n debug(`Config file found: ${ctx.filePath}`);\n return new ConfigArray(\n ...this._normalizeConfigData(configData, ctx)\n );\n }\n }\n }\n\n debug(`Config file not found on ${directoryPath}`);\n return new ConfigArray();\n }\n\n /**\n * Check if a config file on a given directory exists or not.\n * @param {string} directoryPath The path to a directory.\n * @returns {string | null} The path to the found config file. If not found then null.\n */\n static getPathToConfigFileInDirectory(directoryPath) {\n for (const filename of configFilenames) {\n const filePath = path.join(directoryPath, filename);\n\n if (fs.existsSync(filePath)) {\n if (filename === \"package.json\") {\n try {\n loadPackageJSONConfigFile(filePath);\n return filePath;\n } catch { /* ignore */ }\n } else {\n return filePath;\n }\n }\n }\n return null;\n }\n\n /**\n * Load `.eslintignore` file.\n * @param {string} filePath The path to a `.eslintignore` file to load.\n * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.\n */\n loadESLintIgnore(filePath) {\n const slots = internalSlotsMap.get(this);\n const ctx = createContext(\n slots,\n \"ignore\",\n void 0,\n filePath,\n slots.cwd\n );\n const ignorePatterns = loadESLintIgnoreFile(ctx.filePath);\n\n return new ConfigArray(\n ...this._normalizeESLintIgnoreData(ignorePatterns, ctx)\n );\n }\n\n /**\n * Load `.eslintignore` file in the current working directory.\n * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.\n */\n loadDefaultESLintIgnore() {\n const slots = internalSlotsMap.get(this);\n const eslintIgnorePath = path.resolve(slots.cwd, \".eslintignore\");\n const packageJsonPath = path.resolve(slots.cwd, \"package.json\");\n\n if (fs.existsSync(eslintIgnorePath)) {\n return this.loadESLintIgnore(eslintIgnorePath);\n }\n if (fs.existsSync(packageJsonPath)) {\n const data = loadJSONConfigFile(packageJsonPath);\n\n if (Object.hasOwnProperty.call(data, \"eslintIgnore\")) {\n if (!Array.isArray(data.eslintIgnore)) {\n throw new Error(\"Package.json eslintIgnore property requires an array of paths\");\n }\n const ctx = createContext(\n slots,\n \"ignore\",\n \"eslintIgnore in package.json\",\n packageJsonPath,\n slots.cwd\n );\n\n return new ConfigArray(\n ...this._normalizeESLintIgnoreData(data.eslintIgnore, ctx)\n );\n }\n }\n\n return new ConfigArray();\n }\n\n /**\n * Load a given config file.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} Loaded config.\n * @private\n */\n _loadConfigData(ctx) {\n return this._normalizeConfigData(loadConfigFile(ctx.filePath), ctx);\n }\n\n /**\n * Normalize a given `.eslintignore` data to config array elements.\n * @param {string[]} ignorePatterns The patterns to ignore files.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n *_normalizeESLintIgnoreData(ignorePatterns, ctx) {\n const elements = this._normalizeObjectConfigData(\n { ignorePatterns },\n ctx\n );\n\n // Set `ignorePattern.loose` flag for backward compatibility.\n for (const element of elements) {\n if (element.ignorePattern) {\n element.ignorePattern.loose = true;\n }\n yield element;\n }\n }\n\n /**\n * Normalize a given config to an array.\n * @param {ConfigData} configData The config data to normalize.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _normalizeConfigData(configData, ctx) {\n const validator = new ConfigValidator();\n\n validator.validateConfigSchema(configData, ctx.name || ctx.filePath);\n return this._normalizeObjectConfigData(configData, ctx);\n }\n\n /**\n * Normalize a given config to an array.\n * @param {ConfigData|OverrideConfigData} configData The config data to normalize.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n *_normalizeObjectConfigData(configData, ctx) {\n const { files, excludedFiles, ...configBody } = configData;\n const criteria = OverrideTester.create(\n files,\n excludedFiles,\n ctx.matchBasePath\n );\n const elements = this._normalizeObjectConfigDataBody(configBody, ctx);\n\n // Apply the criteria to every element.\n for (const element of elements) {\n\n /*\n * Merge the criteria.\n * This is for the `overrides` entries that came from the\n * configurations of `overrides[].extends`.\n */\n element.criteria = OverrideTester.and(criteria, element.criteria);\n\n /*\n * Remove `root` property to ignore `root` settings which came from\n * `extends` in `overrides`.\n */\n if (element.criteria) {\n element.root = void 0;\n }\n\n yield element;\n }\n }\n\n /**\n * Normalize a given config to an array.\n * @param {ConfigData} configData The config data to normalize.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n *_normalizeObjectConfigDataBody(\n {\n env,\n extends: extend,\n globals,\n ignorePatterns,\n noInlineConfig,\n parser: parserName,\n parserOptions,\n plugins: pluginList,\n processor,\n reportUnusedDisableDirectives,\n root,\n rules,\n settings,\n overrides: overrideList = []\n },\n ctx\n ) {\n const extendList = Array.isArray(extend) ? extend : [extend];\n const ignorePattern = ignorePatterns && new IgnorePattern(\n Array.isArray(ignorePatterns) ? ignorePatterns : [ignorePatterns],\n ctx.matchBasePath\n );\n\n // Flatten `extends`.\n for (const extendName of extendList.filter(Boolean)) {\n yield* this._loadExtends(extendName, ctx);\n }\n\n // Load parser & plugins.\n const parser = parserName && this._loadParser(parserName, ctx);\n const plugins = pluginList && this._loadPlugins(pluginList, ctx);\n\n // Yield pseudo config data for file extension processors.\n if (plugins) {\n yield* this._takeFileExtensionProcessors(plugins, ctx);\n }\n\n // Yield the config data except `extends` and `overrides`.\n yield {\n\n // Debug information.\n type: ctx.type,\n name: ctx.name,\n filePath: ctx.filePath,\n\n // Config data.\n criteria: null,\n env,\n globals,\n ignorePattern,\n noInlineConfig,\n parser,\n parserOptions,\n plugins,\n processor,\n reportUnusedDisableDirectives,\n root,\n rules,\n settings\n };\n\n // Flatten `overries`.\n for (let i = 0; i < overrideList.length; ++i) {\n yield* this._normalizeObjectConfigData(\n overrideList[i],\n { ...ctx, name: `${ctx.name}#overrides[${i}]` }\n );\n }\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _loadExtends(extendName, ctx) {\n debug(\"Loading {extends:%j} relative to %s\", extendName, ctx.filePath);\n try {\n if (extendName.startsWith(\"eslint:\")) {\n return this._loadExtendedBuiltInConfig(extendName, ctx);\n }\n if (extendName.startsWith(\"plugin:\")) {\n return this._loadExtendedPluginConfig(extendName, ctx);\n }\n return this._loadExtendedShareableConfig(extendName, ctx);\n } catch (error) {\n error.message += `\\nReferenced from: ${ctx.filePath || ctx.name}`;\n throw error;\n }\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _loadExtendedBuiltInConfig(extendName, ctx) {\n const {\n eslintAllPath,\n getEslintAllConfig,\n eslintRecommendedPath,\n getEslintRecommendedConfig\n } = internalSlotsMap.get(this);\n\n if (extendName === \"eslint:recommended\") {\n const name = `${ctx.name} » ${extendName}`;\n\n if (getEslintRecommendedConfig) {\n if (typeof getEslintRecommendedConfig !== \"function\") {\n throw new Error(`getEslintRecommendedConfig must be a function instead of '${getEslintRecommendedConfig}'`);\n }\n return this._normalizeConfigData(getEslintRecommendedConfig(), { ...ctx, name, filePath: \"\" });\n }\n return this._loadConfigData({\n ...ctx,\n name,\n filePath: eslintRecommendedPath\n });\n }\n if (extendName === \"eslint:all\") {\n const name = `${ctx.name} » ${extendName}`;\n\n if (getEslintAllConfig) {\n if (typeof getEslintAllConfig !== \"function\") {\n throw new Error(`getEslintAllConfig must be a function instead of '${getEslintAllConfig}'`);\n }\n return this._normalizeConfigData(getEslintAllConfig(), { ...ctx, name, filePath: \"\" });\n }\n return this._loadConfigData({\n ...ctx,\n name,\n filePath: eslintAllPath\n });\n }\n\n throw configInvalidError(extendName, ctx.name, \"extend-config-missing\");\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _loadExtendedPluginConfig(extendName, ctx) {\n const slashIndex = extendName.lastIndexOf(\"/\");\n\n if (slashIndex === -1) {\n throw configInvalidError(extendName, ctx.filePath, \"plugin-invalid\");\n }\n\n const pluginName = extendName.slice(\"plugin:\".length, slashIndex);\n const configName = extendName.slice(slashIndex + 1);\n\n if (isFilePath(pluginName)) {\n throw new Error(\"'extends' cannot use a file path for plugins.\");\n }\n\n const plugin = this._loadPlugin(pluginName, ctx);\n const configData =\n plugin.definition &&\n plugin.definition.configs[configName];\n\n if (configData) {\n return this._normalizeConfigData(configData, {\n ...ctx,\n filePath: plugin.filePath || ctx.filePath,\n name: `${ctx.name} » plugin:${plugin.id}/${configName}`\n });\n }\n\n throw plugin.error || configInvalidError(extendName, ctx.filePath, \"extend-config-missing\");\n }\n\n /**\n * Load configs of an element in `extends`.\n * @param {string} extendName The name of a base config.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The normalized config.\n * @private\n */\n _loadExtendedShareableConfig(extendName, ctx) {\n const { cwd, resolver } = internalSlotsMap.get(this);\n const relativeTo = ctx.filePath || path.join(cwd, \"__placeholder__.js\");\n let request;\n\n if (isFilePath(extendName)) {\n request = extendName;\n } else if (extendName.startsWith(\".\")) {\n request = `./${extendName}`; // For backward compatibility. A ton of tests depended on this behavior.\n } else {\n request = naming.normalizePackageName(\n extendName,\n \"eslint-config\"\n );\n }\n\n let filePath;\n\n try {\n filePath = resolver.resolve(request, relativeTo);\n } catch (error) {\n /* istanbul ignore else */\n if (error && error.code === \"MODULE_NOT_FOUND\") {\n throw configInvalidError(extendName, ctx.filePath, \"extend-config-missing\");\n }\n throw error;\n }\n\n writeDebugLogForLoading(request, relativeTo, filePath);\n return this._loadConfigData({\n ...ctx,\n filePath,\n name: `${ctx.name} » ${request}`\n });\n }\n\n /**\n * Load given plugins.\n * @param {string[]} names The plugin names to load.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {Record} The loaded parser.\n * @private\n */\n _loadPlugins(names, ctx) {\n return names.reduce((map, name) => {\n if (isFilePath(name)) {\n throw new Error(\"Plugins array cannot includes file paths.\");\n }\n const plugin = this._loadPlugin(name, ctx);\n\n map[plugin.id] = plugin;\n\n return map;\n }, {});\n }\n\n /**\n * Load a given parser.\n * @param {string} nameOrPath The package name or the path to a parser file.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {DependentParser} The loaded parser.\n */\n _loadParser(nameOrPath, ctx) {\n debug(\"Loading parser %j from %s\", nameOrPath, ctx.filePath);\n\n const { cwd, resolver } = internalSlotsMap.get(this);\n const relativeTo = ctx.filePath || path.join(cwd, \"__placeholder__.js\");\n\n try {\n const filePath = resolver.resolve(nameOrPath, relativeTo);\n\n writeDebugLogForLoading(nameOrPath, relativeTo, filePath);\n\n return new ConfigDependency({\n definition: require(filePath),\n filePath,\n id: nameOrPath,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n } catch (error) {\n\n // If the parser name is \"espree\", load the espree of ESLint.\n if (nameOrPath === \"espree\") {\n debug(\"Fallback espree.\");\n return new ConfigDependency({\n definition: require(\"espree\"),\n filePath: require.resolve(\"espree\"),\n id: nameOrPath,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n debug(\"Failed to load parser '%s' declared in '%s'.\", nameOrPath, ctx.name);\n error.message = `Failed to load parser '${nameOrPath}' declared in '${ctx.name}': ${error.message}`;\n\n return new ConfigDependency({\n error,\n id: nameOrPath,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n }\n\n /**\n * Load a given plugin.\n * @param {string} name The plugin name to load.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {DependentPlugin} The loaded plugin.\n * @private\n */\n _loadPlugin(name, ctx) {\n debug(\"Loading plugin %j from %s\", name, ctx.filePath);\n\n const { additionalPluginPool, resolver } = internalSlotsMap.get(this);\n const request = naming.normalizePackageName(name, \"eslint-plugin\");\n const id = naming.getShorthandName(request, \"eslint-plugin\");\n const relativeTo = path.join(ctx.pluginBasePath, \"__placeholder__.js\");\n\n if (name.match(/\\s+/u)) {\n const error = Object.assign(\n new Error(`Whitespace found in plugin name '${name}'`),\n {\n messageTemplate: \"whitespace-found\",\n messageData: { pluginName: request }\n }\n );\n\n return new ConfigDependency({\n error,\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n // Check for additional pool.\n const plugin =\n additionalPluginPool.get(request) ||\n additionalPluginPool.get(id);\n\n if (plugin) {\n return new ConfigDependency({\n definition: normalizePlugin(plugin),\n filePath: \"\", // It's unknown where the plugin came from.\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n let filePath;\n let error;\n\n try {\n filePath = resolver.resolve(request, relativeTo);\n } catch (resolveError) {\n error = resolveError;\n /* istanbul ignore else */\n if (error && error.code === \"MODULE_NOT_FOUND\") {\n error.messageTemplate = \"plugin-missing\";\n error.messageData = {\n pluginName: request,\n resolvePluginsRelativeTo: ctx.pluginBasePath,\n importerName: ctx.name\n };\n }\n }\n\n if (filePath) {\n try {\n writeDebugLogForLoading(request, relativeTo, filePath);\n\n const startTime = Date.now();\n const pluginDefinition = require(filePath);\n\n debug(`Plugin ${filePath} loaded in: ${Date.now() - startTime}ms`);\n\n return new ConfigDependency({\n definition: normalizePlugin(pluginDefinition),\n filePath,\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n } catch (loadError) {\n error = loadError;\n }\n }\n\n debug(\"Failed to load plugin '%s' declared in '%s'.\", name, ctx.name);\n error.message = `Failed to load plugin '${name}' declared in '${ctx.name}': ${error.message}`;\n return new ConfigDependency({\n error,\n id,\n importerName: ctx.name,\n importerPath: ctx.filePath\n });\n }\n\n /**\n * Take file expression processors as config array elements.\n * @param {Record} plugins The plugin definitions.\n * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.\n * @returns {IterableIterator} The config array elements of file expression processors.\n * @private\n */\n *_takeFileExtensionProcessors(plugins, ctx) {\n for (const pluginId of Object.keys(plugins)) {\n const processors =\n plugins[pluginId] &&\n plugins[pluginId].definition &&\n plugins[pluginId].definition.processors;\n\n if (!processors) {\n continue;\n }\n\n for (const processorId of Object.keys(processors)) {\n if (processorId.startsWith(\".\")) {\n yield* this._normalizeObjectConfigData(\n {\n files: [`*${processorId}`],\n processor: `${pluginId}/${processorId}`\n },\n {\n ...ctx,\n type: \"implicit-processor\",\n name: `${ctx.name}#processors[\"${pluginId}/${processorId}\"]`\n }\n );\n }\n }\n }\n }\n}\n\nexport { ConfigArrayFactory, createContext };\n","/**\n * @fileoverview `CascadingConfigArrayFactory` class.\n *\n * `CascadingConfigArrayFactory` class has a responsibility:\n *\n * 1. Handles cascading of config files.\n *\n * It provides two methods:\n *\n * - `getConfigArrayForFile(filePath)`\n * Get the corresponded configuration of a given file. This method doesn't\n * throw even if the given file didn't exist.\n * - `clearCache()`\n * Clear the internal cache. You have to call this method when\n * `additionalPluginPool` was updated if `baseConfig` or `cliConfig` depends\n * on the additional plugins. (`CLIEngine#addPlugin()` method calls this.)\n *\n * @author Toru Nagashima \n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport debugOrig from \"debug\";\nimport os from \"os\";\nimport path from \"path\";\n\nimport { ConfigArrayFactory } from \"./config-array-factory.js\";\nimport {\n ConfigArray,\n ConfigDependency,\n IgnorePattern\n} from \"./config-array/index.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport { emitDeprecationWarning } from \"./shared/deprecation-warnings.js\";\n\nconst debug = debugOrig(\"eslintrc:cascading-config-array-factory\");\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n// Define types for VSCode IntelliSense.\n/** @typedef {import(\"./shared/types\").ConfigData} ConfigData */\n/** @typedef {import(\"./shared/types\").Parser} Parser */\n/** @typedef {import(\"./shared/types\").Plugin} Plugin */\n/** @typedef {import(\"./shared/types\").Rule} Rule */\n/** @typedef {ReturnType} ConfigArray */\n\n/**\n * @typedef {Object} CascadingConfigArrayFactoryOptions\n * @property {Map} [additionalPluginPool] The map for additional plugins.\n * @property {ConfigData} [baseConfig] The config by `baseConfig` option.\n * @property {ConfigData} [cliConfig] The config by CLI options (`--env`, `--global`, `--ignore-pattern`, `--parser`, `--parser-options`, `--plugin`, and `--rule`). CLI options overwrite the setting in config files.\n * @property {string} [cwd] The base directory to start lookup.\n * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`.\n * @property {string[]} [rulePaths] The value of `--rulesdir` option.\n * @property {string} [specificConfigPath] The value of `--config` option.\n * @property {boolean} [useEslintrc] if `false` then it doesn't load config files.\n * @property {Function} loadRules The function to use to load rules.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/**\n * @typedef {Object} CascadingConfigArrayFactoryInternalSlots\n * @property {ConfigArray} baseConfigArray The config array of `baseConfig` option.\n * @property {ConfigData} baseConfigData The config data of `baseConfig` option. This is used to reset `baseConfigArray`.\n * @property {ConfigArray} cliConfigArray The config array of CLI options.\n * @property {ConfigData} cliConfigData The config data of CLI options. This is used to reset `cliConfigArray`.\n * @property {ConfigArrayFactory} configArrayFactory The factory for config arrays.\n * @property {Map} configCache The cache from directory paths to config arrays.\n * @property {string} cwd The base directory to start lookup.\n * @property {WeakMap} finalizeCache The cache from config arrays to finalized config arrays.\n * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`.\n * @property {string[]|null} rulePaths The value of `--rulesdir` option. This is used to reset `baseConfigArray`.\n * @property {string|null} specificConfigPath The value of `--config` option. This is used to reset `cliConfigArray`.\n * @property {boolean} useEslintrc if `false` then it doesn't load config files.\n * @property {Function} loadRules The function to use to load rules.\n * @property {Map} builtInRules The rules that are built in to ESLint.\n * @property {Object} [resolver=ModuleResolver] The module resolver object.\n * @property {string} eslintAllPath The path to the definitions for eslint:all.\n * @property {Function} getEslintAllConfig Returns the config data for eslint:all.\n * @property {string} eslintRecommendedPath The path to the definitions for eslint:recommended.\n * @property {Function} getEslintRecommendedConfig Returns the config data for eslint:recommended.\n */\n\n/** @type {WeakMap} */\nconst internalSlotsMap = new WeakMap();\n\n/**\n * Create the config array from `baseConfig` and `rulePaths`.\n * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots.\n * @returns {ConfigArray} The config array of the base configs.\n */\nfunction createBaseConfigArray({\n configArrayFactory,\n baseConfigData,\n rulePaths,\n cwd,\n loadRules\n}) {\n const baseConfigArray = configArrayFactory.create(\n baseConfigData,\n { name: \"BaseConfig\" }\n );\n\n /*\n * Create the config array element for the default ignore patterns.\n * This element has `ignorePattern` property that ignores the default\n * patterns in the current working directory.\n */\n baseConfigArray.unshift(configArrayFactory.create(\n { ignorePatterns: IgnorePattern.DefaultPatterns },\n { name: \"DefaultIgnorePattern\" }\n )[0]);\n\n /*\n * Load rules `--rulesdir` option as a pseudo plugin.\n * Use a pseudo plugin to define rules of `--rulesdir`, so we can validate\n * the rule's options with only information in the config array.\n */\n if (rulePaths && rulePaths.length > 0) {\n baseConfigArray.push({\n type: \"config\",\n name: \"--rulesdir\",\n filePath: \"\",\n plugins: {\n \"\": new ConfigDependency({\n definition: {\n rules: rulePaths.reduce(\n (map, rulesPath) => Object.assign(\n map,\n loadRules(rulesPath, cwd)\n ),\n {}\n )\n },\n filePath: \"\",\n id: \"\",\n importerName: \"--rulesdir\",\n importerPath: \"\"\n })\n }\n });\n }\n\n return baseConfigArray;\n}\n\n/**\n * Create the config array from CLI options.\n * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots.\n * @returns {ConfigArray} The config array of the base configs.\n */\nfunction createCLIConfigArray({\n cliConfigData,\n configArrayFactory,\n cwd,\n ignorePath,\n specificConfigPath\n}) {\n const cliConfigArray = configArrayFactory.create(\n cliConfigData,\n { name: \"CLIOptions\" }\n );\n\n cliConfigArray.unshift(\n ...(ignorePath\n ? configArrayFactory.loadESLintIgnore(ignorePath)\n : configArrayFactory.loadDefaultESLintIgnore())\n );\n\n if (specificConfigPath) {\n cliConfigArray.unshift(\n ...configArrayFactory.loadFile(\n specificConfigPath,\n { name: \"--config\", basePath: cwd }\n )\n );\n }\n\n return cliConfigArray;\n}\n\n/**\n * The error type when there are files matched by a glob, but all of them have been ignored.\n */\nclass ConfigurationNotFoundError extends Error {\n\n // eslint-disable-next-line jsdoc/require-description\n /**\n * @param {string} directoryPath The directory path.\n */\n constructor(directoryPath) {\n super(`No ESLint configuration found in ${directoryPath}.`);\n this.messageTemplate = \"no-config-found\";\n this.messageData = { directoryPath };\n }\n}\n\n/**\n * This class provides the functionality that enumerates every file which is\n * matched by given glob patterns and that configuration.\n */\nclass CascadingConfigArrayFactory {\n\n /**\n * Initialize this enumerator.\n * @param {CascadingConfigArrayFactoryOptions} options The options.\n */\n constructor({\n additionalPluginPool = new Map(),\n baseConfig: baseConfigData = null,\n cliConfig: cliConfigData = null,\n cwd = process.cwd(),\n ignorePath,\n resolvePluginsRelativeTo,\n rulePaths = [],\n specificConfigPath = null,\n useEslintrc = true,\n builtInRules = new Map(),\n loadRules,\n resolver,\n eslintRecommendedPath,\n getEslintRecommendedConfig,\n eslintAllPath,\n getEslintAllConfig\n } = {}) {\n const configArrayFactory = new ConfigArrayFactory({\n additionalPluginPool,\n cwd,\n resolvePluginsRelativeTo,\n builtInRules,\n resolver,\n eslintRecommendedPath,\n getEslintRecommendedConfig,\n eslintAllPath,\n getEslintAllConfig\n });\n\n internalSlotsMap.set(this, {\n baseConfigArray: createBaseConfigArray({\n baseConfigData,\n configArrayFactory,\n cwd,\n rulePaths,\n loadRules,\n resolver\n }),\n baseConfigData,\n cliConfigArray: createCLIConfigArray({\n cliConfigData,\n configArrayFactory,\n cwd,\n ignorePath,\n specificConfigPath\n }),\n cliConfigData,\n configArrayFactory,\n configCache: new Map(),\n cwd,\n finalizeCache: new WeakMap(),\n ignorePath,\n rulePaths,\n specificConfigPath,\n useEslintrc,\n builtInRules,\n loadRules\n });\n }\n\n /**\n * The path to the current working directory.\n * This is used by tests.\n * @type {string}\n */\n get cwd() {\n const { cwd } = internalSlotsMap.get(this);\n\n return cwd;\n }\n\n /**\n * Get the config array of a given file.\n * If `filePath` was not given, it returns the config which contains only\n * `baseConfigData` and `cliConfigData`.\n * @param {string} [filePath] The file path to a file.\n * @param {Object} [options] The options.\n * @param {boolean} [options.ignoreNotFoundError] If `true` then it doesn't throw `ConfigurationNotFoundError`.\n * @returns {ConfigArray} The config array of the file.\n */\n getConfigArrayForFile(filePath, { ignoreNotFoundError = false } = {}) {\n const {\n baseConfigArray,\n cliConfigArray,\n cwd\n } = internalSlotsMap.get(this);\n\n if (!filePath) {\n return new ConfigArray(...baseConfigArray, ...cliConfigArray);\n }\n\n const directoryPath = path.dirname(path.resolve(cwd, filePath));\n\n debug(`Load config files for ${directoryPath}.`);\n\n return this._finalizeConfigArray(\n this._loadConfigInAncestors(directoryPath),\n directoryPath,\n ignoreNotFoundError\n );\n }\n\n /**\n * Set the config data to override all configs.\n * Require to call `clearCache()` method after this method is called.\n * @param {ConfigData} configData The config data to override all configs.\n * @returns {void}\n */\n setOverrideConfig(configData) {\n const slots = internalSlotsMap.get(this);\n\n slots.cliConfigData = configData;\n }\n\n /**\n * Clear config cache.\n * @returns {void}\n */\n clearCache() {\n const slots = internalSlotsMap.get(this);\n\n slots.baseConfigArray = createBaseConfigArray(slots);\n slots.cliConfigArray = createCLIConfigArray(slots);\n slots.configCache.clear();\n }\n\n /**\n * Load and normalize config files from the ancestor directories.\n * @param {string} directoryPath The path to a leaf directory.\n * @param {boolean} configsExistInSubdirs `true` if configurations exist in subdirectories.\n * @returns {ConfigArray} The loaded config.\n * @private\n */\n _loadConfigInAncestors(directoryPath, configsExistInSubdirs = false) {\n const {\n baseConfigArray,\n configArrayFactory,\n configCache,\n cwd,\n useEslintrc\n } = internalSlotsMap.get(this);\n\n if (!useEslintrc) {\n return baseConfigArray;\n }\n\n let configArray = configCache.get(directoryPath);\n\n // Hit cache.\n if (configArray) {\n debug(`Cache hit: ${directoryPath}.`);\n return configArray;\n }\n debug(`No cache found: ${directoryPath}.`);\n\n const homePath = os.homedir();\n\n // Consider this is root.\n if (directoryPath === homePath && cwd !== homePath) {\n debug(\"Stop traversing because of considered root.\");\n if (configsExistInSubdirs) {\n const filePath = ConfigArrayFactory.getPathToConfigFileInDirectory(directoryPath);\n\n if (filePath) {\n emitDeprecationWarning(\n filePath,\n \"ESLINT_PERSONAL_CONFIG_SUPPRESS\"\n );\n }\n }\n return this._cacheConfig(directoryPath, baseConfigArray);\n }\n\n // Load the config on this directory.\n try {\n configArray = configArrayFactory.loadInDirectory(directoryPath);\n } catch (error) {\n /* istanbul ignore next */\n if (error.code === \"EACCES\") {\n debug(\"Stop traversing because of 'EACCES' error.\");\n return this._cacheConfig(directoryPath, baseConfigArray);\n }\n throw error;\n }\n\n if (configArray.length > 0 && configArray.isRoot()) {\n debug(\"Stop traversing because of 'root:true'.\");\n configArray.unshift(...baseConfigArray);\n return this._cacheConfig(directoryPath, configArray);\n }\n\n // Load from the ancestors and merge it.\n const parentPath = path.dirname(directoryPath);\n const parentConfigArray = parentPath && parentPath !== directoryPath\n ? this._loadConfigInAncestors(\n parentPath,\n configsExistInSubdirs || configArray.length > 0\n )\n : baseConfigArray;\n\n if (configArray.length > 0) {\n configArray.unshift(...parentConfigArray);\n } else {\n configArray = parentConfigArray;\n }\n\n // Cache and return.\n return this._cacheConfig(directoryPath, configArray);\n }\n\n /**\n * Freeze and cache a given config.\n * @param {string} directoryPath The path to a directory as a cache key.\n * @param {ConfigArray} configArray The config array as a cache value.\n * @returns {ConfigArray} The `configArray` (frozen).\n */\n _cacheConfig(directoryPath, configArray) {\n const { configCache } = internalSlotsMap.get(this);\n\n Object.freeze(configArray);\n configCache.set(directoryPath, configArray);\n\n return configArray;\n }\n\n /**\n * Finalize a given config array.\n * Concatenate `--config` and other CLI options.\n * @param {ConfigArray} configArray The parent config array.\n * @param {string} directoryPath The path to the leaf directory to find config files.\n * @param {boolean} ignoreNotFoundError If `true` then it doesn't throw `ConfigurationNotFoundError`.\n * @returns {ConfigArray} The loaded config.\n * @private\n */\n _finalizeConfigArray(configArray, directoryPath, ignoreNotFoundError) {\n const {\n cliConfigArray,\n configArrayFactory,\n finalizeCache,\n useEslintrc,\n builtInRules\n } = internalSlotsMap.get(this);\n\n let finalConfigArray = finalizeCache.get(configArray);\n\n if (!finalConfigArray) {\n finalConfigArray = configArray;\n\n // Load the personal config if there are no regular config files.\n if (\n useEslintrc &&\n configArray.every(c => !c.filePath) &&\n cliConfigArray.every(c => !c.filePath) // `--config` option can be a file.\n ) {\n const homePath = os.homedir();\n\n debug(\"Loading the config file of the home directory:\", homePath);\n\n const personalConfigArray = configArrayFactory.loadInDirectory(\n homePath,\n { name: \"PersonalConfig\" }\n );\n\n if (\n personalConfigArray.length > 0 &&\n !directoryPath.startsWith(homePath)\n ) {\n const lastElement =\n personalConfigArray[personalConfigArray.length - 1];\n\n emitDeprecationWarning(\n lastElement.filePath,\n \"ESLINT_PERSONAL_CONFIG_LOAD\"\n );\n }\n\n finalConfigArray = finalConfigArray.concat(personalConfigArray);\n }\n\n // Apply CLI options.\n if (cliConfigArray.length > 0) {\n finalConfigArray = finalConfigArray.concat(cliConfigArray);\n }\n\n // Validate rule settings and environments.\n const validator = new ConfigValidator({\n builtInRules\n });\n\n validator.validateConfigArray(finalConfigArray);\n\n // Cache it.\n Object.freeze(finalConfigArray);\n finalizeCache.set(configArray, finalConfigArray);\n\n debug(\n \"Configuration was determined: %o on %s\",\n finalConfigArray,\n directoryPath\n );\n }\n\n // At least one element (the default ignore patterns) exists.\n if (!ignoreNotFoundError && useEslintrc && finalConfigArray.length <= 1) {\n throw new ConfigurationNotFoundError(directoryPath);\n }\n\n return finalConfigArray;\n }\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport { CascadingConfigArrayFactory };\n","/**\n * @fileoverview Compatibility class for flat config.\n * @author Nicholas C. Zakas\n */\n\n//-----------------------------------------------------------------------------\n// Requirements\n//-----------------------------------------------------------------------------\n\nimport createDebug from \"debug\";\nimport path from \"path\";\n\nimport environments from \"../conf/environments.js\";\nimport { ConfigArrayFactory } from \"./config-array-factory.js\";\n\n//-----------------------------------------------------------------------------\n// Helpers\n//-----------------------------------------------------------------------------\n\n/** @typedef {import(\"../../shared/types\").Environment} Environment */\n/** @typedef {import(\"../../shared/types\").Processor} Processor */\n\nconst debug = createDebug(\"eslintrc:flat-compat\");\nconst cafactory = Symbol(\"cafactory\");\n\n/**\n * Translates an ESLintRC-style config object into a flag-config-style config\n * object.\n * @param {Object} eslintrcConfig An ESLintRC-style config object.\n * @param {Object} options Options to help translate the config.\n * @param {string} options.resolveConfigRelativeTo To the directory to resolve\n * configs from.\n * @param {string} options.resolvePluginsRelativeTo The directory to resolve\n * plugins from.\n * @param {ReadOnlyMap} options.pluginEnvironments A map of plugin environment\n * names to objects.\n * @param {ReadOnlyMap} options.pluginProcessors A map of plugin processor\n * names to objects.\n * @returns {Object} A flag-config-style config object.\n */\nfunction translateESLintRC(eslintrcConfig, {\n resolveConfigRelativeTo,\n resolvePluginsRelativeTo,\n pluginEnvironments,\n pluginProcessors\n}) {\n\n const flatConfig = {};\n const configs = [];\n const languageOptions = {};\n const linterOptions = {};\n const keysToCopy = [\"settings\", \"rules\", \"processor\"];\n const languageOptionsKeysToCopy = [\"globals\", \"parser\", \"parserOptions\"];\n const linterOptionsKeysToCopy = [\"noInlineConfig\", \"reportUnusedDisableDirectives\"];\n\n // check for special settings for eslint:all and eslint:recommended:\n if (eslintrcConfig.settings) {\n if (eslintrcConfig.settings[\"eslint:all\"] === true) {\n return [\"eslint:all\"];\n }\n\n if (eslintrcConfig.settings[\"eslint:recommended\"] === true) {\n return [\"eslint:recommended\"];\n }\n }\n\n // copy over simple translations\n for (const key of keysToCopy) {\n if (key in eslintrcConfig && typeof eslintrcConfig[key] !== \"undefined\") {\n flatConfig[key] = eslintrcConfig[key];\n }\n }\n\n // copy over languageOptions\n for (const key of languageOptionsKeysToCopy) {\n if (key in eslintrcConfig && typeof eslintrcConfig[key] !== \"undefined\") {\n\n // create the languageOptions key in the flat config\n flatConfig.languageOptions = languageOptions;\n\n if (key === \"parser\") {\n debug(`Resolving parser '${languageOptions[key]}' relative to ${resolveConfigRelativeTo}`);\n\n if (eslintrcConfig[key].error) {\n throw eslintrcConfig[key].error;\n }\n\n languageOptions[key] = eslintrcConfig[key].definition;\n continue;\n }\n\n // clone any object values that are in the eslintrc config\n if (eslintrcConfig[key] && typeof eslintrcConfig[key] === \"object\") {\n languageOptions[key] = {\n ...eslintrcConfig[key]\n };\n } else {\n languageOptions[key] = eslintrcConfig[key];\n }\n }\n }\n\n // copy over linterOptions\n for (const key of linterOptionsKeysToCopy) {\n if (key in eslintrcConfig && typeof eslintrcConfig[key] !== \"undefined\") {\n flatConfig.linterOptions = linterOptions;\n linterOptions[key] = eslintrcConfig[key];\n }\n }\n\n // move ecmaVersion a level up\n if (languageOptions.parserOptions) {\n\n if (\"ecmaVersion\" in languageOptions.parserOptions) {\n languageOptions.ecmaVersion = languageOptions.parserOptions.ecmaVersion;\n delete languageOptions.parserOptions.ecmaVersion;\n }\n\n if (\"sourceType\" in languageOptions.parserOptions) {\n languageOptions.sourceType = languageOptions.parserOptions.sourceType;\n delete languageOptions.parserOptions.sourceType;\n }\n\n // check to see if we even need parserOptions anymore and remove it if not\n if (Object.keys(languageOptions.parserOptions).length === 0) {\n delete languageOptions.parserOptions;\n }\n }\n\n // overrides\n if (eslintrcConfig.criteria) {\n flatConfig.files = [absoluteFilePath => eslintrcConfig.criteria.test(absoluteFilePath)];\n }\n\n // translate plugins\n if (eslintrcConfig.plugins && typeof eslintrcConfig.plugins === \"object\") {\n debug(`Translating plugins: ${eslintrcConfig.plugins}`);\n\n flatConfig.plugins = {};\n\n for (const pluginName of Object.keys(eslintrcConfig.plugins)) {\n\n debug(`Translating plugin: ${pluginName}`);\n debug(`Resolving plugin '${pluginName} relative to ${resolvePluginsRelativeTo}`);\n\n const { definition: plugin, error } = eslintrcConfig.plugins[pluginName];\n\n if (error) {\n throw error;\n }\n\n flatConfig.plugins[pluginName] = plugin;\n\n // create a config for any processors\n if (plugin.processors) {\n for (const processorName of Object.keys(plugin.processors)) {\n if (processorName.startsWith(\".\")) {\n debug(`Assigning processor: ${pluginName}/${processorName}`);\n\n configs.unshift({\n files: [`**/*${processorName}`],\n processor: pluginProcessors.get(`${pluginName}/${processorName}`)\n });\n }\n\n }\n }\n }\n }\n\n // translate env - must come after plugins\n if (eslintrcConfig.env && typeof eslintrcConfig.env === \"object\") {\n for (const envName of Object.keys(eslintrcConfig.env)) {\n\n // only add environments that are true\n if (eslintrcConfig.env[envName]) {\n debug(`Translating environment: ${envName}`);\n\n if (environments.has(envName)) {\n\n // built-in environments should be defined first\n configs.unshift(...translateESLintRC(environments.get(envName), {\n resolveConfigRelativeTo,\n resolvePluginsRelativeTo\n }));\n } else if (pluginEnvironments.has(envName)) {\n\n // if the environment comes from a plugin, it should come after the plugin config\n configs.push(...translateESLintRC(pluginEnvironments.get(envName), {\n resolveConfigRelativeTo,\n resolvePluginsRelativeTo\n }));\n }\n }\n }\n }\n\n // only add if there are actually keys in the config\n if (Object.keys(flatConfig).length > 0) {\n configs.push(flatConfig);\n }\n\n return configs;\n}\n\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\n/**\n * A compatibility class for working with configs.\n */\nclass FlatCompat {\n\n constructor({\n baseDirectory = process.cwd(),\n resolvePluginsRelativeTo = baseDirectory\n } = {}) {\n this.baseDirectory = baseDirectory;\n this.resolvePluginsRelativeTo = resolvePluginsRelativeTo;\n this[cafactory] = new ConfigArrayFactory({\n cwd: baseDirectory,\n resolvePluginsRelativeTo,\n getEslintAllConfig: () => ({ settings: { \"eslint:all\": true } }),\n getEslintRecommendedConfig: () => ({ settings: { \"eslint:recommended\": true } })\n });\n }\n\n /**\n * Translates an ESLintRC-style config into a flag-config-style config.\n * @param {Object} eslintrcConfig The ESLintRC-style config object.\n * @returns {Object} A flag-config-style config object.\n */\n config(eslintrcConfig) {\n const eslintrcArray = this[cafactory].create(eslintrcConfig, {\n basePath: this.baseDirectory\n });\n\n const flatArray = [];\n let hasIgnorePatterns = false;\n\n eslintrcArray.forEach(configData => {\n if (configData.type === \"config\") {\n hasIgnorePatterns = hasIgnorePatterns || configData.ignorePattern;\n flatArray.push(...translateESLintRC(configData, {\n resolveConfigRelativeTo: path.join(this.baseDirectory, \"__placeholder.js\"),\n resolvePluginsRelativeTo: path.join(this.resolvePluginsRelativeTo, \"__placeholder.js\"),\n pluginEnvironments: eslintrcArray.pluginEnvironments,\n pluginProcessors: eslintrcArray.pluginProcessors\n }));\n }\n });\n\n // combine ignorePatterns to emulate ESLintRC behavior better\n if (hasIgnorePatterns) {\n flatArray.unshift({\n ignores: [filePath => {\n\n // Compute the final config for this file.\n // This filters config array elements by `files`/`excludedFiles` then merges the elements.\n const finalConfig = eslintrcArray.extractConfig(filePath);\n\n // Test the `ignorePattern` properties of the final config.\n return Boolean(finalConfig.ignores) && finalConfig.ignores(filePath);\n }]\n });\n }\n\n return flatArray;\n }\n\n /**\n * Translates the `env` section of an ESLintRC-style config.\n * @param {Object} envConfig The `env` section of an ESLintRC config.\n * @returns {Object} A flag-config object representing the environments.\n */\n env(envConfig) {\n return this.config({\n env: envConfig\n });\n }\n\n /**\n * Translates the `extends` section of an ESLintRC-style config.\n * @param {...string} configsToExtend The names of the configs to load.\n * @returns {Object} A flag-config object representing the config.\n */\n extends(...configsToExtend) {\n return this.config({\n extends: configsToExtend\n });\n }\n\n /**\n * Translates the `plugins` section of an ESLintRC-style config.\n * @param {...string} plugins The names of the plugins to load.\n * @returns {Object} A flag-config object representing the plugins.\n */\n plugins(...plugins) {\n return this.config({\n plugins\n });\n }\n}\n\nexport { FlatCompat };\n","/**\n * @fileoverview Package exports for @eslint/eslintrc\n * @author Nicholas C. Zakas\n */\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport {\n ConfigArrayFactory,\n createContext as createConfigArrayFactoryContext\n} from \"./config-array-factory.js\";\n\nimport { CascadingConfigArrayFactory } from \"./cascading-config-array-factory.js\";\nimport * as ModuleResolver from \"./shared/relative-module-resolver.js\";\nimport { ConfigArray, getUsedExtractedConfigs } from \"./config-array/index.js\";\nimport { ConfigDependency } from \"./config-array/config-dependency.js\";\nimport { ExtractedConfig } from \"./config-array/extracted-config.js\";\nimport { IgnorePattern } from \"./config-array/ignore-pattern.js\";\nimport { OverrideTester } from \"./config-array/override-tester.js\";\nimport * as ConfigOps from \"./shared/config-ops.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport * as naming from \"./shared/naming.js\";\nimport { FlatCompat } from \"./flat-compat.js\";\nimport environments from \"../conf/environments.js\";\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\nconst Legacy = {\n ConfigArray,\n createConfigArrayFactoryContext,\n CascadingConfigArrayFactory,\n ConfigArrayFactory,\n ConfigDependency,\n ExtractedConfig,\n IgnorePattern,\n OverrideTester,\n getUsedExtractedConfigs,\n environments,\n\n // shared\n ConfigOps,\n ConfigValidator,\n ModuleResolver,\n naming\n};\n\nexport {\n\n Legacy,\n\n FlatCompat\n\n};\n"],"names":["debug","debugOrig","path","ignore","assert","internalSlotsMap","util","minimatch","Ajv","globals","BuiltInEnvironments","ConfigOps.normalizeConfigGlobal","Module","require","createRequire","fs","stripComments","ModuleResolver.resolve","naming.normalizePackageName","naming.getShorthandName","os","createDebug","createConfigArrayFactoryContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA,MAAMA,OAAK,GAAGC,6BAAS,CAAC,yBAAyB,CAAC,CAAC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB,CAAC,WAAW,EAAE;AAC5C,IAAI,IAAI,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAChC;AACA,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;AACjD,QAAQ,MAAM,CAAC,GAAG,MAAM,CAAC;AACzB,QAAQ,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AACjC;AACA;AACA,QAAQ,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;AAC7C;AACA;AACA,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,UAAU,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;AAC3E,YAAY,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;AAC/B,gBAAgB,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;AAChD,gBAAgB,MAAM;AACtB,aAAa;AACb,YAAY,IAAI,CAAC,CAAC,CAAC,CAAC,KAAKC,wBAAI,CAAC,GAAG,EAAE;AACnC,gBAAgB,UAA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,CAAC;AACjE,KAAK,CAAC,OAAO,KAAK,EAAE;AACpB;AACA;AACA,QAAQ;AACR,YAAY,OAAO,KAAK,KAAK,QAAQ;AACrC,YAAY,KAAK,KAAK,IAAI;AAC1B,YAAY,KAAK,CAAC,IAAI,KAAK,kBAAkB;AAC7C,YAAY,CAAC,KAAK,CAAC,YAAY;AAC/B,YAAY,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;AAC9C,UAAU;AACV,YAAY,KAAK,CAAC,OAAO,IAAI,CAAC,oBAAoB,EAAE,cAAc,CAAC,CAAC,CAAC;AACrE,SAAS;AACT,QAAQ,MAAM,KAAK,CAAC;AACpB,KAAK;AACL;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAsBA;AACA,MAAMC,SAAO,GAAGC,oBAAa,CAAC,mDAAe,CAAC,CAAC;AAC/C;AACA,MAAMd,OAAK,GAAGC,6BAAS,CAAC,+BAA+B,CAAC,CAAC;AACzD;AACA;AACA;AACA;AACA;AACA,MAAM,eAAe,GAAG;AACxB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,WAAW;AACf,IAAI,cAAc;AAClB,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,kBAAgB,GAAG,IAAI,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C;AACX,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,GAAG,eAAe,EAAE;AAChC,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC;AAC3B,YAAY,OAAO,EAAE,eAAe;AACpC,SAAS,CAAC,CAAC;AACX,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,GAAG,OAAO,EAAE;AACxB,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC;AAC3B,YAAY,OAAO;AACnB,SAAS,CAAC,CAAC;AACX,KAAK;AACL;;AChTA;AACA;AACA;AACA;AAsBA;AACA;AACA;AACA;AACA;AACK,MAAC,MAAM,GAAG;AACf,IAAI,WAAW;AACf,qCAAIqB,aAA+B;AACnC,IAAI,2BAA2B;AAC/B,IAAI,kBAAkB;AACtB,IAAI,gBAAgB;AACpB,IAAI,eAAe;AACnB,IAAI,aAAa;AACjB,IAAI,cAAc;AAClB,IAAI,uBAAuB;AAC3B,IAAI,YAAY;AAChB;AACA;AACA,IAAI,SAAS;AACb,IAAI,eAAe;AACnB,IAAI,cAAc;AAClB,IAAI,MAAM;AACV;;;;;"} +\ No newline at end of file +diff --git a/node_modules/@eslint/eslintrc/lib/config-array-factory.js b/node_modules/@eslint/eslintrc/lib/config-array-factory.js +index 9553d1f..3ea3e55 100644 +--- a/node_modules/@eslint/eslintrc/lib/config-array-factory.js ++++ b/node_modules/@eslint/eslintrc/lib/config-array-factory.js +@@ -40,7 +40,6 @@ + + import debugOrig from "debug"; + import fs from "fs"; +-import importFresh from "import-fresh"; + import { createRequire } from "module"; + import path from "path"; + import stripComments from "strip-json-comments"; +@@ -231,7 +230,7 @@ function loadLegacyConfigFile(filePath) { + function loadJSConfigFile(filePath) { + debug(`Loading JS config file: ${filePath}`); + try { +- return importFresh(filePath); ++ return require(filePath); + } catch (e) { + debug(`Error reading JavaScript file: ${filePath}`); + e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`; \ No newline at end of file diff --git a/patches/@types+jsdom++parse5+7.0.0.patch b/patches/@types+jsdom++parse5+7.0.0.patch new file mode 100644 index 000000000..4ae2b21ed --- /dev/null +++ b/patches/@types+jsdom++parse5+7.0.0.patch @@ -0,0 +1,91 @@ +diff --git a/node_modules/@types/jsdom/node_modules/parse5/dist/index.d.ts b/node_modules/@types/jsdom/node_modules/parse5/dist/index.d.ts +index 81253d3..d2333bf 100644 +--- a/node_modules/@types/jsdom/node_modules/parse5/dist/index.d.ts ++++ b/node_modules/@types/jsdom/node_modules/parse5/dist/index.d.ts +@@ -1,10 +1,10 @@ +-import { type ParserOptions } from './parser/index.js'; ++import { ParserOptions } from './parser/index.js'; + import type { DefaultTreeAdapterMap } from './tree-adapters/default.js'; + import type { TreeAdapterTypeMap } from './tree-adapters/interface.js'; +-export { type DefaultTreeAdapterMap, defaultTreeAdapter } from './tree-adapters/default.js'; ++export { DefaultTreeAdapterMap, defaultTreeAdapter } from './tree-adapters/default.js'; + export type { TreeAdapter, TreeAdapterTypeMap } from './tree-adapters/interface.js'; +-export { type ParserOptions, /** @internal */ Parser } from './parser/index.js'; +-export { serialize, serializeOuter, type SerializerOptions } from './serializer/index.js'; ++export { ParserOptions, /** @internal */ Parser } from './parser/index.js'; ++export { serialize, serializeOuter, SerializerOptions } from './serializer/index.js'; + export type { ParserError } from './common/error-codes.js'; + /** @internal */ + export * as foreignContent from './common/foreign-content.js'; +@@ -13,7 +13,7 @@ export * as html from './common/html.js'; + /** @internal */ + export * as Token from './common/token.js'; + /** @internal */ +-export { Tokenizer, type TokenizerOptions, TokenizerMode, type TokenHandler } from './tokenizer/index.js'; ++export { Tokenizer, TokenizerOptions, TokenizerMode, TokenHandler } from './tokenizer/index.js'; + /** + * Parses an HTML string. + * +diff --git a/node_modules/@types/jsdom/node_modules/parse5/dist/parser/index.d.ts b/node_modules/@types/jsdom/node_modules/parse5/dist/parser/index.d.ts +index 50a9bd0..df1863e 100644 +--- a/node_modules/@types/jsdom/node_modules/parse5/dist/parser/index.d.ts ++++ b/node_modules/@types/jsdom/node_modules/parse5/dist/parser/index.d.ts +@@ -1,10 +1,10 @@ +-import { Tokenizer, TokenizerMode, type TokenHandler } from '../tokenizer/index.js'; +-import { OpenElementStack, type StackHandler } from './open-element-stack.js'; ++import { Tokenizer, TokenizerMode, TokenHandler } from '../tokenizer/index.js'; ++import { OpenElementStack, StackHandler } from './open-element-stack.js'; + import { FormattingElementList } from './formatting-element-list.js'; +-import { ERR, type ParserErrorHandler } from '../common/error-codes.js'; ++import { ERR, ParserErrorHandler } from '../common/error-codes.js'; + import { TAG_ID as $, NS } from '../common/html.js'; + import type { TreeAdapter, TreeAdapterTypeMap } from '../tree-adapters/interface.js'; +-import { type Token, type CommentToken, type CharacterToken, type TagToken, type DoctypeToken, type EOFToken, type LocationWithAttributes } from '../common/token.js'; ++import { Token, CommentToken, CharacterToken, TagToken, DoctypeToken, EOFToken, LocationWithAttributes } from '../common/token.js'; + declare enum InsertionMode { + INITIAL = 0, + BEFORE_HTML = 1, +diff --git a/node_modules/@types/jsdom/node_modules/parse5/dist/serializer/index.d.ts b/node_modules/@types/jsdom/node_modules/parse5/dist/serializer/index.d.ts +index d944fae..432464c 100644 +--- a/node_modules/@types/jsdom/node_modules/parse5/dist/serializer/index.d.ts ++++ b/node_modules/@types/jsdom/node_modules/parse5/dist/serializer/index.d.ts +@@ -1,5 +1,5 @@ + import type { TreeAdapter, TreeAdapterTypeMap } from '../tree-adapters/interface'; +-import { type DefaultTreeAdapterMap } from '../tree-adapters/default.js'; ++import { DefaultTreeAdapterMap } from '../tree-adapters/default.js'; + export interface SerializerOptions { + /** + * Specifies input tree format. +diff --git a/node_modules/@types/jsdom/node_modules/parse5/dist/tokenizer/index.d.ts b/node_modules/@types/jsdom/node_modules/parse5/dist/tokenizer/index.d.ts +index de6e234..89e2484 100644 +--- a/node_modules/@types/jsdom/node_modules/parse5/dist/tokenizer/index.d.ts ++++ b/node_modules/@types/jsdom/node_modules/parse5/dist/tokenizer/index.d.ts +@@ -1,6 +1,6 @@ + import { Preprocessor } from './preprocessor.js'; +-import { type CharacterToken, type DoctypeToken, type TagToken, type EOFToken, type CommentToken } from '../common/token.js'; +-import { type ParserErrorHandler } from '../common/error-codes.js'; ++import { CharacterToken, DoctypeToken, TagToken, EOFToken, CommentToken } from '../common/token.js'; ++import { ParserErrorHandler } from '../common/error-codes.js'; + declare const enum State { + DATA = 0, + RCDATA = 1, +diff --git a/node_modules/@types/jsdom/node_modules/parse5/dist/tokenizer/preprocessor.d.ts b/node_modules/@types/jsdom/node_modules/parse5/dist/tokenizer/preprocessor.d.ts +index e74a590..d145dcc 100644 +--- a/node_modules/@types/jsdom/node_modules/parse5/dist/tokenizer/preprocessor.d.ts ++++ b/node_modules/@types/jsdom/node_modules/parse5/dist/tokenizer/preprocessor.d.ts +@@ -1,4 +1,4 @@ +-import { ERR, type ParserError, type ParserErrorHandler } from '../common/error-codes.js'; ++import { ERR, ParserError, ParserErrorHandler } from '../common/error-codes.js'; + export declare class Preprocessor { + private handler; + html: string; +diff --git a/node_modules/@types/jsdom/node_modules/parse5/dist/tree-adapters/default.d.ts b/node_modules/@types/jsdom/node_modules/parse5/dist/tree-adapters/default.d.ts +index cccdf8f..d70b8fa 100644 +--- a/node_modules/@types/jsdom/node_modules/parse5/dist/tree-adapters/default.d.ts ++++ b/node_modules/@types/jsdom/node_modules/parse5/dist/tree-adapters/default.d.ts +@@ -1,4 +1,4 @@ +-import { DOCUMENT_MODE, type NS } from '../common/html.js'; ++import { DOCUMENT_MODE, NS } from '../common/html.js'; + import type { Attribute, Location, ElementLocation } from '../common/token.js'; + import type { TreeAdapter, TreeAdapterTypeMap } from './interface.js'; + export declare enum NodeType { diff --git a/patches/@types+madge+5.0.0.patch b/patches/@types+madge+5.0.0.patch new file mode 100644 index 000000000..3d49bedc1 --- /dev/null +++ b/patches/@types+madge+5.0.0.patch @@ -0,0 +1,16 @@ +diff --git a/node_modules/@types/madge/index.d.ts b/node_modules/@types/madge/index.d.ts +index f2a8652..3a26bfe 100755 +--- a/node_modules/@types/madge/index.d.ts ++++ b/node_modules/@types/madge/index.d.ts +@@ -265,6 +265,10 @@ declare namespace madge { + * + * @default undefined + */ +- dependencyFilter?: (id: string) => boolean; ++ dependencyFilter?: ( ++ dependencyFilePath: string, ++ traversedFilePath: string, ++ baseDir: string, ++ ) => boolean; + } + } diff --git a/patches/abort-controller+3.0.0.patch b/patches/abort-controller+3.0.0.patch index 2210446d2..c9a7f43aa 100644 --- a/patches/abort-controller+3.0.0.patch +++ b/patches/abort-controller+3.0.0.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/abort-controller/browser.js b/node_modules/abort-controller/browser.js -index b0c5ec3..c8c8018 100644 +index b0c5ec3..b61071b 100644 --- a/node_modules/abort-controller/browser.js +++ b/node_modules/abort-controller/browser.js @@ -2,12 +2,7 @@ @@ -13,6 +13,7 @@ index b0c5ec3..c8c8018 100644 +const { AbortController } = globalThis; /*eslint-enable @mysticatea/prettier */ - module.exports = AbortController +-module.exports = AbortController -module.exports.AbortSignal = AbortSignal -module.exports.default = AbortController ++module.exports = { AbortController } diff --git a/patches/acorn+7.4.1.patch b/patches/acorn-node++acorn+7.4.1.patch similarity index 54% rename from patches/acorn+7.4.1.patch rename to patches/acorn-node++acorn+7.4.1.patch index 061aa1281..bfef35e79 100644 --- a/patches/acorn+7.4.1.patch +++ b/patches/acorn-node++acorn+7.4.1.patch @@ -1,13 +1,13 @@ -diff --git a/node_modules/acorn/dist/acorn.js b/node_modules/acorn/dist/acorn.js -index 0523f0e..9d3d5c2 100644 ---- a/node_modules/acorn/dist/acorn.js -+++ b/node_modules/acorn/dist/acorn.js +diff --git a/node_modules/acorn-node/node_modules/acorn/dist/acorn.js b/node_modules/acorn-node/node_modules/acorn/dist/acorn.js +index 0523f0e..2bb9b56 100644 +--- a/node_modules/acorn-node/node_modules/acorn/dist/acorn.js ++++ b/node_modules/acorn-node/node_modules/acorn/dist/acorn.js @@ -1835,7 +1835,7 @@ if (checkClashes) { if (has(checkClashes, expr.name)) { this.raiseRecoverable(expr.start, "Argument name clash"); } - checkClashes[expr.name] = true; -+ Object.defineProperty(checkClashes, expr.name, { value: true, writable: true, enumerable: true, configurable: true }) ++ Object.defineProperty(checkClashes, expr.name, { value: true, writable: true, enumerable: true, configurable: true }); } if (bindingType !== BIND_NONE && bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } break diff --git a/patches/borc+2.1.2.patch b/patches/borc+2.1.2.patch new file mode 100644 index 000000000..91708745c --- /dev/null +++ b/patches/borc+2.1.2.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/borc/src/decoder.asm.js b/node_modules/borc/src/decoder.asm.js +index d77a3c2..dc70f6b 100644 +--- a/node_modules/borc/src/decoder.asm.js ++++ b/node_modules/borc/src/decoder.asm.js +@@ -1,7 +1,7 @@ + /* eslint-disable */ + + module.exports = function decodeAsm (stdlib, foreign, buffer) { +- 'use asm' ++ // 'use asm' //causes v8 to not cache bytecode + + // -- Imports + diff --git a/patches/eslint+7.23.0.patch b/patches/eslint+8.20.0.patch similarity index 77% rename from patches/eslint+7.23.0.patch rename to patches/eslint+8.20.0.patch index 8582fadc6..8474e8c1b 100644 --- a/patches/eslint+7.23.0.patch +++ b/patches/eslint+8.20.0.patch @@ -1,8 +1,8 @@ diff --git a/node_modules/eslint/lib/linter/linter.js b/node_modules/eslint/lib/linter/linter.js -index adb5c21..4a4be92 100644 +index 29d78da..a6ae07b 100644 --- a/node_modules/eslint/lib/linter/linter.js +++ b/node_modules/eslint/lib/linter/linter.js -@@ -560,7 +560,7 @@ function resolveParserOptions(parserName, providedOptions, enabledEnvironments) +@@ -704,7 +704,7 @@ function createLanguageOptions({ globals: configuredGlobals, parser, parserOptio */ function resolveGlobals(providedGlobals, enabledEnvironments) { return Object.assign( diff --git a/patches/eth-sig-util++ethereumjs-util+5.2.1.patch b/patches/eth-sig-util++ethereumjs-util+5.2.1.patch new file mode 100644 index 000000000..b62991dd0 --- /dev/null +++ b/patches/eth-sig-util++ethereumjs-util+5.2.1.patch @@ -0,0 +1,46 @@ +lazy precompute for faster module initialization +diff --git a/node_modules/eth-sig-util/node_modules/ethereumjs-util/dist/secp256k1-adapter.js b/node_modules/eth-sig-util/node_modules/ethereumjs-util/dist/secp256k1-adapter.js +index e4d053a..3098939 100644 +--- a/node_modules/eth-sig-util/node_modules/ethereumjs-util/dist/secp256k1-adapter.js ++++ b/node_modules/eth-sig-util/node_modules/ethereumjs-util/dist/secp256k1-adapter.js +@@ -2,7 +2,7 @@ + + var secp256k1 = require('ethereum-cryptography/secp256k1'); + +-var secp256k1v3 = require('./secp256k1-lib/index'); ++function getSecp256k1 () { return require('./secp256k1-lib/index'); } + var der = require('./secp256k1-lib/der'); + + /** +@@ -28,6 +28,7 @@ var privateKeyVerify = function privateKeyVerify(privateKey) { + * @return {boolean} + */ + var privateKeyExport = function privateKeyExport(privateKey, compressed) { ++ var secp256k1v3 = getSecp256k1(); + // privateKeyExport method is not part of secp256k1 v4 package + // this implementation is based on v3 + if (privateKey.length !== 32) { +@@ -74,6 +75,7 @@ var privateKeyNegate = function privateKeyNegate(privateKey) { + * @return {Buffer} + */ + var privateKeyModInverse = function privateKeyModInverse(privateKey) { ++ var secp256k1v3 = getSecp256k1(); + if (privateKey.length !== 32) { + throw new Error('private key length is invalid'); + } +@@ -217,6 +219,7 @@ var signatureImport = function signatureImport(signature) { + * @return {Buffer} + */ + var signatureImportLax = function signatureImportLax(signature) { ++ var secp256k1v3 = getSecp256k1(); + // signatureImportLax method is not part of secp256k1 v4 package + // this implementation is based on v3 + // ensure that signature is greater than 0 +@@ -340,6 +343,7 @@ var ecdh = function ecdh(publicKey, privateKey) { + * @return {Buffer} + */ + var ecdhUnsafe = function ecdhUnsafe(publicKey, privateKey, compressed) { ++ var secp256k1v3 = getSecp256k1(); + // ecdhUnsafe method is not part of secp256k1 v4 package + // this implementation is based on v3 + // ensure valid publicKey length diff --git a/patches/object.values+1.1.3.patch b/patches/object.values+1.1.5.patch similarity index 100% rename from patches/object.values+1.1.3.patch rename to patches/object.values+1.1.5.patch diff --git a/patches/yargs+17.4.1.patch b/patches/yargs+17.4.1.patch deleted file mode 100644 index 2daf3489c..000000000 --- a/patches/yargs+17.4.1.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff --git a/node_modules/yargs/build/index.cjs b/node_modules/yargs/build/index.cjs -index b36980a..8c50028 100644 ---- a/node_modules/yargs/build/index.cjs -+++ b/node_modules/yargs/build/index.cjs -@@ -1 +1,5 @@ --"use strict";var t=require("assert");class e extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace(this,e)}}let s,i=[];function n(t,o,a,h){s=h;let l={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if("string"!=typeof t.extends)return l;const r=/\.json|\..*rc$/.test(t.extends);let h=null;if(r)h=function(t,e){return s.path.resolve(t,e)}(o,t.extends);else try{h=require.resolve(t.extends)}catch(e){return t}!function(t){if(i.indexOf(t)>-1)throw new e(`Circular extended configurations: '${t}'.`)}(h),i.push(h),l=r?JSON.parse(s.readFileSync(h,"utf8")):require(t.extends),delete t.extends,l=n(l,s.path.dirname(h),a,s)}return i=[],a?r(l,t):Object.assign({},l,t)}function r(t,e){const s={};function i(t){return t&&"object"==typeof t&&!Array.isArray(t)}Object.assign(s,t);for(const n of Object.keys(e))i(e[n])&&i(s[n])?s[n]=r(t[n],e[n]):s[n]=e[n];return s}function o(t){const e=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),s=/\.*[\][<>]/g,i=e.shift();if(!i)throw new Error(`No command found in: ${t}`);const n={cmd:i.replace(s,""),demanded:[],optional:[]};return e.forEach(((t,i)=>{let r=!1;t=t.replace(/\s/g,""),/\.+[\]>]/.test(t)&&i===e.length-1&&(r=!0),/^\[/.test(t)?n.optional.push({cmd:t.replace(s,"").split("|"),variadic:r}):n.demanded.push({cmd:t.replace(s,"").split("|"),variadic:r})})),n}const a=["first","second","third","fourth","fifth","sixth"];function h(t,s,i){try{let n=0;const[r,a,h]="object"==typeof t?[{demanded:[],optional:[]},t,s]:[o(`cmd ${t}`),s,i],f=[].slice.call(a);for(;f.length&&void 0===f[f.length-1];)f.pop();const d=h||f.length;if(du)throw new e(`Too many arguments provided. Expected max ${u} but received ${d}.`);r.demanded.forEach((t=>{const e=l(f.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&c(e,t.cmd,n),n+=1})),r.optional.forEach((t=>{if(0===f.length)return;const e=l(f.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&c(e,t.cmd,n),n+=1}))}catch(t){console.warn(t.stack)}}function l(t){return Array.isArray(t)?"array":null===t?"null":typeof t}function c(t,s,i){throw new e(`Invalid ${a[i]||"manyith"} argument. Expected ${s.join(" or ")} but received ${t}.`)}function f(t){return!!t&&!!t.then&&"function"==typeof t.then}function d(t,e,s,i){s.assert.notStrictEqual(t,e,i)}function u(t,e){e.assert.strictEqual(typeof t,"string")}function p(t){return Object.keys(t)}function g(t={},e=(()=>!0)){const s={};return p(t).forEach((i=>{e(i,t[i])&&(s[i]=t[i])})),s}function m(){return process.versions.electron&&!process.defaultApp?0:1}function y(){return process.argv[m()]}var b=Object.freeze({__proto__:null,hideBin:function(t){return t.slice(m()+1)},getProcessArgvBin:y});function v(t,e,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(t):i?i.value:e.get(t)}function O(t,e,s,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(t,s):n?n.value=s:e.set(t,s),s}class w{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,s=!0,i=!1){if(h(" [boolean] [boolean] [boolean]",[t,e,s],arguments.length),Array.isArray(t)){for(let i=0;i{const i=[...s[e]||[],e];return!t.option||!i.includes(t.option)})),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();void 0!==t&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter((t=>t.global))}}function C(t,e,s,i){return s.reduce(((t,s)=>{if(s.applyBeforeValidation!==i)return t;if(s.mutates){if(s.applied)return t;s.applied=!0}if(f(t))return t.then((t=>Promise.all([t,s(t,e)]))).then((([t,e])=>Object.assign(t,e)));{const i=s(t,e);return f(i)?i.then((e=>Object.assign(t,e))):Object.assign(t,i)}}),t)}function j(t,e,s=(t=>{throw t})){try{const s="function"==typeof t?t():t;return f(s)?s.then((t=>e(t))):e(s)}catch(t){return s(t)}}const _=/(^\*)|(^\$0)/;class M{constructor(t,e,s,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=t,this.globalMiddleware=s,this.validation=e}addDirectory(t,e,s,i){"boolean"!=typeof(i=i||{}).recurse&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);const n="function"==typeof i.visit?i.visit:t=>t;i.visit=(t,e,s)=>{const i=n(t,e,s);if(i){if(this.requireCache.has(e))return i;this.requireCache.add(e),this.addHandler(i)}return i},this.shim.requireDirectory({require:e,filename:s},t,i)}addHandler(t,e,s,i,n,r){let a=[];const h=function(t){return t?t.map((t=>(t.applyBeforeValidation=!1,t))):[]}(n);if(i=i||(()=>{}),Array.isArray(t))if(function(t){return t.every((t=>"string"==typeof t))}(t))[t,...a]=t;else for(const e of t)this.addHandler(e);else{if(function(t){return"object"==typeof t&&!Array.isArray(t)}(t)){let e=Array.isArray(t.command)||"string"==typeof t.command?t.command:this.moduleName(t);return t.aliases&&(e=[].concat(e).concat(t.aliases)),void this.addHandler(e,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated)}if(k(s))return void this.addHandler([t].concat(a),e,s.builder,s.handler,s.middlewares,s.deprecated)}if("string"==typeof t){const n=o(t);a=a.map((t=>o(t).cmd));let l=!1;const c=[n.cmd].concat(a).filter((t=>!_.test(t)||(l=!0,!1)));0===c.length&&l&&c.push("$0"),l&&(n.cmd=c[0],a=c.slice(1),t=t.replace(_,n.cmd)),a.forEach((t=>{this.aliasMap[t]=n.cmd})),!1!==e&&this.usage.command(t,e,l,a,r),this.handlers[n.cmd]={original:t,description:e,handler:i,builder:s||{},middlewares:h,deprecated:r,demanded:n.demanded,optional:n.optional},l&&(this.defaultCommand=this.handlers[n.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,s,i,n,r){const o=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,a=e.getInternalMethods().getContext(),h=a.commands.slice(),l=!t;t&&(a.commands.push(t),a.fullCommands.push(o.original));const c=this.applyBuilderUpdateUsageAndParse(l,o,e,s.aliases,h,i,n,r);return f(c)?c.then((t=>this.applyMiddlewareAndGetResult(l,o,t.innerArgv,a,n,t.aliases,e))):this.applyMiddlewareAndGetResult(l,o,c.innerArgv,a,n,c.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,s,i,n,r,o,a){const h=e.builder;let l=s;if(x(h)){const c=h(s.getInternalMethods().reset(i),a);if(f(c))return c.then((i=>{var a;return l=(a=i)&&"function"==typeof a.getInternalMethods?i:s,this.parseAndUpdateUsage(t,e,l,n,r,o)}))}else(function(t){return"object"==typeof t})(h)&&(l=s.getInternalMethods().reset(i),Object.keys(e.builder).forEach((t=>{l.option(t,h[t])})));return this.parseAndUpdateUsage(t,e,l,n,r,o)}parseAndUpdateUsage(t,e,s,i,n,r){t&&s.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(s)&&s.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,e),e.description);const o=s.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,n,r);return f(o)?o.then((t=>({aliases:s.parsed.aliases,innerArgv:t}))):{aliases:s.parsed.aliases,innerArgv:o}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&0===t.getInternalMethods().getUsageInstance().getUsage().length}usageFromParentCommandsCommandHandler(t,e){const s=_.test(e.original)?e.original.replace(_,"").trim():e.original,i=t.filter((t=>!_.test(t)));return i.push(s),`$0 ${i.join(" ")}`}applyMiddlewareAndGetResult(t,e,s,i,n,r,o){let a={};if(n)return s;o.getInternalMethods().getHasOutput()||(a=this.populatePositionals(e,s,i,o));const h=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares);if(s=C(s,o,h,!0),!o.getInternalMethods().getHasOutput()){const e=o.getInternalMethods().runValidation(r,a,o.parsed.error,t);s=j(s,(t=>(e(t),t)))}if(e.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();const i=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(s,i,!1,!1),s=j(s=C(s,o,h,!1),(t=>{const s=e.handler(t);return f(s)?s.then((()=>t)):t})),t||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),f(s)&&!o.getInternalMethods().hasParseCallback()&&s.catch((t=>{try{o.getInternalMethods().getUsageInstance().fail(null,t)}catch(t){}}))}return t||(i.commands.pop(),i.fullCommands.pop()),s}populatePositionals(t,e,s,i){e._=e._.slice(s.commands.length);const n=t.demanded.slice(0),r=t.optional.slice(0),o={};for(this.validation.positionalCount(n.length,e._.length);n.length;){const t=n.shift();this.populatePositional(t,e,o)}for(;r.length;){const t=r.shift();this.populatePositional(t,e,o)}return e._=s.commands.concat(e._.map((t=>""+t))),this.postProcessPositionals(e,o,this.cmdToParseOptions(t.original),i),o}populatePositional(t,e,s){const i=t.cmd[0];t.variadic?s[i]=e._.splice(0).map(String):e._.length&&(s[i]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},s=o(t);return s.demanded.forEach((t=>{const[s,...i]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=i,e.demand[s]=!0})),s.optional.forEach((t=>{const[s,...i]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=i})),e}postProcessPositionals(t,e,s,i){const n=Object.assign({},i.getOptions());n.default=Object.assign(s.default,n.default);for(const t of Object.keys(s.alias))n.alias[t]=(n.alias[t]||[]).concat(s.alias[t]);n.array=n.array.concat(s.array),n.config={};const r=[];if(Object.keys(e).forEach((t=>{e[t].map((e=>{n.configuration["unknown-options-as-args"]&&(n.key[t]=!0),r.push(`--${t}`),r.push(e)}))})),!r.length)return;const o=Object.assign({},n.configuration,{"populate--":!1}),a=this.shim.Parser.detailed(r,Object.assign({},n,{configuration:o}));if(a.error)i.getInternalMethods().getUsageInstance().fail(a.error.message,a.error);else{const s=Object.keys(e);Object.keys(e).forEach((t=>{s.push(...a.aliases[t])}));const n=i.getOptions().default;Object.keys(a.argv).forEach((i=>{s.includes(i)&&(e[i]||(e[i]=a.argv[i]),!Object.hasOwnProperty.call(n,i)&&Object.hasOwnProperty.call(t,i)&&Object.hasOwnProperty.call(a.argv,i)&&(Array.isArray(t[i])||Array.isArray(a.argv[i]))?t[i]=[].concat(t[i],a.argv[i]):t[i]=a.argv[i])}))}}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const e=_.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(e,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(x(e))return e(t,!0);k(e)||Object.keys(e).forEach((s=>{t.option(s,e[s])}))}moduleName(t){const e=function(t){if("undefined"==typeof require)return null;for(let e,s=0,i=Object.keys(require.cache);s{const s=e;s._handle&&s.isTTY&&"function"==typeof s._handle.setBlocking&&s._handle.setBlocking(t)}))}function A(t){return"boolean"==typeof t}function P(t,s){const i=s.y18n.__,n={},r=[];n.failFn=function(t){r.push(t)};let o=null,a=null,h=!0;n.showHelpOnFail=function(e=!0,s){const[i,r]="string"==typeof e?[!0,e]:[e,s];return t.getInternalMethods().isGlobalContext()&&(a=r),o=r,h=i,n};let l=!1;n.fail=function(s,i){const c=t.getInternalMethods().getLoggerInstance();if(!r.length){if(t.getExitProcess()&&E(!0),!l){l=!0,h&&(t.showHelp("error"),c.error()),(s||i)&&c.error(s||i);const e=o||a;e&&((s||i)&&c.error(""),c.error(e))}if(i=i||new e(s),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,i);throw i}for(let t=r.length-1;t>=0;--t){const e=r[t];if(A(e)){if(i)throw i;if(s)throw Error(s)}else e(s,i,n)}};let c=[],f=!1;n.usage=(t,e)=>null===t?(f=!0,c=[],n):(f=!1,c.push([t,e||""]),n),n.getUsage=()=>c,n.getUsageDisabled=()=>f,n.getPositionalGroupName=()=>i("Positionals:");let d=[];n.example=(t,e)=>{d.push([t,e||""])};let u=[];n.command=function(t,e,s,i,n=!1){s&&(u=u.map((t=>(t[2]=!1,t)))),u.push([t,e||"",s,i,n])},n.getCommands=()=>u;let p={};n.describe=function(t,e){Array.isArray(t)?t.forEach((t=>{n.describe(t,e)})):"object"==typeof t?Object.keys(t).forEach((e=>{n.describe(e,t[e])})):p[t]=e},n.getDescriptions=()=>p;let m=[];n.epilog=t=>{m.push(t)};let y,b=!1;function v(){return b||(y=function(){const t=80;return s.process.stdColumns?Math.min(t,s.process.stdColumns):t}(),b=!0),y}n.wrap=t=>{b=!0,y=t};const O="__yargsString__:";function w(t,e,i){let n=0;return Array.isArray(t)||(t=Object.values(t).map((t=>[t]))),t.forEach((t=>{n=Math.max(s.stringWidth(i?`${i} ${I(t[0])}`:I(t[0]))+$(t[0]),n)})),e&&(n=Math.min(n,parseInt((.5*e).toString(),10))),n}let C;function j(e){return t.getOptions().hiddenOptions.indexOf(e)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function _(t,e){let s=`[${i("default:")} `;if(void 0===t&&!e)return null;if(e)s+=e;else switch(typeof t){case"string":s+=`"${t}"`;break;case"object":s+=JSON.stringify(t);break;default:s+=t}return`${s}]`}n.deferY18nLookup=t=>O+t,n.help=function(){if(C)return C;!function(){const e=t.getDemandedOptions(),s=t.getOptions();(Object.keys(s.alias)||[]).forEach((i=>{s.alias[i].forEach((r=>{p[r]&&n.describe(i,p[r]),r in e&&t.demandOption(i,e[r]),s.boolean.includes(r)&&t.boolean(i),s.count.includes(r)&&t.count(i),s.string.includes(r)&&t.string(i),s.normalize.includes(r)&&t.normalize(i),s.array.includes(r)&&t.array(i),s.number.includes(r)&&t.number(i)}))}))}();const e=t.customScriptName?t.$0:s.path.basename(t.$0),r=t.getDemandedOptions(),o=t.getDemandedCommands(),a=t.getDeprecatedOptions(),h=t.getGroups(),l=t.getOptions();let g=[];g=g.concat(Object.keys(p)),g=g.concat(Object.keys(r)),g=g.concat(Object.keys(o)),g=g.concat(Object.keys(l.default)),g=g.filter(j),g=Object.keys(g.reduce(((t,e)=>("_"!==e&&(t[e]=!0),t)),{}));const y=v(),b=s.cliui({width:y,wrap:!!y});if(!f)if(c.length)c.forEach((t=>{b.div({text:`${t[0].replace(/\$0/g,e)}`}),t[1]&&b.div({text:`${t[1]}`,padding:[1,0,0,0]})})),b.div();else if(u.length){let t=null;t=o._?`${e} <${i("command")}>\n`:`${e} [${i("command")}]\n`,b.div(`${t}`)}if(u.length>1||1===u.length&&!u[0][2]){b.div(i("Commands:"));const s=t.getInternalMethods().getContext(),n=s.commands.length?`${s.commands.join(" ")} `:"";!0===t.getInternalMethods().getParserConfiguration()["sort-commands"]&&(u=u.sort(((t,e)=>t[0].localeCompare(e[0]))));const r=e?`${e} `:"";u.forEach((t=>{const s=`${r}${n}${t[0].replace(/^\$0 ?/,"")}`;b.span({text:s,padding:[0,2,0,2],width:w(u,y,`${e}${n}`)+4},{text:t[1]});const o=[];t[2]&&o.push(`[${i("default")}]`),t[3]&&t[3].length&&o.push(`[${i("aliases:")} ${t[3].join(", ")}]`),t[4]&&("string"==typeof t[4]?o.push(`[${i("deprecated: %s",t[4])}]`):o.push(`[${i("deprecated")}]`)),o.length?b.div({text:o.join(" "),padding:[0,0,0,2],align:"right"}):b.div()})),b.div()}const M=(Object.keys(l.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);g=g.filter((e=>!t.parsed.newAliases[e]&&M.every((t=>-1===(l.alias[t]||[]).indexOf(e)))));const k=i("Options:");h[k]||(h[k]=[]),function(t,e,s,i){let n=[],r=null;Object.keys(s).forEach((t=>{n=n.concat(s[t])})),t.forEach((t=>{r=[t].concat(e[t]),r.some((t=>-1!==n.indexOf(t)))||s[i].push(t)}))}(g,l.alias,h,k);const x=t=>/^--/.test(I(t)),E=Object.keys(h).filter((t=>h[t].length>0)).map((t=>({groupName:t,normalizedKeys:h[t].filter(j).map((t=>{if(M.includes(t))return t;for(let e,s=0;void 0!==(e=M[s]);s++)if((l.alias[e]||[]).includes(t))return e;return t}))}))).filter((({normalizedKeys:t})=>t.length>0)).map((({groupName:t,normalizedKeys:e})=>{const s=e.reduce(((e,s)=>(e[s]=[s].concat(l.alias[s]||[]).map((e=>t===n.getPositionalGroupName()?e:(/^[0-9]$/.test(e)?l.boolean.includes(s)?"-":"--":e.length>1?"--":"-")+e)).sort(((t,e)=>x(t)===x(e)?0:x(t)?1:-1)).join(", "),e)),{});return{groupName:t,normalizedKeys:e,switches:s}}));if(E.filter((({groupName:t})=>t!==n.getPositionalGroupName())).some((({normalizedKeys:t,switches:e})=>!t.every((t=>x(e[t])))))&&E.filter((({groupName:t})=>t!==n.getPositionalGroupName())).forEach((({normalizedKeys:t,switches:e})=>{t.forEach((t=>{var s,i;x(e[t])&&(e[t]=(s=e[t],i="-x, ".length,S(s)?{text:s.text,indentation:s.indentation+i}:{text:s,indentation:i}))}))})),E.forEach((({groupName:t,normalizedKeys:e,switches:s})=>{b.div(t),e.forEach((t=>{const e=s[t];let o=p[t]||"",h=null;o.includes(O)&&(o=i(o.substring(O.length))),l.boolean.includes(t)&&(h=`[${i("boolean")}]`),l.count.includes(t)&&(h=`[${i("count")}]`),l.string.includes(t)&&(h=`[${i("string")}]`),l.normalize.includes(t)&&(h=`[${i("string")}]`),l.array.includes(t)&&(h=`[${i("array")}]`),l.number.includes(t)&&(h=`[${i("number")}]`);const c=[t in a?(f=a[t],"string"==typeof f?`[${i("deprecated: %s",f)}]`:`[${i("deprecated")}]`):null,h,t in r?`[${i("required")}]`:null,l.choices&&l.choices[t]?`[${i("choices:")} ${n.stringifiedValues(l.choices[t])}]`:null,_(l.default[t],l.defaultDescription[t])].filter(Boolean).join(" ");var f;b.span({text:I(e),padding:[0,2,0,2+$(e)],width:w(s,y)+4},o),c?b.div({text:c,padding:[0,0,0,2],align:"right"}):b.div()})),b.div()})),d.length&&(b.div(i("Examples:")),d.forEach((t=>{t[0]=t[0].replace(/\$0/g,e)})),d.forEach((t=>{""===t[1]?b.div({text:t[0],padding:[0,2,0,2]}):b.div({text:t[0],padding:[0,2,0,2],width:w(d,y)+4},{text:t[1]})})),b.div()),m.length>0){const t=m.map((t=>t.replace(/\$0/g,e))).join("\n");b.div(`${t}\n`)}return b.toString().replace(/\s*$/,"")},n.cacheHelpMessage=function(){C=this.help()},n.clearCachedHelpMessage=function(){C=void 0},n.hasCachedHelpMessage=function(){return!!C},n.showHelp=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(n.help())},n.functionDescription=t=>["(",t.name?s.Parser.decamelize(t.name,"-"):i("generated-value"),")"].join(""),n.stringifiedValues=function(t,e){let s="";const i=e||", ",n=[].concat(t);return t&&n.length?(n.forEach((t=>{s.length&&(s+=i),s+=JSON.stringify(t)})),s):s};let M=null;n.version=t=>{M=t},n.showVersion=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(M)},n.reset=function(t){return o=null,l=!1,c=[],f=!1,m=[],d=[],u=[],p=g(p,(e=>!t[e])),n};const k=[];return n.freeze=function(){k.push({failMessage:o,failureOutput:l,usages:c,usageDisabled:f,epilogs:m,examples:d,commands:u,descriptions:p})},n.unfreeze=function(t=!1){const e=k.pop();e&&(t?(p={...e.descriptions,...p},u=[...e.commands,...u],c=[...e.usages,...c],d=[...e.examples,...d],m=[...e.epilogs,...m]):({failMessage:o,failureOutput:l,usages:c,usageDisabled:f,epilogs:m,examples:d,commands:u,descriptions:p}=e))},n}function S(t){return"object"==typeof t}function $(t){return S(t)?t.indentation:0}function I(t){return S(t)?t.text:t}class N{constructor(t,e,s,i){var n,r,o;this.yargs=t,this.usage=e,this.command=s,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=null!==(o=(null===(n=this.shim.getEnv("SHELL"))||void 0===n?void 0:n.includes("zsh"))||(null===(r=this.shim.getEnv("ZSH_NAME"))||void 0===r?void 0:r.includes("zsh")))&&void 0!==o&&o}defaultCompletion(t,e,s,i){const n=this.command.getCommandHandlers();for(let e=0,s=t.length;e{const i=o(s[0]).cmd;if(-1===e.indexOf(i))if(this.zshShell){const e=s[1]||"";t.push(i.replace(/:/g,"\\:")+":"+e)}else t.push(i)}))}optionCompletions(t,e,s,i){if((i.match(/^-/)||""===i&&0===t.length)&&!this.previousArgHasChoices(e)){const n=this.yargs.getOptions(),r=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(n.key).forEach((o=>{const a=!!n.configuration["boolean-negation"]&&n.boolean.includes(o);r.includes(o)||n.hiddenOptions.includes(o)||this.argsContainKey(e,s,o,a)||(this.completeOptionKey(o,t,i),a&&n.default[o]&&this.completeOptionKey(`no-${o}`,t,i))}))}}choicesFromOptionsCompletions(t,e,s,i){if(this.previousArgHasChoices(e)){const s=this.getPreviousArgChoices(e);s&&s.length>0&&t.push(...s.map((t=>t.replace(/:/g,"\\:"))))}}choicesFromPositionalsCompletions(t,e,s,i){if(""===i&&t.length>0&&this.previousArgHasChoices(e))return;const n=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],r=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),o=n[s._.length-r-1];if(!o)return;const a=this.yargs.getOptions().choices[o]||[];for(const e of a)e.startsWith(i)&&t.push(e.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],s="";if(!e.startsWith("-")&&t.length>1&&(s=e,e=t[t.length-2]),!e.startsWith("-"))return;const i=e.replace(/^-+/,""),n=this.yargs.getOptions(),r=[i,...this.yargs.getAliases()[i]||[]];let o;for(const t of r)if(Object.prototype.hasOwnProperty.call(n.key,t)&&Array.isArray(n.choices[t])){o=n.choices[t];break}return o?o.filter((t=>!s||t.startsWith(s))):void 0}previousArgHasChoices(t){const e=this.getPreviousArgChoices(t);return void 0!==e&&e.length>0}argsContainKey(t,e,s,i){if(-1!==t.indexOf(`--${s}`))return!0;if(i&&-1!==t.indexOf(`--no-${s}`))return!0;if(this.aliases)for(const t of this.aliases[s])if(void 0!==e[t])return!0;return!1}completeOptionKey(t,e,s){const i=this.usage.getDescriptions(),n=!/^--/.test(s)&&(t=>/^[^0-9]$/.test(t))(t)?"-":"--";if(this.zshShell){const s=i[t]||"";e.push(n+`${t.replace(/:/g,"\\:")}:${s.replace("__yargsString__:","")}`)}else e.push(n+t)}customCompletion(t,e,s,i){if(d(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){const t=this.customCompletionFunction(s,e);return f(t)?t.then((t=>{this.shim.process.nextTick((()=>{i(null,t)}))})).catch((t=>{this.shim.process.nextTick((()=>{i(t,void 0)}))})):i(null,t)}return function(t){return t.length>3}(this.customCompletionFunction)?this.customCompletionFunction(s,e,((n=i)=>this.defaultCompletion(t,e,s,n)),(t=>{i(null,t)})):this.customCompletionFunction(s,e,(t=>{i(null,t)}))}getCompletion(t,e){const s=t.length?t[t.length-1]:"",i=this.yargs.parse(t,!0),n=this.customCompletionFunction?i=>this.customCompletion(t,i,s,e):i=>this.defaultCompletion(t,i,s,e);return f(i)?i.then(n):n(i)}generateCompletionScript(t,e){let s=this.zshShell?'#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zsh_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$\'\n\' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "${words[@]}"))\n IFS=$si\n _describe \'values\' reply\n}\ncompdef _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n':'###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n';const i=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),s=s.replace(/{{app_name}}/g,i),s=s.replace(/{{completion_command}}/g,e),s.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}}function D(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const s=[];let i,n;for(i=0;i<=e.length;i++)s[i]=[i];for(n=0;n<=t.length;n++)s[0][n]=n;for(i=1;i<=e.length;i++)for(n=1;n<=t.length;n++)e.charAt(i-1)===t.charAt(n-1)?s[i][n]=s[i-1][n-1]:i>1&&n>1&&e.charAt(i-2)===t.charAt(n-1)&&e.charAt(i-1)===t.charAt(n-2)?s[i][n]=s[i-2][n-2]+1:s[i][n]=Math.min(s[i-1][n-1]+1,Math.min(s[i][n-1]+1,s[i-1][n]+1));return s[e.length][t.length]}const H=["$0","--","_"];var z,q,W,F,U,L,V,G,R,T,K,B,Y,J,Z,X,Q,tt,et,st,it,nt,rt,ot,at,ht,lt,ct,ft,dt,ut,pt,gt,mt;const yt=Symbol("copyDoubleDash"),bt=Symbol("copyDoubleDash"),vt=Symbol("deleteFromParserHintObject"),Ot=Symbol("emitWarning"),wt=Symbol("freeze"),Ct=Symbol("getDollarZero"),jt=Symbol("getParserConfiguration"),_t=Symbol("guessLocale"),Mt=Symbol("guessVersion"),kt=Symbol("parsePositionalNumbers"),xt=Symbol("pkgUp"),Et=Symbol("populateParserHintArray"),At=Symbol("populateParserHintSingleValueDictionary"),Pt=Symbol("populateParserHintArrayDictionary"),St=Symbol("populateParserHintDictionary"),$t=Symbol("sanitizeKey"),It=Symbol("setKey"),Nt=Symbol("unfreeze"),Dt=Symbol("validateAsync"),Ht=Symbol("getCommandInstance"),zt=Symbol("getContext"),qt=Symbol("getHasOutput"),Wt=Symbol("getLoggerInstance"),Ft=Symbol("getParseContext"),Ut=Symbol("getUsageInstance"),Lt=Symbol("getValidationInstance"),Vt=Symbol("hasParseCallback"),Gt=Symbol("isGlobalContext"),Rt=Symbol("postProcess"),Tt=Symbol("rebase"),Kt=Symbol("reset"),Bt=Symbol("runYargsParserAndExecuteCommands"),Yt=Symbol("runValidation"),Jt=Symbol("setHasOutput"),Zt=Symbol("kTrackManuallySetKeys");class Xt{constructor(t=[],e,s,i){this.customScriptName=!1,this.parsed=!1,z.set(this,void 0),q.set(this,void 0),W.set(this,{commands:[],fullCommands:[]}),F.set(this,null),U.set(this,null),L.set(this,"show-hidden"),V.set(this,null),G.set(this,!0),R.set(this,{}),T.set(this,!0),K.set(this,[]),B.set(this,void 0),Y.set(this,{}),J.set(this,!1),Z.set(this,null),X.set(this,!0),Q.set(this,void 0),tt.set(this,""),et.set(this,void 0),st.set(this,void 0),it.set(this,{}),nt.set(this,null),rt.set(this,null),ot.set(this,{}),at.set(this,{}),ht.set(this,void 0),lt.set(this,!1),ct.set(this,void 0),ft.set(this,!1),dt.set(this,!1),ut.set(this,!1),pt.set(this,void 0),gt.set(this,null),mt.set(this,void 0),O(this,ct,i,"f"),O(this,ht,t,"f"),O(this,q,e,"f"),O(this,st,s,"f"),O(this,B,new w(this),"f"),this.$0=this[Ct](),this[Kt](),O(this,z,v(this,z,"f"),"f"),O(this,pt,v(this,pt,"f"),"f"),O(this,mt,v(this,mt,"f"),"f"),O(this,et,v(this,et,"f"),"f"),v(this,et,"f").showHiddenOpt=v(this,L,"f"),O(this,Q,this[bt](),"f")}addHelpOpt(t,e){return h("[string|boolean] [string]",[t,e],arguments.length),v(this,Z,"f")&&(this[vt](v(this,Z,"f")),O(this,Z,null,"f")),!1===t&&void 0===e||(O(this,Z,"string"==typeof t?t:"help","f"),this.boolean(v(this,Z,"f")),this.describe(v(this,Z,"f"),e||v(this,pt,"f").deferY18nLookup("Show help"))),this}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(h("[string|boolean] [string]",[t,e],arguments.length),!1===t&&void 0===e)return this;const s="string"==typeof t?t:v(this,L,"f");return this.boolean(s),this.describe(s,e||v(this,pt,"f").deferY18nLookup("Show hidden options")),v(this,et,"f").showHiddenOpt=s,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return h(" [string|array]",[t,e],arguments.length),this[Pt](this.alias.bind(this),"alias",t,e),this}array(t){return h("",[t],arguments.length),this[Et]("array",t),this[Zt](t),this}boolean(t){return h("",[t],arguments.length),this[Et]("boolean",t),this[Zt](t),this}check(t,e){return h(" [boolean]",[t,e],arguments.length),this.middleware(((e,s)=>j((()=>t(e,s.getOptions())),(s=>(s?("string"==typeof s||s instanceof Error)&&v(this,pt,"f").fail(s.toString(),s):v(this,pt,"f").fail(v(this,ct,"f").y18n.__("Argument check failed: %s",t.toString())),e)),(t=>(v(this,pt,"f").fail(t.message?t.message:t.toString(),t),e)))),!1,e),this}choices(t,e){return h(" [string|array]",[t,e],arguments.length),this[Pt](this.choices.bind(this),"choices",t,e),this}coerce(t,s){if(h(" [function]",[t,s],arguments.length),Array.isArray(t)){if(!s)throw new e("coerce callback must be provided");for(const e of t)this.coerce(e,s);return this}if("object"==typeof t){for(const e of Object.keys(t))this.coerce(e,t[e]);return this}if(!s)throw new e("coerce callback must be provided");return v(this,et,"f").key[t]=!0,v(this,B,"f").addCoerceMiddleware(((i,n)=>{let r;return Object.hasOwnProperty.call(i,t)?j((()=>(r=n.getAliases(),s(i[t]))),(e=>{i[t]=e;const s=n.getInternalMethods().getParserConfiguration()["strip-aliased"];if(r[t]&&!0!==s)for(const s of r[t])i[s]=e;return i}),(t=>{throw new e(t.message)})):i}),t),this}conflicts(t,e){return h(" [string|array]",[t,e],arguments.length),v(this,mt,"f").conflicts(t,e),this}config(t="config",e,s){return h("[object|string] [string|function] [function]",[t,e,s],arguments.length),"object"!=typeof t||Array.isArray(t)?("function"==typeof e&&(s=e,e=void 0),this.describe(t,e||v(this,pt,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach((t=>{v(this,et,"f").config[t]=s||!0})),this):(t=n(t,v(this,q,"f"),this[jt]()["deep-merge-config"]||!1,v(this,ct,"f")),v(this,et,"f").configObjects=(v(this,et,"f").configObjects||[]).concat(t),this)}completion(t,e,s){return h("[string] [string|boolean|function] [function]",[t,e,s],arguments.length),"function"==typeof e&&(s=e,e=void 0),O(this,U,t||v(this,U,"f")||"completion","f"),e||!1===e||(e="generate completion script"),this.command(v(this,U,"f"),e),s&&v(this,F,"f").registerFunction(s),this}command(t,e,s,i,n,r){return h(" [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,s,i,n,r],arguments.length),v(this,z,"f").addHandler(t,e,s,i,n,r),this}commands(t,e,s,i,n,r){return this.command(t,e,s,i,n,r)}commandDir(t,e){h(" [object]",[t,e],arguments.length);const s=v(this,st,"f")||v(this,ct,"f").require;return v(this,z,"f").addDirectory(t,s,v(this,ct,"f").getCallerFile(),e),this}count(t){return h("",[t],arguments.length),this[Et]("count",t),this[Zt](t),this}default(t,e,s){return h(" [*] [string]",[t,e,s],arguments.length),s&&(u(t,v(this,ct,"f")),v(this,et,"f").defaultDescription[t]=s),"function"==typeof e&&(u(t,v(this,ct,"f")),v(this,et,"f").defaultDescription[t]||(v(this,et,"f").defaultDescription[t]=v(this,pt,"f").functionDescription(e)),e=e.call()),this[At](this.default.bind(this),"default",t,e),this}defaults(t,e,s){return this.default(t,e,s)}demandCommand(t=1,e,s,i){return h("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,s,i],arguments.length),"number"!=typeof e&&(s=e,e=1/0),this.global("_",!1),v(this,et,"f").demandedCommands._={min:t,max:e,minMsg:s,maxMsg:i},this}demand(t,e,s){return Array.isArray(e)?(e.forEach((t=>{d(s,!0,v(this,ct,"f")),this.demandOption(t,s)})),e=1/0):"number"!=typeof e&&(s=e,e=1/0),"number"==typeof t?(d(s,!0,v(this,ct,"f")),this.demandCommand(t,e,s,s)):Array.isArray(t)?t.forEach((t=>{d(s,!0,v(this,ct,"f")),this.demandOption(t,s)})):"string"==typeof s?this.demandOption(t,s):!0!==s&&void 0!==s||this.demandOption(t),this}demandOption(t,e){return h(" [string]",[t,e],arguments.length),this[At](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return h(" [string|boolean]",[t,e],arguments.length),v(this,et,"f").deprecatedOptions[t]=e,this}describe(t,e){return h(" [string]",[t,e],arguments.length),this[It](t,!0),v(this,pt,"f").describe(t,e),this}detectLocale(t){return h("",[t],arguments.length),O(this,G,t,"f"),this}env(t){return h("[string|boolean]",[t],arguments.length),!1===t?delete v(this,et,"f").envPrefix:v(this,et,"f").envPrefix=t||"",this}epilogue(t){return h("",[t],arguments.length),v(this,pt,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return h(" [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach((t=>this.example(...t))):v(this,pt,"f").example(t,e),this}exit(t,e){O(this,J,!0,"f"),O(this,V,e,"f"),v(this,T,"f")&&v(this,ct,"f").process.exit(t)}exitProcess(t=!0){return h("[boolean]",[t],arguments.length),O(this,T,t,"f"),this}fail(t){if(h("",[t],arguments.length),"boolean"==typeof t&&!1!==t)throw new e("Invalid first argument. Expected function or boolean 'false'");return v(this,pt,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return h(" [function]",[t,e],arguments.length),e?v(this,F,"f").getCompletion(t,e):new Promise(((e,s)=>{v(this,F,"f").getCompletion(t,((t,i)=>{t?s(t):e(i)}))}))}getDemandedOptions(){return h([],0),v(this,et,"f").demandedOptions}getDemandedCommands(){return h([],0),v(this,et,"f").demandedCommands}getDeprecatedOptions(){return h([],0),v(this,et,"f").deprecatedOptions}getDetectLocale(){return v(this,G,"f")}getExitProcess(){return v(this,T,"f")}getGroups(){return Object.assign({},v(this,Y,"f"),v(this,at,"f"))}getHelp(){if(O(this,J,!0,"f"),!v(this,pt,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[Bt](v(this,ht,"f"),void 0,void 0,0,!0);if(f(t))return t.then((()=>v(this,pt,"f").help()))}const t=v(this,z,"f").runDefaultBuilderOn(this);if(f(t))return t.then((()=>v(this,pt,"f").help()))}return Promise.resolve(v(this,pt,"f").help())}getOptions(){return v(this,et,"f")}getStrict(){return v(this,ft,"f")}getStrictCommands(){return v(this,dt,"f")}getStrictOptions(){return v(this,ut,"f")}global(t,e){return h(" [boolean]",[t,e],arguments.length),t=[].concat(t),!1!==e?v(this,et,"f").local=v(this,et,"f").local.filter((e=>-1===t.indexOf(e))):t.forEach((t=>{v(this,et,"f").local.includes(t)||v(this,et,"f").local.push(t)})),this}group(t,e){h(" ",[t,e],arguments.length);const s=v(this,at,"f")[e]||v(this,Y,"f")[e];v(this,at,"f")[e]&&delete v(this,at,"f")[e];const i={};return v(this,Y,"f")[e]=(s||[]).concat(t).filter((t=>!i[t]&&(i[t]=!0))),this}hide(t){return h("",[t],arguments.length),v(this,et,"f").hiddenOptions.push(t),this}implies(t,e){return h(" [number|string|array]",[t,e],arguments.length),v(this,mt,"f").implies(t,e),this}locale(t){return h("[string]",[t],arguments.length),t?(O(this,G,!1,"f"),v(this,ct,"f").y18n.setLocale(t),this):(this[_t](),v(this,ct,"f").y18n.getLocale())}middleware(t,e,s){return v(this,B,"f").addMiddleware(t,!!e,s)}nargs(t,e){return h(" [number]",[t,e],arguments.length),this[At](this.nargs.bind(this),"narg",t,e),this}normalize(t){return h("",[t],arguments.length),this[Et]("normalize",t),this}number(t){return h("",[t],arguments.length),this[Et]("number",t),this[Zt](t),this}option(t,e){if(h(" [object]",[t,e],arguments.length),"object"==typeof t)Object.keys(t).forEach((e=>{this.options(e,t[e])}));else{"object"!=typeof e&&(e={}),this[Zt](t),!v(this,gt,"f")||"version"!==t&&"version"!==(null==e?void 0:e.alias)||this[Ot](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join("\n"),void 0,"versionWarning"),v(this,et,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);const s=e.deprecate||e.deprecated;s&&this.deprecateOption(t,s);const i=e.demand||e.required||e.require;i&&this.demand(t,i),e.demandOption&&this.demandOption(t,"string"==typeof e.demandOption?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),void 0!==e.implies&&this.implies(t,e.implies),void 0!==e.nargs&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||"boolean"===e.type)&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||"array"===e.type)&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||"number"===e.type)&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||"string"===e.type)&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||"count"===e.type)&&this.count(t),"boolean"==typeof e.global&&this.global(t,e.global),e.defaultDescription&&(v(this,et,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);const n=e.describe||e.description||e.desc;this.describe(t,n),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,s){h("[string|array] [function|boolean|object] [function]",[t,e,s],arguments.length),this[wt](),void 0===t&&(t=v(this,ht,"f")),"object"==typeof e&&(O(this,rt,e,"f"),e=s),"function"==typeof e&&(O(this,nt,e,"f"),e=!1),e||O(this,ht,t,"f"),v(this,nt,"f")&&O(this,T,!1,"f");const i=this[Bt](t,!!e),n=this.parsed;return v(this,F,"f").setParsed(this.parsed),f(i)?i.then((t=>(v(this,nt,"f")&&v(this,nt,"f").call(this,v(this,V,"f"),t,v(this,tt,"f")),t))).catch((t=>{throw v(this,nt,"f")&&v(this,nt,"f")(t,this.parsed.argv,v(this,tt,"f")),t})).finally((()=>{this[Nt](),this.parsed=n})):(v(this,nt,"f")&&v(this,nt,"f").call(this,v(this,V,"f"),i,v(this,tt,"f")),this[Nt](),this.parsed=n,i)}parseAsync(t,e,s){const i=this.parse(t,e,s);return f(i)?i:Promise.resolve(i)}parseSync(t,s,i){const n=this.parse(t,s,i);if(f(n))throw new e(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return n}parserConfiguration(t){return h("",[t],arguments.length),O(this,it,t,"f"),this}pkgConf(t,e){h(" [string]",[t,e],arguments.length);let s=null;const i=this[xt](e||v(this,q,"f"));return i[t]&&"object"==typeof i[t]&&(s=n(i[t],e||v(this,q,"f"),this[jt]()["deep-merge-config"]||!1,v(this,ct,"f")),v(this,et,"f").configObjects=(v(this,et,"f").configObjects||[]).concat(s)),this}positional(t,e){h(" ",[t,e],arguments.length);const s=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=g(e,((t,e)=>!("type"===t&&!["string","number","boolean"].includes(e))&&s.includes(t)));const i=v(this,W,"f").fullCommands[v(this,W,"f").fullCommands.length-1],n=i?v(this,z,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return p(n).forEach((s=>{const i=n[s];Array.isArray(i)?-1!==i.indexOf(t)&&(e[s]=!0):i[t]&&!(s in e)&&(e[s]=i[t])})),this.group(t,v(this,pt,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return h("[boolean]",[t],arguments.length),O(this,lt,t,"f"),this}required(t,e,s){return this.demand(t,e,s)}require(t,e,s){return this.demand(t,e,s)}requiresArg(t){return h(" [number]",[t],arguments.length),"string"==typeof t&&v(this,et,"f").narg[t]||this[At](this.requiresArg.bind(this),"narg",t,NaN),this}showCompletionScript(t,e){return h("[string] [string]",[t,e],arguments.length),t=t||this.$0,v(this,Q,"f").log(v(this,F,"f").generateCompletionScript(t,e||v(this,U,"f")||"completion")),this}showHelp(t){if(h("[string|function]",[t],arguments.length),O(this,J,!0,"f"),!v(this,pt,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[Bt](v(this,ht,"f"),void 0,void 0,0,!0);if(f(e))return e.then((()=>{v(this,pt,"f").showHelp(t)})),this}const e=v(this,z,"f").runDefaultBuilderOn(this);if(f(e))return e.then((()=>{v(this,pt,"f").showHelp(t)})),this}return v(this,pt,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return h("[boolean|string] [string]",[t,e],arguments.length),v(this,pt,"f").showHelpOnFail(t,e),this}showVersion(t){return h("[string|function]",[t],arguments.length),v(this,pt,"f").showVersion(t),this}skipValidation(t){return h("",[t],arguments.length),this[Et]("skipValidation",t),this}strict(t){return h("[boolean]",[t],arguments.length),O(this,ft,!1!==t,"f"),this}strictCommands(t){return h("[boolean]",[t],arguments.length),O(this,dt,!1!==t,"f"),this}strictOptions(t){return h("[boolean]",[t],arguments.length),O(this,ut,!1!==t,"f"),this}string(t){return h("",[t],arguments.length),this[Et]("string",t),this[Zt](t),this}terminalWidth(){return h([],0),v(this,ct,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return h("",[t],arguments.length),O(this,G,!1,"f"),v(this,ct,"f").y18n.updateLocale(t),this}usage(t,s,i,n){if(h(" [string|boolean] [function|object] [function]",[t,s,i,n],arguments.length),void 0!==s){if(d(t,null,v(this,ct,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,s,i,n);throw new e(".usage() description must start with $0 if being used as alias for .command()")}return v(this,pt,"f").usage(t),this}version(t,e,s){const i="version";if(h("[boolean|string] [string] [string]",[t,e,s],arguments.length),v(this,gt,"f")&&(this[vt](v(this,gt,"f")),v(this,pt,"f").version(void 0),O(this,gt,null,"f")),0===arguments.length)s=this[Mt](),t=i;else if(1===arguments.length){if(!1===t)return this;s=t,t=i}else 2===arguments.length&&(s=e,e=void 0);return O(this,gt,"string"==typeof t?t:i,"f"),e=e||v(this,pt,"f").deferY18nLookup("Show version number"),v(this,pt,"f").version(s||void 0),this.boolean(v(this,gt,"f")),this.describe(v(this,gt,"f"),e),this}wrap(t){return h("",[t],arguments.length),v(this,pt,"f").wrap(t),this}[(z=new WeakMap,q=new WeakMap,W=new WeakMap,F=new WeakMap,U=new WeakMap,L=new WeakMap,V=new WeakMap,G=new WeakMap,R=new WeakMap,T=new WeakMap,K=new WeakMap,B=new WeakMap,Y=new WeakMap,J=new WeakMap,Z=new WeakMap,X=new WeakMap,Q=new WeakMap,tt=new WeakMap,et=new WeakMap,st=new WeakMap,it=new WeakMap,nt=new WeakMap,rt=new WeakMap,ot=new WeakMap,at=new WeakMap,ht=new WeakMap,lt=new WeakMap,ct=new WeakMap,ft=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,gt=new WeakMap,mt=new WeakMap,yt)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(t){}return t}[bt](){return{log:(...t)=>{this[Vt]()||console.log(...t),O(this,J,!0,"f"),v(this,tt,"f").length&&O(this,tt,v(this,tt,"f")+"\n","f"),O(this,tt,v(this,tt,"f")+t.join(" "),"f")},error:(...t)=>{this[Vt]()||console.error(...t),O(this,J,!0,"f"),v(this,tt,"f").length&&O(this,tt,v(this,tt,"f")+"\n","f"),O(this,tt,v(this,tt,"f")+t.join(" "),"f")}}}[vt](t){p(v(this,et,"f")).forEach((e=>{if("configObjects"===e)return;const s=v(this,et,"f")[e];Array.isArray(s)?s.includes(t)&&s.splice(s.indexOf(t),1):"object"==typeof s&&delete s[t]})),delete v(this,pt,"f").getDescriptions()[t]}[Ot](t,e,s){v(this,R,"f")[s]||(v(this,ct,"f").process.emitWarning(t,e),v(this,R,"f")[s]=!0)}[wt](){v(this,K,"f").push({options:v(this,et,"f"),configObjects:v(this,et,"f").configObjects.slice(0),exitProcess:v(this,T,"f"),groups:v(this,Y,"f"),strict:v(this,ft,"f"),strictCommands:v(this,dt,"f"),strictOptions:v(this,ut,"f"),completionCommand:v(this,U,"f"),output:v(this,tt,"f"),exitError:v(this,V,"f"),hasOutput:v(this,J,"f"),parsed:this.parsed,parseFn:v(this,nt,"f"),parseContext:v(this,rt,"f")}),v(this,pt,"f").freeze(),v(this,mt,"f").freeze(),v(this,z,"f").freeze(),v(this,B,"f").freeze()}[Ct](){let t,e="";return t=/\b(node|iojs|electron)(\.exe)?$/.test(v(this,ct,"f").process.argv()[0])?v(this,ct,"f").process.argv().slice(1,2):v(this,ct,"f").process.argv().slice(0,1),e=t.map((t=>{const e=this[Tt](v(this,q,"f"),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&e.lengthe.includes("package.json")?"package.json":void 0));d(i,void 0,v(this,ct,"f")),s=JSON.parse(v(this,ct,"f").readFileSync(i,"utf8"))}catch(t){}return v(this,ot,"f")[e]=s||{},v(this,ot,"f")[e]}[Et](t,e){(e=[].concat(e)).forEach((e=>{e=this[$t](e),v(this,et,"f")[t].push(e)}))}[At](t,e,s,i){this[St](t,e,s,i,((t,e,s)=>{v(this,et,"f")[t][e]=s}))}[Pt](t,e,s,i){this[St](t,e,s,i,((t,e,s)=>{v(this,et,"f")[t][e]=(v(this,et,"f")[t][e]||[]).concat(s)}))}[St](t,e,s,i,n){if(Array.isArray(s))s.forEach((e=>{t(e,i)}));else if((t=>"object"==typeof t)(s))for(const e of p(s))t(e,s[e]);else n(e,this[$t](s),i)}[$t](t){return"__proto__"===t?"___proto___":t}[It](t,e){return this[At](this[It].bind(this),"key",t,e),this}[Nt](){var t,e,s,i,n,r,o,a,h,l,c,f;const u=v(this,K,"f").pop();let p;d(u,void 0,v(this,ct,"f")),t=this,e=this,s=this,i=this,n=this,r=this,o=this,a=this,h=this,l=this,c=this,f=this,({options:{set value(e){O(t,et,e,"f")}}.value,configObjects:p,exitProcess:{set value(t){O(e,T,t,"f")}}.value,groups:{set value(t){O(s,Y,t,"f")}}.value,output:{set value(t){O(i,tt,t,"f")}}.value,exitError:{set value(t){O(n,V,t,"f")}}.value,hasOutput:{set value(t){O(r,J,t,"f")}}.value,parsed:this.parsed,strict:{set value(t){O(o,ft,t,"f")}}.value,strictCommands:{set value(t){O(a,dt,t,"f")}}.value,strictOptions:{set value(t){O(h,ut,t,"f")}}.value,completionCommand:{set value(t){O(l,U,t,"f")}}.value,parseFn:{set value(t){O(c,nt,t,"f")}}.value,parseContext:{set value(t){O(f,rt,t,"f")}}.value}=u),v(this,et,"f").configObjects=p,v(this,pt,"f").unfreeze(),v(this,mt,"f").unfreeze(),v(this,z,"f").unfreeze(),v(this,B,"f").unfreeze()}[Dt](t,e){return j(e,(e=>(t(e),e)))}getInternalMethods(){return{getCommandInstance:this[Ht].bind(this),getContext:this[zt].bind(this),getHasOutput:this[qt].bind(this),getLoggerInstance:this[Wt].bind(this),getParseContext:this[Ft].bind(this),getParserConfiguration:this[jt].bind(this),getUsageInstance:this[Ut].bind(this),getValidationInstance:this[Lt].bind(this),hasParseCallback:this[Vt].bind(this),isGlobalContext:this[Gt].bind(this),postProcess:this[Rt].bind(this),reset:this[Kt].bind(this),runValidation:this[Yt].bind(this),runYargsParserAndExecuteCommands:this[Bt].bind(this),setHasOutput:this[Jt].bind(this)}}[Ht](){return v(this,z,"f")}[zt](){return v(this,W,"f")}[qt](){return v(this,J,"f")}[Wt](){return v(this,Q,"f")}[Ft](){return v(this,rt,"f")||{}}[Ut](){return v(this,pt,"f")}[Lt](){return v(this,mt,"f")}[Vt](){return!!v(this,nt,"f")}[Gt](){return v(this,X,"f")}[Rt](t,e,s,i){if(s)return t;if(f(t))return t;e||(t=this[yt](t));return(this[jt]()["parse-positional-numbers"]||void 0===this[jt]()["parse-positional-numbers"])&&(t=this[kt](t)),i&&(t=C(t,this,v(this,B,"f").getMiddleware(),!1)),t}[Kt](t={}){O(this,et,v(this,et,"f")||{},"f");const e={};e.local=v(this,et,"f").local||[],e.configObjects=v(this,et,"f").configObjects||[];const s={};e.local.forEach((e=>{s[e]=!0,(t[e]||[]).forEach((t=>{s[t]=!0}))})),Object.assign(v(this,at,"f"),Object.keys(v(this,Y,"f")).reduce(((t,e)=>{const i=v(this,Y,"f")[e].filter((t=>!(t in s)));return i.length>0&&(t[e]=i),t}),{})),O(this,Y,{},"f");return["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach((t=>{e[t]=(v(this,et,"f")[t]||[]).filter((t=>!s[t]))})),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach((t=>{e[t]=g(v(this,et,"f")[t],(t=>!s[t]))})),e.envPrefix=v(this,et,"f").envPrefix,O(this,et,e,"f"),O(this,pt,v(this,pt,"f")?v(this,pt,"f").reset(s):P(this,v(this,ct,"f")),"f"),O(this,mt,v(this,mt,"f")?v(this,mt,"f").reset(s):function(t,e,s){const i=s.y18n.__,n=s.y18n.__n,r={nonOptionCount:function(s){const i=t.getDemandedCommands(),r=s._.length+(s["--"]?s["--"].length:0)-t.getInternalMethods().getContext().commands.length;i._&&(ri._.max)&&(ri._.max&&(void 0!==i._.maxMsg?e.fail(i._.maxMsg?i._.maxMsg.replace(/\$0/g,r.toString()).replace(/\$1/,i._.max.toString()):null):e.fail(n("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",r,r.toString(),i._.max.toString()))))},positionalCount:function(t,s){s{H.includes(e)||Object.prototype.hasOwnProperty.call(o,e)||Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),e)||r.isValidAndSomeAliasIsNotNew(e,i)||f.push(e)})),h&&(d.commands.length>0||c.length>0||a)&&s._.slice(d.commands.length).forEach((t=>{c.includes(""+t)||f.push(""+t)})),h){const e=(null===(l=t.getDemandedCommands()._)||void 0===l?void 0:l.max)||0,i=d.commands.length+e;i{t=String(t),d.commands.includes(t)||f.includes(t)||f.push(t)}))}f.length&&e.fail(n("Unknown argument: %s","Unknown arguments: %s",f.length,f.map((t=>t.trim()?t:`"${t}"`)).join(", ")))},unknownCommands:function(s){const i=t.getInternalMethods().getCommandInstance().getCommands(),r=[],o=t.getInternalMethods().getContext();return(o.commands.length>0||i.length>0)&&s._.slice(o.commands.length).forEach((t=>{i.includes(""+t)||r.push(""+t)})),r.length>0&&(e.fail(n("Unknown command: %s","Unknown commands: %s",r.length,r.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(e,s){if(!Object.prototype.hasOwnProperty.call(s,e))return!1;const i=t.parsed.newAliases;return[e,...s[e]].some((t=>!Object.prototype.hasOwnProperty.call(i,t)||!i[e]))},limitedChoices:function(s){const n=t.getOptions(),r={};if(!Object.keys(n.choices).length)return;Object.keys(s).forEach((t=>{-1===H.indexOf(t)&&Object.prototype.hasOwnProperty.call(n.choices,t)&&[].concat(s[t]).forEach((e=>{-1===n.choices[t].indexOf(e)&&void 0!==e&&(r[t]=(r[t]||[]).concat(e))}))}));const o=Object.keys(r);if(!o.length)return;let a=i("Invalid values:");o.forEach((t=>{a+=`\n ${i("Argument: %s, Given: %s, Choices: %s",t,e.stringifiedValues(r[t]),e.stringifiedValues(n.choices[t]))}`})),e.fail(a)}};let o={};function a(t,e){const s=Number(e);return"number"==typeof(e=isNaN(s)?e:s)?e=t._.length>=e:e.match(/^--no-.+/)?(e=e.match(/^--no-(.+)/)[1],e=!Object.prototype.hasOwnProperty.call(t,e)):e=Object.prototype.hasOwnProperty.call(t,e),e}r.implies=function(e,i){h(" [array|number|string]",[e,i],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.implies(t,e[t])})):(t.global(e),o[e]||(o[e]=[]),Array.isArray(i)?i.forEach((t=>r.implies(e,t))):(d(i,void 0,s),o[e].push(i)))},r.getImplied=function(){return o},r.implications=function(t){const s=[];if(Object.keys(o).forEach((e=>{const i=e;(o[e]||[]).forEach((e=>{let n=i;const r=e;n=a(t,n),e=a(t,e),n&&!e&&s.push(` ${i} -> ${r}`)}))})),s.length){let t=`${i("Implications failed:")}\n`;s.forEach((e=>{t+=e})),e.fail(t)}};let l={};r.conflicts=function(e,s){h(" [array|string]",[e,s],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.conflicts(t,e[t])})):(t.global(e),l[e]||(l[e]=[]),Array.isArray(s)?s.forEach((t=>r.conflicts(e,t))):l[e].push(s))},r.getConflicting=()=>l,r.conflicting=function(n){Object.keys(n).forEach((t=>{l[t]&&l[t].forEach((s=>{s&&void 0!==n[t]&&void 0!==n[s]&&e.fail(i("Arguments %s and %s are mutually exclusive",t,s))}))})),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach((t=>{l[t].forEach((r=>{r&&void 0!==n[s.Parser.camelCase(t)]&&void 0!==n[s.Parser.camelCase(r)]&&e.fail(i("Arguments %s and %s are mutually exclusive",t,r))}))}))},r.recommendCommands=function(t,s){s=s.sort(((t,e)=>e.length-t.length));let n=null,r=1/0;for(let e,i=0;void 0!==(e=s[i]);i++){const s=D(t,e);s<=3&&s!t[e])),l=g(l,(e=>!t[e])),r};const c=[];return r.freeze=function(){c.push({implied:o,conflicting:l})},r.unfreeze=function(){const t=c.pop();d(t,void 0,s),({implied:o,conflicting:l}=t)},r}(this,v(this,pt,"f"),v(this,ct,"f")),"f"),O(this,z,v(this,z,"f")?v(this,z,"f").reset():function(t,e,s,i){return new M(t,e,s,i)}(v(this,pt,"f"),v(this,mt,"f"),v(this,B,"f"),v(this,ct,"f")),"f"),v(this,F,"f")||O(this,F,function(t,e,s,i){return new N(t,e,s,i)}(this,v(this,pt,"f"),v(this,z,"f"),v(this,ct,"f")),"f"),v(this,B,"f").reset(),O(this,U,null,"f"),O(this,tt,"","f"),O(this,V,null,"f"),O(this,J,!1,"f"),this.parsed=!1,this}[Tt](t,e){return v(this,ct,"f").path.relative(t,e)}[Bt](t,s,i,n=0,r=!1){let o=!!i||r;t=t||v(this,ht,"f"),v(this,et,"f").__=v(this,ct,"f").y18n.__,v(this,et,"f").configuration=this[jt]();const a=!!v(this,et,"f").configuration["populate--"],h=Object.assign({},v(this,et,"f").configuration,{"populate--":!0}),l=v(this,ct,"f").Parser.detailed(t,Object.assign({},v(this,et,"f"),{configuration:{"parse-positional-numbers":!1,...h}})),c=Object.assign(l.argv,v(this,rt,"f"));let d;const u=l.aliases;let p=!1,g=!1;Object.keys(c).forEach((t=>{t===v(this,Z,"f")&&c[t]?p=!0:t===v(this,gt,"f")&&c[t]&&(g=!0)})),c.$0=this.$0,this.parsed=l,0===n&&v(this,pt,"f").clearCachedHelpMessage();try{if(this[_t](),s)return this[Rt](c,a,!!i,!1);if(v(this,Z,"f")){[v(this,Z,"f")].concat(u[v(this,Z,"f")]||[]).filter((t=>t.length>1)).includes(""+c._[c._.length-1])&&(c._.pop(),p=!0)}O(this,X,!1,"f");const h=v(this,z,"f").getCommands(),m=v(this,F,"f").completionKey in c,y=p||m||r;if(c._.length){if(h.length){let t;for(let e,s=n||0;void 0!==c._[s];s++){if(e=String(c._[s]),h.includes(e)&&e!==v(this,U,"f")){const t=v(this,z,"f").runCommand(e,this,l,s+1,r,p||g||r);return this[Rt](t,a,!!i,!1)}if(!t&&e!==v(this,U,"f")){t=e;break}}!v(this,z,"f").hasDefaultCommand()&&v(this,lt,"f")&&t&&!y&&v(this,mt,"f").recommendCommands(t,h)}v(this,U,"f")&&c._.includes(v(this,U,"f"))&&!m&&(v(this,T,"f")&&E(!0),this.showCompletionScript(),this.exit(0))}if(v(this,z,"f").hasDefaultCommand()&&!y){const t=v(this,z,"f").runCommand(null,this,l,0,r,p||g||r);return this[Rt](t,a,!!i,!1)}if(m){v(this,T,"f")&&E(!0);const s=(t=[].concat(t)).slice(t.indexOf(`--${v(this,F,"f").completionKey}`)+1);return v(this,F,"f").getCompletion(s,((t,s)=>{if(t)throw new e(t.message);(s||[]).forEach((t=>{v(this,Q,"f").log(t)})),this.exit(0)})),this[Rt](c,!a,!!i,!1)}if(v(this,J,"f")||(p?(v(this,T,"f")&&E(!0),o=!0,this.showHelp("log"),this.exit(0)):g&&(v(this,T,"f")&&E(!0),o=!0,v(this,pt,"f").showVersion("log"),this.exit(0))),!o&&v(this,et,"f").skipValidation.length>0&&(o=Object.keys(c).some((t=>v(this,et,"f").skipValidation.indexOf(t)>=0&&!0===c[t]))),!o){if(l.error)throw new e(l.error.message);if(!m){const t=this[Yt](u,{},l.error);i||(d=C(c,this,v(this,B,"f").getMiddleware(),!0)),d=this[Dt](t,null!=d?d:c),f(d)&&!i&&(d=d.then((()=>C(c,this,v(this,B,"f").getMiddleware(),!1))))}}}catch(t){if(!(t instanceof e))throw t;v(this,pt,"f").fail(t.message,t)}return this[Rt](null!=d?d:c,a,!!i,!0)}[Yt](t,s,i,n){const r={...this.getDemandedOptions()};return o=>{if(i)throw new e(i.message);v(this,mt,"f").nonOptionCount(o),v(this,mt,"f").requiredArguments(o,r);let a=!1;v(this,dt,"f")&&(a=v(this,mt,"f").unknownCommands(o)),v(this,ft,"f")&&!a?v(this,mt,"f").unknownArguments(o,t,s,!!n):v(this,ut,"f")&&v(this,mt,"f").unknownArguments(o,t,{},!1,!1),v(this,mt,"f").limitedChoices(o),v(this,mt,"f").implications(o),v(this,mt,"f").conflicting(o)}}[Jt](){O(this,J,!0,"f")}[Zt](t){if("string"==typeof t)v(this,et,"f").key[t]=!0;else for(const e of t)v(this,et,"f").key[e]=!0}}var Qt,te;const{readFileSync:ee}=require("fs"),{inspect:se}=require("util"),{resolve:ie}=require("path"),ne=require("y18n"),re=require("yargs-parser");var oe,ae={assert:{notStrictEqual:t.notStrictEqual,strictEqual:t.strictEqual},cliui:require("cliui"),findUp:require("escalade/sync"),getEnv:t=>process.env[t],getCallerFile:require("get-caller-file"),getProcessArgvBin:y,inspect:se,mainFilename:null!==(te=null===(Qt=null===require||void 0===require?void 0:require.main)||void 0===Qt?void 0:Qt.filename)&&void 0!==te?te:process.cwd(),Parser:re,path:require("path"),process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:t=>{process.exit(t)},nextTick:process.nextTick,stdColumns:void 0!==process.stdout.columns?process.stdout.columns:null},readFileSync:ee,require:require,requireDirectory:require("require-directory"),stringWidth:require("string-width"),y18n:ne({directory:ie(__dirname,"../locales"),updateFiles:!1})};const he=(null===(oe=null===process||void 0===process?void 0:process.env)||void 0===oe?void 0:oe.YARGS_MIN_NODE_VERSION)?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version){if(Number(process.version.match(/v([^.]+)/)[1]){const i=new Xt(t,e,s,ce);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}),argsert:h,isPromise:f,objFilter:g,parseCommand:o,Parser:le,processArgv:b,YError:e};module.exports=fe; -+"use strict"; -+// "Error.captureStackTrace(this,e)" is removed from the constructor of a -+// custom Error class because that property doesn't exist when running -+// with LavaMoat/SES. -+var t=require("assert");class e extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace(this,e)}}let s,i=[];function n(t,o,a,h){s=h;let l={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if("string"!=typeof t.extends)return l;const r=/\.json|\..*rc$/.test(t.extends);let h=null;if(r)h=function(t,e){return s.path.resolve(t,e)}(o,t.extends);else try{h=require.resolve(t.extends)}catch(e){return t}!function(t){if(i.indexOf(t)>-1)throw new e(`Circular extended configurations: '${t}'.`)}(h),i.push(h),l=r?JSON.parse(s.readFileSync(h,"utf8")):require(t.extends),delete t.extends,l=n(l,s.path.dirname(h),a,s)}return i=[],a?r(l,t):Object.assign({},l,t)}function r(t,e){const s={};function i(t){return t&&"object"==typeof t&&!Array.isArray(t)}Object.assign(s,t);for(const n of Object.keys(e))i(e[n])&&i(s[n])?s[n]=r(t[n],e[n]):s[n]=e[n];return s}function o(t){const e=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),s=/\.*[\][<>]/g,i=e.shift();if(!i)throw new Error(`No command found in: ${t}`);const n={cmd:i.replace(s,""),demanded:[],optional:[]};return e.forEach(((t,i)=>{let r=!1;t=t.replace(/\s/g,""),/\.+[\]>]/.test(t)&&i===e.length-1&&(r=!0),/^\[/.test(t)?n.optional.push({cmd:t.replace(s,"").split("|"),variadic:r}):n.demanded.push({cmd:t.replace(s,"").split("|"),variadic:r})})),n}const a=["first","second","third","fourth","fifth","sixth"];function h(t,s,i){try{let n=0;const[r,a,h]="object"==typeof t?[{demanded:[],optional:[]},t,s]:[o(`cmd ${t}`),s,i],f=[].slice.call(a);for(;f.length&&void 0===f[f.length-1];)f.pop();const d=h||f.length;if(du)throw new e(`Too many arguments provided. Expected max ${u} but received ${d}.`);r.demanded.forEach((t=>{const e=l(f.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&c(e,t.cmd,n),n+=1})),r.optional.forEach((t=>{if(0===f.length)return;const e=l(f.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&c(e,t.cmd,n),n+=1}))}catch(t){console.warn(t.stack)}}function l(t){return Array.isArray(t)?"array":null===t?"null":typeof t}function c(t,s,i){throw new e(`Invalid ${a[i]||"manyith"} argument. Expected ${s.join(" or ")} but received ${t}.`)}function f(t){return!!t&&!!t.then&&"function"==typeof t.then}function d(t,e,s,i){s.assert.notStrictEqual(t,e,i)}function u(t,e){e.assert.strictEqual(typeof t,"string")}function p(t){return Object.keys(t)}function g(t={},e=(()=>!0)){const s={};return p(t).forEach((i=>{e(i,t[i])&&(s[i]=t[i])})),s}function m(){return process.versions.electron&&!process.defaultApp?0:1}function y(){return process.argv[m()]}var b=Object.freeze({__proto__:null,hideBin:function(t){return t.slice(m()+1)},getProcessArgvBin:y});function v(t,e,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(t):i?i.value:e.get(t)}function O(t,e,s,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(t,s):n?n.value=s:e.set(t,s),s}class w{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,s=!0,i=!1){if(h(" [boolean] [boolean] [boolean]",[t,e,s],arguments.length),Array.isArray(t)){for(let i=0;i{const i=[...s[e]||[],e];return!t.option||!i.includes(t.option)})),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();void 0!==t&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter((t=>t.global))}}function C(t,e,s,i){return s.reduce(((t,s)=>{if(s.applyBeforeValidation!==i)return t;if(s.mutates){if(s.applied)return t;s.applied=!0}if(f(t))return t.then((t=>Promise.all([t,s(t,e)]))).then((([t,e])=>Object.assign(t,e)));{const i=s(t,e);return f(i)?i.then((e=>Object.assign(t,e))):Object.assign(t,i)}}),t)}function j(t,e,s=(t=>{throw t})){try{const s="function"==typeof t?t():t;return f(s)?s.then((t=>e(t))):e(s)}catch(t){return s(t)}}const _=/(^\*)|(^\$0)/;class M{constructor(t,e,s,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=t,this.globalMiddleware=s,this.validation=e}addDirectory(t,e,s,i){"boolean"!=typeof(i=i||{}).recurse&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);const n="function"==typeof i.visit?i.visit:t=>t;i.visit=(t,e,s)=>{const i=n(t,e,s);if(i){if(this.requireCache.has(e))return i;this.requireCache.add(e),this.addHandler(i)}return i},this.shim.requireDirectory({require:e,filename:s},t,i)}addHandler(t,e,s,i,n,r){let a=[];const h=function(t){return t?t.map((t=>(t.applyBeforeValidation=!1,t))):[]}(n);if(i=i||(()=>{}),Array.isArray(t))if(function(t){return t.every((t=>"string"==typeof t))}(t))[t,...a]=t;else for(const e of t)this.addHandler(e);else{if(function(t){return"object"==typeof t&&!Array.isArray(t)}(t)){let e=Array.isArray(t.command)||"string"==typeof t.command?t.command:this.moduleName(t);return t.aliases&&(e=[].concat(e).concat(t.aliases)),void this.addHandler(e,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated)}if(k(s))return void this.addHandler([t].concat(a),e,s.builder,s.handler,s.middlewares,s.deprecated)}if("string"==typeof t){const n=o(t);a=a.map((t=>o(t).cmd));let l=!1;const c=[n.cmd].concat(a).filter((t=>!_.test(t)||(l=!0,!1)));0===c.length&&l&&c.push("$0"),l&&(n.cmd=c[0],a=c.slice(1),t=t.replace(_,n.cmd)),a.forEach((t=>{this.aliasMap[t]=n.cmd})),!1!==e&&this.usage.command(t,e,l,a,r),this.handlers[n.cmd]={original:t,description:e,handler:i,builder:s||{},middlewares:h,deprecated:r,demanded:n.demanded,optional:n.optional},l&&(this.defaultCommand=this.handlers[n.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,s,i,n,r){const o=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,a=e.getInternalMethods().getContext(),h=a.commands.slice(),l=!t;t&&(a.commands.push(t),a.fullCommands.push(o.original));const c=this.applyBuilderUpdateUsageAndParse(l,o,e,s.aliases,h,i,n,r);return f(c)?c.then((t=>this.applyMiddlewareAndGetResult(l,o,t.innerArgv,a,n,t.aliases,e))):this.applyMiddlewareAndGetResult(l,o,c.innerArgv,a,n,c.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,s,i,n,r,o,a){const h=e.builder;let l=s;if(x(h)){const c=h(s.getInternalMethods().reset(i),a);if(f(c))return c.then((i=>{var a;return l=(a=i)&&"function"==typeof a.getInternalMethods?i:s,this.parseAndUpdateUsage(t,e,l,n,r,o)}))}else(function(t){return"object"==typeof t})(h)&&(l=s.getInternalMethods().reset(i),Object.keys(e.builder).forEach((t=>{l.option(t,h[t])})));return this.parseAndUpdateUsage(t,e,l,n,r,o)}parseAndUpdateUsage(t,e,s,i,n,r){t&&s.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(s)&&s.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,e),e.description);const o=s.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,n,r);return f(o)?o.then((t=>({aliases:s.parsed.aliases,innerArgv:t}))):{aliases:s.parsed.aliases,innerArgv:o}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&0===t.getInternalMethods().getUsageInstance().getUsage().length}usageFromParentCommandsCommandHandler(t,e){const s=_.test(e.original)?e.original.replace(_,"").trim():e.original,i=t.filter((t=>!_.test(t)));return i.push(s),`$0 ${i.join(" ")}`}applyMiddlewareAndGetResult(t,e,s,i,n,r,o){let a={};if(n)return s;o.getInternalMethods().getHasOutput()||(a=this.populatePositionals(e,s,i,o));const h=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares);if(s=C(s,o,h,!0),!o.getInternalMethods().getHasOutput()){const e=o.getInternalMethods().runValidation(r,a,o.parsed.error,t);s=j(s,(t=>(e(t),t)))}if(e.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();const i=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(s,i,!1,!1),s=j(s=C(s,o,h,!1),(t=>{const s=e.handler(t);return f(s)?s.then((()=>t)):t})),t||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),f(s)&&!o.getInternalMethods().hasParseCallback()&&s.catch((t=>{try{o.getInternalMethods().getUsageInstance().fail(null,t)}catch(t){}}))}return t||(i.commands.pop(),i.fullCommands.pop()),s}populatePositionals(t,e,s,i){e._=e._.slice(s.commands.length);const n=t.demanded.slice(0),r=t.optional.slice(0),o={};for(this.validation.positionalCount(n.length,e._.length);n.length;){const t=n.shift();this.populatePositional(t,e,o)}for(;r.length;){const t=r.shift();this.populatePositional(t,e,o)}return e._=s.commands.concat(e._.map((t=>""+t))),this.postProcessPositionals(e,o,this.cmdToParseOptions(t.original),i),o}populatePositional(t,e,s){const i=t.cmd[0];t.variadic?s[i]=e._.splice(0).map(String):e._.length&&(s[i]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},s=o(t);return s.demanded.forEach((t=>{const[s,...i]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=i,e.demand[s]=!0})),s.optional.forEach((t=>{const[s,...i]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=i})),e}postProcessPositionals(t,e,s,i){const n=Object.assign({},i.getOptions());n.default=Object.assign(s.default,n.default);for(const t of Object.keys(s.alias))n.alias[t]=(n.alias[t]||[]).concat(s.alias[t]);n.array=n.array.concat(s.array),n.config={};const r=[];if(Object.keys(e).forEach((t=>{e[t].map((e=>{n.configuration["unknown-options-as-args"]&&(n.key[t]=!0),r.push(`--${t}`),r.push(e)}))})),!r.length)return;const o=Object.assign({},n.configuration,{"populate--":!1}),a=this.shim.Parser.detailed(r,Object.assign({},n,{configuration:o}));if(a.error)i.getInternalMethods().getUsageInstance().fail(a.error.message,a.error);else{const s=Object.keys(e);Object.keys(e).forEach((t=>{s.push(...a.aliases[t])}));const n=i.getOptions().default;Object.keys(a.argv).forEach((i=>{s.includes(i)&&(e[i]||(e[i]=a.argv[i]),!Object.hasOwnProperty.call(n,i)&&Object.hasOwnProperty.call(t,i)&&Object.hasOwnProperty.call(a.argv,i)&&(Array.isArray(t[i])||Array.isArray(a.argv[i]))?t[i]=[].concat(t[i],a.argv[i]):t[i]=a.argv[i])}))}}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const e=_.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(e,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(x(e))return e(t,!0);k(e)||Object.keys(e).forEach((s=>{t.option(s,e[s])}))}moduleName(t){const e=function(t){if("undefined"==typeof require)return null;for(let e,s=0,i=Object.keys(require.cache);s{const s=e;s._handle&&s.isTTY&&"function"==typeof s._handle.setBlocking&&s._handle.setBlocking(t)}))}function A(t){return"boolean"==typeof t}function P(t,s){const i=s.y18n.__,n={},r=[];n.failFn=function(t){r.push(t)};let o=null,a=null,h=!0;n.showHelpOnFail=function(e=!0,s){const[i,r]="string"==typeof e?[!0,e]:[e,s];return t.getInternalMethods().isGlobalContext()&&(a=r),o=r,h=i,n};let l=!1;n.fail=function(s,i){const c=t.getInternalMethods().getLoggerInstance();if(!r.length){if(t.getExitProcess()&&E(!0),!l){l=!0,h&&(t.showHelp("error"),c.error()),(s||i)&&c.error(s||i);const e=o||a;e&&((s||i)&&c.error(""),c.error(e))}if(i=i||new e(s),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,i);throw i}for(let t=r.length-1;t>=0;--t){const e=r[t];if(A(e)){if(i)throw i;if(s)throw Error(s)}else e(s,i,n)}};let c=[],f=!1;n.usage=(t,e)=>null===t?(f=!0,c=[],n):(f=!1,c.push([t,e||""]),n),n.getUsage=()=>c,n.getUsageDisabled=()=>f,n.getPositionalGroupName=()=>i("Positionals:");let d=[];n.example=(t,e)=>{d.push([t,e||""])};let u=[];n.command=function(t,e,s,i,n=!1){s&&(u=u.map((t=>(t[2]=!1,t)))),u.push([t,e||"",s,i,n])},n.getCommands=()=>u;let p={};n.describe=function(t,e){Array.isArray(t)?t.forEach((t=>{n.describe(t,e)})):"object"==typeof t?Object.keys(t).forEach((e=>{n.describe(e,t[e])})):p[t]=e},n.getDescriptions=()=>p;let m=[];n.epilog=t=>{m.push(t)};let y,b=!1;function v(){return b||(y=function(){const t=80;return s.process.stdColumns?Math.min(t,s.process.stdColumns):t}(),b=!0),y}n.wrap=t=>{b=!0,y=t};const O="__yargsString__:";function w(t,e,i){let n=0;return Array.isArray(t)||(t=Object.values(t).map((t=>[t]))),t.forEach((t=>{n=Math.max(s.stringWidth(i?`${i} ${I(t[0])}`:I(t[0]))+$(t[0]),n)})),e&&(n=Math.min(n,parseInt((.5*e).toString(),10))),n}let C;function j(e){return t.getOptions().hiddenOptions.indexOf(e)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function _(t,e){let s=`[${i("default:")} `;if(void 0===t&&!e)return null;if(e)s+=e;else switch(typeof t){case"string":s+=`"${t}"`;break;case"object":s+=JSON.stringify(t);break;default:s+=t}return`${s}]`}n.deferY18nLookup=t=>O+t,n.help=function(){if(C)return C;!function(){const e=t.getDemandedOptions(),s=t.getOptions();(Object.keys(s.alias)||[]).forEach((i=>{s.alias[i].forEach((r=>{p[r]&&n.describe(i,p[r]),r in e&&t.demandOption(i,e[r]),s.boolean.includes(r)&&t.boolean(i),s.count.includes(r)&&t.count(i),s.string.includes(r)&&t.string(i),s.normalize.includes(r)&&t.normalize(i),s.array.includes(r)&&t.array(i),s.number.includes(r)&&t.number(i)}))}))}();const e=t.customScriptName?t.$0:s.path.basename(t.$0),r=t.getDemandedOptions(),o=t.getDemandedCommands(),a=t.getDeprecatedOptions(),h=t.getGroups(),l=t.getOptions();let g=[];g=g.concat(Object.keys(p)),g=g.concat(Object.keys(r)),g=g.concat(Object.keys(o)),g=g.concat(Object.keys(l.default)),g=g.filter(j),g=Object.keys(g.reduce(((t,e)=>("_"!==e&&(t[e]=!0),t)),{}));const y=v(),b=s.cliui({width:y,wrap:!!y});if(!f)if(c.length)c.forEach((t=>{b.div({text:`${t[0].replace(/\$0/g,e)}`}),t[1]&&b.div({text:`${t[1]}`,padding:[1,0,0,0]})})),b.div();else if(u.length){let t=null;t=o._?`${e} <${i("command")}>\n`:`${e} [${i("command")}]\n`,b.div(`${t}`)}if(u.length>1||1===u.length&&!u[0][2]){b.div(i("Commands:"));const s=t.getInternalMethods().getContext(),n=s.commands.length?`${s.commands.join(" ")} `:"";!0===t.getInternalMethods().getParserConfiguration()["sort-commands"]&&(u=u.sort(((t,e)=>t[0].localeCompare(e[0]))));const r=e?`${e} `:"";u.forEach((t=>{const s=`${r}${n}${t[0].replace(/^\$0 ?/,"")}`;b.span({text:s,padding:[0,2,0,2],width:w(u,y,`${e}${n}`)+4},{text:t[1]});const o=[];t[2]&&o.push(`[${i("default")}]`),t[3]&&t[3].length&&o.push(`[${i("aliases:")} ${t[3].join(", ")}]`),t[4]&&("string"==typeof t[4]?o.push(`[${i("deprecated: %s",t[4])}]`):o.push(`[${i("deprecated")}]`)),o.length?b.div({text:o.join(" "),padding:[0,0,0,2],align:"right"}):b.div()})),b.div()}const M=(Object.keys(l.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);g=g.filter((e=>!t.parsed.newAliases[e]&&M.every((t=>-1===(l.alias[t]||[]).indexOf(e)))));const k=i("Options:");h[k]||(h[k]=[]),function(t,e,s,i){let n=[],r=null;Object.keys(s).forEach((t=>{n=n.concat(s[t])})),t.forEach((t=>{r=[t].concat(e[t]),r.some((t=>-1!==n.indexOf(t)))||s[i].push(t)}))}(g,l.alias,h,k);const x=t=>/^--/.test(I(t)),E=Object.keys(h).filter((t=>h[t].length>0)).map((t=>({groupName:t,normalizedKeys:h[t].filter(j).map((t=>{if(M.includes(t))return t;for(let e,s=0;void 0!==(e=M[s]);s++)if((l.alias[e]||[]).includes(t))return e;return t}))}))).filter((({normalizedKeys:t})=>t.length>0)).map((({groupName:t,normalizedKeys:e})=>{const s=e.reduce(((e,s)=>(e[s]=[s].concat(l.alias[s]||[]).map((e=>t===n.getPositionalGroupName()?e:(/^[0-9]$/.test(e)?l.boolean.includes(s)?"-":"--":e.length>1?"--":"-")+e)).sort(((t,e)=>x(t)===x(e)?0:x(t)?1:-1)).join(", "),e)),{});return{groupName:t,normalizedKeys:e,switches:s}}));if(E.filter((({groupName:t})=>t!==n.getPositionalGroupName())).some((({normalizedKeys:t,switches:e})=>!t.every((t=>x(e[t])))))&&E.filter((({groupName:t})=>t!==n.getPositionalGroupName())).forEach((({normalizedKeys:t,switches:e})=>{t.forEach((t=>{var s,i;x(e[t])&&(e[t]=(s=e[t],i="-x, ".length,S(s)?{text:s.text,indentation:s.indentation+i}:{text:s,indentation:i}))}))})),E.forEach((({groupName:t,normalizedKeys:e,switches:s})=>{b.div(t),e.forEach((t=>{const e=s[t];let o=p[t]||"",h=null;o.includes(O)&&(o=i(o.substring(O.length))),l.boolean.includes(t)&&(h=`[${i("boolean")}]`),l.count.includes(t)&&(h=`[${i("count")}]`),l.string.includes(t)&&(h=`[${i("string")}]`),l.normalize.includes(t)&&(h=`[${i("string")}]`),l.array.includes(t)&&(h=`[${i("array")}]`),l.number.includes(t)&&(h=`[${i("number")}]`);const c=[t in a?(f=a[t],"string"==typeof f?`[${i("deprecated: %s",f)}]`:`[${i("deprecated")}]`):null,h,t in r?`[${i("required")}]`:null,l.choices&&l.choices[t]?`[${i("choices:")} ${n.stringifiedValues(l.choices[t])}]`:null,_(l.default[t],l.defaultDescription[t])].filter(Boolean).join(" ");var f;b.span({text:I(e),padding:[0,2,0,2+$(e)],width:w(s,y)+4},o),c?b.div({text:c,padding:[0,0,0,2],align:"right"}):b.div()})),b.div()})),d.length&&(b.div(i("Examples:")),d.forEach((t=>{t[0]=t[0].replace(/\$0/g,e)})),d.forEach((t=>{""===t[1]?b.div({text:t[0],padding:[0,2,0,2]}):b.div({text:t[0],padding:[0,2,0,2],width:w(d,y)+4},{text:t[1]})})),b.div()),m.length>0){const t=m.map((t=>t.replace(/\$0/g,e))).join("\n");b.div(`${t}\n`)}return b.toString().replace(/\s*$/,"")},n.cacheHelpMessage=function(){C=this.help()},n.clearCachedHelpMessage=function(){C=void 0},n.hasCachedHelpMessage=function(){return!!C},n.showHelp=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(n.help())},n.functionDescription=t=>["(",t.name?s.Parser.decamelize(t.name,"-"):i("generated-value"),")"].join(""),n.stringifiedValues=function(t,e){let s="";const i=e||", ",n=[].concat(t);return t&&n.length?(n.forEach((t=>{s.length&&(s+=i),s+=JSON.stringify(t)})),s):s};let M=null;n.version=t=>{M=t},n.showVersion=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(M)},n.reset=function(t){return o=null,l=!1,c=[],f=!1,m=[],d=[],u=[],p=g(p,(e=>!t[e])),n};const k=[];return n.freeze=function(){k.push({failMessage:o,failureOutput:l,usages:c,usageDisabled:f,epilogs:m,examples:d,commands:u,descriptions:p})},n.unfreeze=function(t=!1){const e=k.pop();e&&(t?(p={...e.descriptions,...p},u=[...e.commands,...u],c=[...e.usages,...c],d=[...e.examples,...d],m=[...e.epilogs,...m]):({failMessage:o,failureOutput:l,usages:c,usageDisabled:f,epilogs:m,examples:d,commands:u,descriptions:p}=e))},n}function S(t){return"object"==typeof t}function $(t){return S(t)?t.indentation:0}function I(t){return S(t)?t.text:t}class N{constructor(t,e,s,i){var n,r,o;this.yargs=t,this.usage=e,this.command=s,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=null!==(o=(null===(n=this.shim.getEnv("SHELL"))||void 0===n?void 0:n.includes("zsh"))||(null===(r=this.shim.getEnv("ZSH_NAME"))||void 0===r?void 0:r.includes("zsh")))&&void 0!==o&&o}defaultCompletion(t,e,s,i){const n=this.command.getCommandHandlers();for(let e=0,s=t.length;e{const i=o(s[0]).cmd;if(-1===e.indexOf(i))if(this.zshShell){const e=s[1]||"";t.push(i.replace(/:/g,"\\:")+":"+e)}else t.push(i)}))}optionCompletions(t,e,s,i){if((i.match(/^-/)||""===i&&0===t.length)&&!this.previousArgHasChoices(e)){const n=this.yargs.getOptions(),r=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(n.key).forEach((o=>{const a=!!n.configuration["boolean-negation"]&&n.boolean.includes(o);r.includes(o)||n.hiddenOptions.includes(o)||this.argsContainKey(e,s,o,a)||(this.completeOptionKey(o,t,i),a&&n.default[o]&&this.completeOptionKey(`no-${o}`,t,i))}))}}choicesFromOptionsCompletions(t,e,s,i){if(this.previousArgHasChoices(e)){const s=this.getPreviousArgChoices(e);s&&s.length>0&&t.push(...s.map((t=>t.replace(/:/g,"\\:"))))}}choicesFromPositionalsCompletions(t,e,s,i){if(""===i&&t.length>0&&this.previousArgHasChoices(e))return;const n=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],r=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),o=n[s._.length-r-1];if(!o)return;const a=this.yargs.getOptions().choices[o]||[];for(const e of a)e.startsWith(i)&&t.push(e.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],s="";if(!e.startsWith("-")&&t.length>1&&(s=e,e=t[t.length-2]),!e.startsWith("-"))return;const i=e.replace(/^-+/,""),n=this.yargs.getOptions(),r=[i,...this.yargs.getAliases()[i]||[]];let o;for(const t of r)if(Object.prototype.hasOwnProperty.call(n.key,t)&&Array.isArray(n.choices[t])){o=n.choices[t];break}return o?o.filter((t=>!s||t.startsWith(s))):void 0}previousArgHasChoices(t){const e=this.getPreviousArgChoices(t);return void 0!==e&&e.length>0}argsContainKey(t,e,s,i){if(-1!==t.indexOf(`--${s}`))return!0;if(i&&-1!==t.indexOf(`--no-${s}`))return!0;if(this.aliases)for(const t of this.aliases[s])if(void 0!==e[t])return!0;return!1}completeOptionKey(t,e,s){const i=this.usage.getDescriptions(),n=!/^--/.test(s)&&(t=>/^[^0-9]$/.test(t))(t)?"-":"--";if(this.zshShell){const s=i[t]||"";e.push(n+`${t.replace(/:/g,"\\:")}:${s.replace("__yargsString__:","")}`)}else e.push(n+t)}customCompletion(t,e,s,i){if(d(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){const t=this.customCompletionFunction(s,e);return f(t)?t.then((t=>{this.shim.process.nextTick((()=>{i(null,t)}))})).catch((t=>{this.shim.process.nextTick((()=>{i(t,void 0)}))})):i(null,t)}return function(t){return t.length>3}(this.customCompletionFunction)?this.customCompletionFunction(s,e,((n=i)=>this.defaultCompletion(t,e,s,n)),(t=>{i(null,t)})):this.customCompletionFunction(s,e,(t=>{i(null,t)}))}getCompletion(t,e){const s=t.length?t[t.length-1]:"",i=this.yargs.parse(t,!0),n=this.customCompletionFunction?i=>this.customCompletion(t,i,s,e):i=>this.defaultCompletion(t,i,s,e);return f(i)?i.then(n):n(i)}generateCompletionScript(t,e){let s=this.zshShell?'#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zsh_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$\'\n\' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "${words[@]}"))\n IFS=$si\n _describe \'values\' reply\n}\ncompdef _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n':'###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n';const i=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),s=s.replace(/{{app_name}}/g,i),s=s.replace(/{{completion_command}}/g,e),s.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}}function D(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const s=[];let i,n;for(i=0;i<=e.length;i++)s[i]=[i];for(n=0;n<=t.length;n++)s[0][n]=n;for(i=1;i<=e.length;i++)for(n=1;n<=t.length;n++)e.charAt(i-1)===t.charAt(n-1)?s[i][n]=s[i-1][n-1]:i>1&&n>1&&e.charAt(i-2)===t.charAt(n-1)&&e.charAt(i-1)===t.charAt(n-2)?s[i][n]=s[i-2][n-2]+1:s[i][n]=Math.min(s[i-1][n-1]+1,Math.min(s[i][n-1]+1,s[i-1][n]+1));return s[e.length][t.length]}const H=["$0","--","_"];var z,q,W,F,U,L,V,G,R,T,K,B,Y,J,Z,X,Q,tt,et,st,it,nt,rt,ot,at,ht,lt,ct,ft,dt,ut,pt,gt,mt;const yt=Symbol("copyDoubleDash"),bt=Symbol("copyDoubleDash"),vt=Symbol("deleteFromParserHintObject"),Ot=Symbol("emitWarning"),wt=Symbol("freeze"),Ct=Symbol("getDollarZero"),jt=Symbol("getParserConfiguration"),_t=Symbol("guessLocale"),Mt=Symbol("guessVersion"),kt=Symbol("parsePositionalNumbers"),xt=Symbol("pkgUp"),Et=Symbol("populateParserHintArray"),At=Symbol("populateParserHintSingleValueDictionary"),Pt=Symbol("populateParserHintArrayDictionary"),St=Symbol("populateParserHintDictionary"),$t=Symbol("sanitizeKey"),It=Symbol("setKey"),Nt=Symbol("unfreeze"),Dt=Symbol("validateAsync"),Ht=Symbol("getCommandInstance"),zt=Symbol("getContext"),qt=Symbol("getHasOutput"),Wt=Symbol("getLoggerInstance"),Ft=Symbol("getParseContext"),Ut=Symbol("getUsageInstance"),Lt=Symbol("getValidationInstance"),Vt=Symbol("hasParseCallback"),Gt=Symbol("isGlobalContext"),Rt=Symbol("postProcess"),Tt=Symbol("rebase"),Kt=Symbol("reset"),Bt=Symbol("runYargsParserAndExecuteCommands"),Yt=Symbol("runValidation"),Jt=Symbol("setHasOutput"),Zt=Symbol("kTrackManuallySetKeys");class Xt{constructor(t=[],e,s,i){this.customScriptName=!1,this.parsed=!1,z.set(this,void 0),q.set(this,void 0),W.set(this,{commands:[],fullCommands:[]}),F.set(this,null),U.set(this,null),L.set(this,"show-hidden"),V.set(this,null),G.set(this,!0),R.set(this,{}),T.set(this,!0),K.set(this,[]),B.set(this,void 0),Y.set(this,{}),J.set(this,!1),Z.set(this,null),X.set(this,!0),Q.set(this,void 0),tt.set(this,""),et.set(this,void 0),st.set(this,void 0),it.set(this,{}),nt.set(this,null),rt.set(this,null),ot.set(this,{}),at.set(this,{}),ht.set(this,void 0),lt.set(this,!1),ct.set(this,void 0),ft.set(this,!1),dt.set(this,!1),ut.set(this,!1),pt.set(this,void 0),gt.set(this,null),mt.set(this,void 0),O(this,ct,i,"f"),O(this,ht,t,"f"),O(this,q,e,"f"),O(this,st,s,"f"),O(this,B,new w(this),"f"),this.$0=this[Ct](),this[Kt](),O(this,z,v(this,z,"f"),"f"),O(this,pt,v(this,pt,"f"),"f"),O(this,mt,v(this,mt,"f"),"f"),O(this,et,v(this,et,"f"),"f"),v(this,et,"f").showHiddenOpt=v(this,L,"f"),O(this,Q,this[bt](),"f")}addHelpOpt(t,e){return h("[string|boolean] [string]",[t,e],arguments.length),v(this,Z,"f")&&(this[vt](v(this,Z,"f")),O(this,Z,null,"f")),!1===t&&void 0===e||(O(this,Z,"string"==typeof t?t:"help","f"),this.boolean(v(this,Z,"f")),this.describe(v(this,Z,"f"),e||v(this,pt,"f").deferY18nLookup("Show help"))),this}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(h("[string|boolean] [string]",[t,e],arguments.length),!1===t&&void 0===e)return this;const s="string"==typeof t?t:v(this,L,"f");return this.boolean(s),this.describe(s,e||v(this,pt,"f").deferY18nLookup("Show hidden options")),v(this,et,"f").showHiddenOpt=s,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return h(" [string|array]",[t,e],arguments.length),this[Pt](this.alias.bind(this),"alias",t,e),this}array(t){return h("",[t],arguments.length),this[Et]("array",t),this[Zt](t),this}boolean(t){return h("",[t],arguments.length),this[Et]("boolean",t),this[Zt](t),this}check(t,e){return h(" [boolean]",[t,e],arguments.length),this.middleware(((e,s)=>j((()=>t(e,s.getOptions())),(s=>(s?("string"==typeof s||s instanceof Error)&&v(this,pt,"f").fail(s.toString(),s):v(this,pt,"f").fail(v(this,ct,"f").y18n.__("Argument check failed: %s",t.toString())),e)),(t=>(v(this,pt,"f").fail(t.message?t.message:t.toString(),t),e)))),!1,e),this}choices(t,e){return h(" [string|array]",[t,e],arguments.length),this[Pt](this.choices.bind(this),"choices",t,e),this}coerce(t,s){if(h(" [function]",[t,s],arguments.length),Array.isArray(t)){if(!s)throw new e("coerce callback must be provided");for(const e of t)this.coerce(e,s);return this}if("object"==typeof t){for(const e of Object.keys(t))this.coerce(e,t[e]);return this}if(!s)throw new e("coerce callback must be provided");return v(this,et,"f").key[t]=!0,v(this,B,"f").addCoerceMiddleware(((i,n)=>{let r;return Object.hasOwnProperty.call(i,t)?j((()=>(r=n.getAliases(),s(i[t]))),(e=>{i[t]=e;const s=n.getInternalMethods().getParserConfiguration()["strip-aliased"];if(r[t]&&!0!==s)for(const s of r[t])i[s]=e;return i}),(t=>{throw new e(t.message)})):i}),t),this}conflicts(t,e){return h(" [string|array]",[t,e],arguments.length),v(this,mt,"f").conflicts(t,e),this}config(t="config",e,s){return h("[object|string] [string|function] [function]",[t,e,s],arguments.length),"object"!=typeof t||Array.isArray(t)?("function"==typeof e&&(s=e,e=void 0),this.describe(t,e||v(this,pt,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach((t=>{v(this,et,"f").config[t]=s||!0})),this):(t=n(t,v(this,q,"f"),this[jt]()["deep-merge-config"]||!1,v(this,ct,"f")),v(this,et,"f").configObjects=(v(this,et,"f").configObjects||[]).concat(t),this)}completion(t,e,s){return h("[string] [string|boolean|function] [function]",[t,e,s],arguments.length),"function"==typeof e&&(s=e,e=void 0),O(this,U,t||v(this,U,"f")||"completion","f"),e||!1===e||(e="generate completion script"),this.command(v(this,U,"f"),e),s&&v(this,F,"f").registerFunction(s),this}command(t,e,s,i,n,r){return h(" [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,s,i,n,r],arguments.length),v(this,z,"f").addHandler(t,e,s,i,n,r),this}commands(t,e,s,i,n,r){return this.command(t,e,s,i,n,r)}commandDir(t,e){h(" [object]",[t,e],arguments.length);const s=v(this,st,"f")||v(this,ct,"f").require;return v(this,z,"f").addDirectory(t,s,v(this,ct,"f").getCallerFile(),e),this}count(t){return h("",[t],arguments.length),this[Et]("count",t),this[Zt](t),this}default(t,e,s){return h(" [*] [string]",[t,e,s],arguments.length),s&&(u(t,v(this,ct,"f")),v(this,et,"f").defaultDescription[t]=s),"function"==typeof e&&(u(t,v(this,ct,"f")),v(this,et,"f").defaultDescription[t]||(v(this,et,"f").defaultDescription[t]=v(this,pt,"f").functionDescription(e)),e=e.call()),this[At](this.default.bind(this),"default",t,e),this}defaults(t,e,s){return this.default(t,e,s)}demandCommand(t=1,e,s,i){return h("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,s,i],arguments.length),"number"!=typeof e&&(s=e,e=1/0),this.global("_",!1),v(this,et,"f").demandedCommands._={min:t,max:e,minMsg:s,maxMsg:i},this}demand(t,e,s){return Array.isArray(e)?(e.forEach((t=>{d(s,!0,v(this,ct,"f")),this.demandOption(t,s)})),e=1/0):"number"!=typeof e&&(s=e,e=1/0),"number"==typeof t?(d(s,!0,v(this,ct,"f")),this.demandCommand(t,e,s,s)):Array.isArray(t)?t.forEach((t=>{d(s,!0,v(this,ct,"f")),this.demandOption(t,s)})):"string"==typeof s?this.demandOption(t,s):!0!==s&&void 0!==s||this.demandOption(t),this}demandOption(t,e){return h(" [string]",[t,e],arguments.length),this[At](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return h(" [string|boolean]",[t,e],arguments.length),v(this,et,"f").deprecatedOptions[t]=e,this}describe(t,e){return h(" [string]",[t,e],arguments.length),this[It](t,!0),v(this,pt,"f").describe(t,e),this}detectLocale(t){return h("",[t],arguments.length),O(this,G,t,"f"),this}env(t){return h("[string|boolean]",[t],arguments.length),!1===t?delete v(this,et,"f").envPrefix:v(this,et,"f").envPrefix=t||"",this}epilogue(t){return h("",[t],arguments.length),v(this,pt,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return h(" [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach((t=>this.example(...t))):v(this,pt,"f").example(t,e),this}exit(t,e){O(this,J,!0,"f"),O(this,V,e,"f"),v(this,T,"f")&&v(this,ct,"f").process.exit(t)}exitProcess(t=!0){return h("[boolean]",[t],arguments.length),O(this,T,t,"f"),this}fail(t){if(h("",[t],arguments.length),"boolean"==typeof t&&!1!==t)throw new e("Invalid first argument. Expected function or boolean 'false'");return v(this,pt,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return h(" [function]",[t,e],arguments.length),e?v(this,F,"f").getCompletion(t,e):new Promise(((e,s)=>{v(this,F,"f").getCompletion(t,((t,i)=>{t?s(t):e(i)}))}))}getDemandedOptions(){return h([],0),v(this,et,"f").demandedOptions}getDemandedCommands(){return h([],0),v(this,et,"f").demandedCommands}getDeprecatedOptions(){return h([],0),v(this,et,"f").deprecatedOptions}getDetectLocale(){return v(this,G,"f")}getExitProcess(){return v(this,T,"f")}getGroups(){return Object.assign({},v(this,Y,"f"),v(this,at,"f"))}getHelp(){if(O(this,J,!0,"f"),!v(this,pt,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[Bt](v(this,ht,"f"),void 0,void 0,0,!0);if(f(t))return t.then((()=>v(this,pt,"f").help()))}const t=v(this,z,"f").runDefaultBuilderOn(this);if(f(t))return t.then((()=>v(this,pt,"f").help()))}return Promise.resolve(v(this,pt,"f").help())}getOptions(){return v(this,et,"f")}getStrict(){return v(this,ft,"f")}getStrictCommands(){return v(this,dt,"f")}getStrictOptions(){return v(this,ut,"f")}global(t,e){return h(" [boolean]",[t,e],arguments.length),t=[].concat(t),!1!==e?v(this,et,"f").local=v(this,et,"f").local.filter((e=>-1===t.indexOf(e))):t.forEach((t=>{v(this,et,"f").local.includes(t)||v(this,et,"f").local.push(t)})),this}group(t,e){h(" ",[t,e],arguments.length);const s=v(this,at,"f")[e]||v(this,Y,"f")[e];v(this,at,"f")[e]&&delete v(this,at,"f")[e];const i={};return v(this,Y,"f")[e]=(s||[]).concat(t).filter((t=>!i[t]&&(i[t]=!0))),this}hide(t){return h("",[t],arguments.length),v(this,et,"f").hiddenOptions.push(t),this}implies(t,e){return h(" [number|string|array]",[t,e],arguments.length),v(this,mt,"f").implies(t,e),this}locale(t){return h("[string]",[t],arguments.length),t?(O(this,G,!1,"f"),v(this,ct,"f").y18n.setLocale(t),this):(this[_t](),v(this,ct,"f").y18n.getLocale())}middleware(t,e,s){return v(this,B,"f").addMiddleware(t,!!e,s)}nargs(t,e){return h(" [number]",[t,e],arguments.length),this[At](this.nargs.bind(this),"narg",t,e),this}normalize(t){return h("",[t],arguments.length),this[Et]("normalize",t),this}number(t){return h("",[t],arguments.length),this[Et]("number",t),this[Zt](t),this}option(t,e){if(h(" [object]",[t,e],arguments.length),"object"==typeof t)Object.keys(t).forEach((e=>{this.options(e,t[e])}));else{"object"!=typeof e&&(e={}),this[Zt](t),!v(this,gt,"f")||"version"!==t&&"version"!==(null==e?void 0:e.alias)||this[Ot](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join("\n"),void 0,"versionWarning"),v(this,et,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);const s=e.deprecate||e.deprecated;s&&this.deprecateOption(t,s);const i=e.demand||e.required||e.require;i&&this.demand(t,i),e.demandOption&&this.demandOption(t,"string"==typeof e.demandOption?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),void 0!==e.implies&&this.implies(t,e.implies),void 0!==e.nargs&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||"boolean"===e.type)&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||"array"===e.type)&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||"number"===e.type)&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||"string"===e.type)&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||"count"===e.type)&&this.count(t),"boolean"==typeof e.global&&this.global(t,e.global),e.defaultDescription&&(v(this,et,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);const n=e.describe||e.description||e.desc;this.describe(t,n),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,s){h("[string|array] [function|boolean|object] [function]",[t,e,s],arguments.length),this[wt](),void 0===t&&(t=v(this,ht,"f")),"object"==typeof e&&(O(this,rt,e,"f"),e=s),"function"==typeof e&&(O(this,nt,e,"f"),e=!1),e||O(this,ht,t,"f"),v(this,nt,"f")&&O(this,T,!1,"f");const i=this[Bt](t,!!e),n=this.parsed;return v(this,F,"f").setParsed(this.parsed),f(i)?i.then((t=>(v(this,nt,"f")&&v(this,nt,"f").call(this,v(this,V,"f"),t,v(this,tt,"f")),t))).catch((t=>{throw v(this,nt,"f")&&v(this,nt,"f")(t,this.parsed.argv,v(this,tt,"f")),t})).finally((()=>{this[Nt](),this.parsed=n})):(v(this,nt,"f")&&v(this,nt,"f").call(this,v(this,V,"f"),i,v(this,tt,"f")),this[Nt](),this.parsed=n,i)}parseAsync(t,e,s){const i=this.parse(t,e,s);return f(i)?i:Promise.resolve(i)}parseSync(t,s,i){const n=this.parse(t,s,i);if(f(n))throw new e(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return n}parserConfiguration(t){return h("",[t],arguments.length),O(this,it,t,"f"),this}pkgConf(t,e){h(" [string]",[t,e],arguments.length);let s=null;const i=this[xt](e||v(this,q,"f"));return i[t]&&"object"==typeof i[t]&&(s=n(i[t],e||v(this,q,"f"),this[jt]()["deep-merge-config"]||!1,v(this,ct,"f")),v(this,et,"f").configObjects=(v(this,et,"f").configObjects||[]).concat(s)),this}positional(t,e){h(" ",[t,e],arguments.length);const s=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=g(e,((t,e)=>!("type"===t&&!["string","number","boolean"].includes(e))&&s.includes(t)));const i=v(this,W,"f").fullCommands[v(this,W,"f").fullCommands.length-1],n=i?v(this,z,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return p(n).forEach((s=>{const i=n[s];Array.isArray(i)?-1!==i.indexOf(t)&&(e[s]=!0):i[t]&&!(s in e)&&(e[s]=i[t])})),this.group(t,v(this,pt,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return h("[boolean]",[t],arguments.length),O(this,lt,t,"f"),this}required(t,e,s){return this.demand(t,e,s)}require(t,e,s){return this.demand(t,e,s)}requiresArg(t){return h(" [number]",[t],arguments.length),"string"==typeof t&&v(this,et,"f").narg[t]||this[At](this.requiresArg.bind(this),"narg",t,NaN),this}showCompletionScript(t,e){return h("[string] [string]",[t,e],arguments.length),t=t||this.$0,v(this,Q,"f").log(v(this,F,"f").generateCompletionScript(t,e||v(this,U,"f")||"completion")),this}showHelp(t){if(h("[string|function]",[t],arguments.length),O(this,J,!0,"f"),!v(this,pt,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[Bt](v(this,ht,"f"),void 0,void 0,0,!0);if(f(e))return e.then((()=>{v(this,pt,"f").showHelp(t)})),this}const e=v(this,z,"f").runDefaultBuilderOn(this);if(f(e))return e.then((()=>{v(this,pt,"f").showHelp(t)})),this}return v(this,pt,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return h("[boolean|string] [string]",[t,e],arguments.length),v(this,pt,"f").showHelpOnFail(t,e),this}showVersion(t){return h("[string|function]",[t],arguments.length),v(this,pt,"f").showVersion(t),this}skipValidation(t){return h("",[t],arguments.length),this[Et]("skipValidation",t),this}strict(t){return h("[boolean]",[t],arguments.length),O(this,ft,!1!==t,"f"),this}strictCommands(t){return h("[boolean]",[t],arguments.length),O(this,dt,!1!==t,"f"),this}strictOptions(t){return h("[boolean]",[t],arguments.length),O(this,ut,!1!==t,"f"),this}string(t){return h("",[t],arguments.length),this[Et]("string",t),this[Zt](t),this}terminalWidth(){return h([],0),v(this,ct,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return h("",[t],arguments.length),O(this,G,!1,"f"),v(this,ct,"f").y18n.updateLocale(t),this}usage(t,s,i,n){if(h(" [string|boolean] [function|object] [function]",[t,s,i,n],arguments.length),void 0!==s){if(d(t,null,v(this,ct,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,s,i,n);throw new e(".usage() description must start with $0 if being used as alias for .command()")}return v(this,pt,"f").usage(t),this}version(t,e,s){const i="version";if(h("[boolean|string] [string] [string]",[t,e,s],arguments.length),v(this,gt,"f")&&(this[vt](v(this,gt,"f")),v(this,pt,"f").version(void 0),O(this,gt,null,"f")),0===arguments.length)s=this[Mt](),t=i;else if(1===arguments.length){if(!1===t)return this;s=t,t=i}else 2===arguments.length&&(s=e,e=void 0);return O(this,gt,"string"==typeof t?t:i,"f"),e=e||v(this,pt,"f").deferY18nLookup("Show version number"),v(this,pt,"f").version(s||void 0),this.boolean(v(this,gt,"f")),this.describe(v(this,gt,"f"),e),this}wrap(t){return h("",[t],arguments.length),v(this,pt,"f").wrap(t),this}[(z=new WeakMap,q=new WeakMap,W=new WeakMap,F=new WeakMap,U=new WeakMap,L=new WeakMap,V=new WeakMap,G=new WeakMap,R=new WeakMap,T=new WeakMap,K=new WeakMap,B=new WeakMap,Y=new WeakMap,J=new WeakMap,Z=new WeakMap,X=new WeakMap,Q=new WeakMap,tt=new WeakMap,et=new WeakMap,st=new WeakMap,it=new WeakMap,nt=new WeakMap,rt=new WeakMap,ot=new WeakMap,at=new WeakMap,ht=new WeakMap,lt=new WeakMap,ct=new WeakMap,ft=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,gt=new WeakMap,mt=new WeakMap,yt)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(t){}return t}[bt](){return{log:(...t)=>{this[Vt]()||console.log(...t),O(this,J,!0,"f"),v(this,tt,"f").length&&O(this,tt,v(this,tt,"f")+"\n","f"),O(this,tt,v(this,tt,"f")+t.join(" "),"f")},error:(...t)=>{this[Vt]()||console.error(...t),O(this,J,!0,"f"),v(this,tt,"f").length&&O(this,tt,v(this,tt,"f")+"\n","f"),O(this,tt,v(this,tt,"f")+t.join(" "),"f")}}}[vt](t){p(v(this,et,"f")).forEach((e=>{if("configObjects"===e)return;const s=v(this,et,"f")[e];Array.isArray(s)?s.includes(t)&&s.splice(s.indexOf(t),1):"object"==typeof s&&delete s[t]})),delete v(this,pt,"f").getDescriptions()[t]}[Ot](t,e,s){v(this,R,"f")[s]||(v(this,ct,"f").process.emitWarning(t,e),v(this,R,"f")[s]=!0)}[wt](){v(this,K,"f").push({options:v(this,et,"f"),configObjects:v(this,et,"f").configObjects.slice(0),exitProcess:v(this,T,"f"),groups:v(this,Y,"f"),strict:v(this,ft,"f"),strictCommands:v(this,dt,"f"),strictOptions:v(this,ut,"f"),completionCommand:v(this,U,"f"),output:v(this,tt,"f"),exitError:v(this,V,"f"),hasOutput:v(this,J,"f"),parsed:this.parsed,parseFn:v(this,nt,"f"),parseContext:v(this,rt,"f")}),v(this,pt,"f").freeze(),v(this,mt,"f").freeze(),v(this,z,"f").freeze(),v(this,B,"f").freeze()}[Ct](){let t,e="";return t=/\b(node|iojs|electron)(\.exe)?$/.test(v(this,ct,"f").process.argv()[0])?v(this,ct,"f").process.argv().slice(1,2):v(this,ct,"f").process.argv().slice(0,1),e=t.map((t=>{const e=this[Tt](v(this,q,"f"),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&e.lengthe.includes("package.json")?"package.json":void 0));d(i,void 0,v(this,ct,"f")),s=JSON.parse(v(this,ct,"f").readFileSync(i,"utf8"))}catch(t){}return v(this,ot,"f")[e]=s||{},v(this,ot,"f")[e]}[Et](t,e){(e=[].concat(e)).forEach((e=>{e=this[$t](e),v(this,et,"f")[t].push(e)}))}[At](t,e,s,i){this[St](t,e,s,i,((t,e,s)=>{v(this,et,"f")[t][e]=s}))}[Pt](t,e,s,i){this[St](t,e,s,i,((t,e,s)=>{v(this,et,"f")[t][e]=(v(this,et,"f")[t][e]||[]).concat(s)}))}[St](t,e,s,i,n){if(Array.isArray(s))s.forEach((e=>{t(e,i)}));else if((t=>"object"==typeof t)(s))for(const e of p(s))t(e,s[e]);else n(e,this[$t](s),i)}[$t](t){return"__proto__"===t?"___proto___":t}[It](t,e){return this[At](this[It].bind(this),"key",t,e),this}[Nt](){var t,e,s,i,n,r,o,a,h,l,c,f;const u=v(this,K,"f").pop();let p;d(u,void 0,v(this,ct,"f")),t=this,e=this,s=this,i=this,n=this,r=this,o=this,a=this,h=this,l=this,c=this,f=this,({options:{set value(e){O(t,et,e,"f")}}.value,configObjects:p,exitProcess:{set value(t){O(e,T,t,"f")}}.value,groups:{set value(t){O(s,Y,t,"f")}}.value,output:{set value(t){O(i,tt,t,"f")}}.value,exitError:{set value(t){O(n,V,t,"f")}}.value,hasOutput:{set value(t){O(r,J,t,"f")}}.value,parsed:this.parsed,strict:{set value(t){O(o,ft,t,"f")}}.value,strictCommands:{set value(t){O(a,dt,t,"f")}}.value,strictOptions:{set value(t){O(h,ut,t,"f")}}.value,completionCommand:{set value(t){O(l,U,t,"f")}}.value,parseFn:{set value(t){O(c,nt,t,"f")}}.value,parseContext:{set value(t){O(f,rt,t,"f")}}.value}=u),v(this,et,"f").configObjects=p,v(this,pt,"f").unfreeze(),v(this,mt,"f").unfreeze(),v(this,z,"f").unfreeze(),v(this,B,"f").unfreeze()}[Dt](t,e){return j(e,(e=>(t(e),e)))}getInternalMethods(){return{getCommandInstance:this[Ht].bind(this),getContext:this[zt].bind(this),getHasOutput:this[qt].bind(this),getLoggerInstance:this[Wt].bind(this),getParseContext:this[Ft].bind(this),getParserConfiguration:this[jt].bind(this),getUsageInstance:this[Ut].bind(this),getValidationInstance:this[Lt].bind(this),hasParseCallback:this[Vt].bind(this),isGlobalContext:this[Gt].bind(this),postProcess:this[Rt].bind(this),reset:this[Kt].bind(this),runValidation:this[Yt].bind(this),runYargsParserAndExecuteCommands:this[Bt].bind(this),setHasOutput:this[Jt].bind(this)}}[Ht](){return v(this,z,"f")}[zt](){return v(this,W,"f")}[qt](){return v(this,J,"f")}[Wt](){return v(this,Q,"f")}[Ft](){return v(this,rt,"f")||{}}[Ut](){return v(this,pt,"f")}[Lt](){return v(this,mt,"f")}[Vt](){return!!v(this,nt,"f")}[Gt](){return v(this,X,"f")}[Rt](t,e,s,i){if(s)return t;if(f(t))return t;e||(t=this[yt](t));return(this[jt]()["parse-positional-numbers"]||void 0===this[jt]()["parse-positional-numbers"])&&(t=this[kt](t)),i&&(t=C(t,this,v(this,B,"f").getMiddleware(),!1)),t}[Kt](t={}){O(this,et,v(this,et,"f")||{},"f");const e={};e.local=v(this,et,"f").local||[],e.configObjects=v(this,et,"f").configObjects||[];const s={};e.local.forEach((e=>{s[e]=!0,(t[e]||[]).forEach((t=>{s[t]=!0}))})),Object.assign(v(this,at,"f"),Object.keys(v(this,Y,"f")).reduce(((t,e)=>{const i=v(this,Y,"f")[e].filter((t=>!(t in s)));return i.length>0&&(t[e]=i),t}),{})),O(this,Y,{},"f");return["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach((t=>{e[t]=(v(this,et,"f")[t]||[]).filter((t=>!s[t]))})),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach((t=>{e[t]=g(v(this,et,"f")[t],(t=>!s[t]))})),e.envPrefix=v(this,et,"f").envPrefix,O(this,et,e,"f"),O(this,pt,v(this,pt,"f")?v(this,pt,"f").reset(s):P(this,v(this,ct,"f")),"f"),O(this,mt,v(this,mt,"f")?v(this,mt,"f").reset(s):function(t,e,s){const i=s.y18n.__,n=s.y18n.__n,r={nonOptionCount:function(s){const i=t.getDemandedCommands(),r=s._.length+(s["--"]?s["--"].length:0)-t.getInternalMethods().getContext().commands.length;i._&&(ri._.max)&&(ri._.max&&(void 0!==i._.maxMsg?e.fail(i._.maxMsg?i._.maxMsg.replace(/\$0/g,r.toString()).replace(/\$1/,i._.max.toString()):null):e.fail(n("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",r,r.toString(),i._.max.toString()))))},positionalCount:function(t,s){s{H.includes(e)||Object.prototype.hasOwnProperty.call(o,e)||Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),e)||r.isValidAndSomeAliasIsNotNew(e,i)||f.push(e)})),h&&(d.commands.length>0||c.length>0||a)&&s._.slice(d.commands.length).forEach((t=>{c.includes(""+t)||f.push(""+t)})),h){const e=(null===(l=t.getDemandedCommands()._)||void 0===l?void 0:l.max)||0,i=d.commands.length+e;i{t=String(t),d.commands.includes(t)||f.includes(t)||f.push(t)}))}f.length&&e.fail(n("Unknown argument: %s","Unknown arguments: %s",f.length,f.map((t=>t.trim()?t:`"${t}"`)).join(", ")))},unknownCommands:function(s){const i=t.getInternalMethods().getCommandInstance().getCommands(),r=[],o=t.getInternalMethods().getContext();return(o.commands.length>0||i.length>0)&&s._.slice(o.commands.length).forEach((t=>{i.includes(""+t)||r.push(""+t)})),r.length>0&&(e.fail(n("Unknown command: %s","Unknown commands: %s",r.length,r.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(e,s){if(!Object.prototype.hasOwnProperty.call(s,e))return!1;const i=t.parsed.newAliases;return[e,...s[e]].some((t=>!Object.prototype.hasOwnProperty.call(i,t)||!i[e]))},limitedChoices:function(s){const n=t.getOptions(),r={};if(!Object.keys(n.choices).length)return;Object.keys(s).forEach((t=>{-1===H.indexOf(t)&&Object.prototype.hasOwnProperty.call(n.choices,t)&&[].concat(s[t]).forEach((e=>{-1===n.choices[t].indexOf(e)&&void 0!==e&&(r[t]=(r[t]||[]).concat(e))}))}));const o=Object.keys(r);if(!o.length)return;let a=i("Invalid values:");o.forEach((t=>{a+=`\n ${i("Argument: %s, Given: %s, Choices: %s",t,e.stringifiedValues(r[t]),e.stringifiedValues(n.choices[t]))}`})),e.fail(a)}};let o={};function a(t,e){const s=Number(e);return"number"==typeof(e=isNaN(s)?e:s)?e=t._.length>=e:e.match(/^--no-.+/)?(e=e.match(/^--no-(.+)/)[1],e=!Object.prototype.hasOwnProperty.call(t,e)):e=Object.prototype.hasOwnProperty.call(t,e),e}r.implies=function(e,i){h(" [array|number|string]",[e,i],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.implies(t,e[t])})):(t.global(e),o[e]||(o[e]=[]),Array.isArray(i)?i.forEach((t=>r.implies(e,t))):(d(i,void 0,s),o[e].push(i)))},r.getImplied=function(){return o},r.implications=function(t){const s=[];if(Object.keys(o).forEach((e=>{const i=e;(o[e]||[]).forEach((e=>{let n=i;const r=e;n=a(t,n),e=a(t,e),n&&!e&&s.push(` ${i} -> ${r}`)}))})),s.length){let t=`${i("Implications failed:")}\n`;s.forEach((e=>{t+=e})),e.fail(t)}};let l={};r.conflicts=function(e,s){h(" [array|string]",[e,s],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.conflicts(t,e[t])})):(t.global(e),l[e]||(l[e]=[]),Array.isArray(s)?s.forEach((t=>r.conflicts(e,t))):l[e].push(s))},r.getConflicting=()=>l,r.conflicting=function(n){Object.keys(n).forEach((t=>{l[t]&&l[t].forEach((s=>{s&&void 0!==n[t]&&void 0!==n[s]&&e.fail(i("Arguments %s and %s are mutually exclusive",t,s))}))})),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach((t=>{l[t].forEach((r=>{r&&void 0!==n[s.Parser.camelCase(t)]&&void 0!==n[s.Parser.camelCase(r)]&&e.fail(i("Arguments %s and %s are mutually exclusive",t,r))}))}))},r.recommendCommands=function(t,s){s=s.sort(((t,e)=>e.length-t.length));let n=null,r=1/0;for(let e,i=0;void 0!==(e=s[i]);i++){const s=D(t,e);s<=3&&s!t[e])),l=g(l,(e=>!t[e])),r};const c=[];return r.freeze=function(){c.push({implied:o,conflicting:l})},r.unfreeze=function(){const t=c.pop();d(t,void 0,s),({implied:o,conflicting:l}=t)},r}(this,v(this,pt,"f"),v(this,ct,"f")),"f"),O(this,z,v(this,z,"f")?v(this,z,"f").reset():function(t,e,s,i){return new M(t,e,s,i)}(v(this,pt,"f"),v(this,mt,"f"),v(this,B,"f"),v(this,ct,"f")),"f"),v(this,F,"f")||O(this,F,function(t,e,s,i){return new N(t,e,s,i)}(this,v(this,pt,"f"),v(this,z,"f"),v(this,ct,"f")),"f"),v(this,B,"f").reset(),O(this,U,null,"f"),O(this,tt,"","f"),O(this,V,null,"f"),O(this,J,!1,"f"),this.parsed=!1,this}[Tt](t,e){return v(this,ct,"f").path.relative(t,e)}[Bt](t,s,i,n=0,r=!1){let o=!!i||r;t=t||v(this,ht,"f"),v(this,et,"f").__=v(this,ct,"f").y18n.__,v(this,et,"f").configuration=this[jt]();const a=!!v(this,et,"f").configuration["populate--"],h=Object.assign({},v(this,et,"f").configuration,{"populate--":!0}),l=v(this,ct,"f").Parser.detailed(t,Object.assign({},v(this,et,"f"),{configuration:{"parse-positional-numbers":!1,...h}})),c=Object.assign(l.argv,v(this,rt,"f"));let d;const u=l.aliases;let p=!1,g=!1;Object.keys(c).forEach((t=>{t===v(this,Z,"f")&&c[t]?p=!0:t===v(this,gt,"f")&&c[t]&&(g=!0)})),c.$0=this.$0,this.parsed=l,0===n&&v(this,pt,"f").clearCachedHelpMessage();try{if(this[_t](),s)return this[Rt](c,a,!!i,!1);if(v(this,Z,"f")){[v(this,Z,"f")].concat(u[v(this,Z,"f")]||[]).filter((t=>t.length>1)).includes(""+c._[c._.length-1])&&(c._.pop(),p=!0)}O(this,X,!1,"f");const h=v(this,z,"f").getCommands(),m=v(this,F,"f").completionKey in c,y=p||m||r;if(c._.length){if(h.length){let t;for(let e,s=n||0;void 0!==c._[s];s++){if(e=String(c._[s]),h.includes(e)&&e!==v(this,U,"f")){const t=v(this,z,"f").runCommand(e,this,l,s+1,r,p||g||r);return this[Rt](t,a,!!i,!1)}if(!t&&e!==v(this,U,"f")){t=e;break}}!v(this,z,"f").hasDefaultCommand()&&v(this,lt,"f")&&t&&!y&&v(this,mt,"f").recommendCommands(t,h)}v(this,U,"f")&&c._.includes(v(this,U,"f"))&&!m&&(v(this,T,"f")&&E(!0),this.showCompletionScript(),this.exit(0))}if(v(this,z,"f").hasDefaultCommand()&&!y){const t=v(this,z,"f").runCommand(null,this,l,0,r,p||g||r);return this[Rt](t,a,!!i,!1)}if(m){v(this,T,"f")&&E(!0);const s=(t=[].concat(t)).slice(t.indexOf(`--${v(this,F,"f").completionKey}`)+1);return v(this,F,"f").getCompletion(s,((t,s)=>{if(t)throw new e(t.message);(s||[]).forEach((t=>{v(this,Q,"f").log(t)})),this.exit(0)})),this[Rt](c,!a,!!i,!1)}if(v(this,J,"f")||(p?(v(this,T,"f")&&E(!0),o=!0,this.showHelp("log"),this.exit(0)):g&&(v(this,T,"f")&&E(!0),o=!0,v(this,pt,"f").showVersion("log"),this.exit(0))),!o&&v(this,et,"f").skipValidation.length>0&&(o=Object.keys(c).some((t=>v(this,et,"f").skipValidation.indexOf(t)>=0&&!0===c[t]))),!o){if(l.error)throw new e(l.error.message);if(!m){const t=this[Yt](u,{},l.error);i||(d=C(c,this,v(this,B,"f").getMiddleware(),!0)),d=this[Dt](t,null!=d?d:c),f(d)&&!i&&(d=d.then((()=>C(c,this,v(this,B,"f").getMiddleware(),!1))))}}}catch(t){if(!(t instanceof e))throw t;v(this,pt,"f").fail(t.message,t)}return this[Rt](null!=d?d:c,a,!!i,!0)}[Yt](t,s,i,n){const r={...this.getDemandedOptions()};return o=>{if(i)throw new e(i.message);v(this,mt,"f").nonOptionCount(o),v(this,mt,"f").requiredArguments(o,r);let a=!1;v(this,dt,"f")&&(a=v(this,mt,"f").unknownCommands(o)),v(this,ft,"f")&&!a?v(this,mt,"f").unknownArguments(o,t,s,!!n):v(this,ut,"f")&&v(this,mt,"f").unknownArguments(o,t,{},!1,!1),v(this,mt,"f").limitedChoices(o),v(this,mt,"f").implications(o),v(this,mt,"f").conflicting(o)}}[Jt](){O(this,J,!0,"f")}[Zt](t){if("string"==typeof t)v(this,et,"f").key[t]=!0;else for(const e of t)v(this,et,"f").key[e]=!0}}var Qt,te;const{readFileSync:ee}=require("fs"),{inspect:se}=require("util"),{resolve:ie}=require("path"),ne=require("y18n"),re=require("yargs-parser");var oe,ae={assert:{notStrictEqual:t.notStrictEqual,strictEqual:t.strictEqual},cliui:require("cliui"),findUp:require("escalade/sync"),getEnv:t=>process.env[t],getCallerFile:require("get-caller-file"),getProcessArgvBin:y,inspect:se,mainFilename:null!==(te=null===(Qt=null===require||void 0===require?void 0:require.main)||void 0===Qt?void 0:Qt.filename)&&void 0!==te?te:process.cwd(),Parser:re,path:require("path"),process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:t=>{process.exit(t)},nextTick:process.nextTick,stdColumns:void 0!==process.stdout.columns?process.stdout.columns:null},readFileSync:ee,require:require,requireDirectory:require("require-directory"),stringWidth:require("string-width"),y18n:ne({directory:ie(__dirname,"../locales"),updateFiles:!1})};const he=(null===(oe=null===process||void 0===process?void 0:process.env)||void 0===oe?void 0:oe.YARGS_MIN_NODE_VERSION)?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version){if(Number(process.version.match(/v([^.]+)/)[1]){const i=new Xt(t,e,s,ce);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}),argsert:h,isPromise:f,objFilter:g,parseCommand:o,Parser:le,processArgv:b,YError:e};module.exports=fe; diff --git a/shared/constants/app.js b/shared/constants/app.ts similarity index 95% rename from shared/constants/app.js rename to shared/constants/app.ts index bc27e0df1..496d48434 100644 --- a/shared/constants/app.js +++ b/shared/constants/app.ts @@ -6,9 +6,12 @@ import { RestrictedMethods } from './permissions'; * notification - When the extension opens due to interaction with a Web3 enabled website * fullscreen - When the user clicks 'expand view' to open the extension in a new tab * background - The background process that powers the extension - * - * @typedef {'popup' | 'notification' | 'fullscreen' | 'background'} EnvironmentType */ +export type EnvironmentType = + | 'popup' + | 'notification' + | 'fullscreen' + | 'background'; export const ENVIRONMENT_TYPE_POPUP = 'popup'; export const ENVIRONMENT_TYPE_NOTIFICATION = 'notification'; export const ENVIRONMENT_TYPE_FULLSCREEN = 'fullscreen'; @@ -23,7 +26,7 @@ export const BuildType = { beta: 'beta', flask: 'flask', main: 'main', -}; +} as const; export const PLATFORM_BRAVE = 'Brave'; export const PLATFORM_CHROME = 'Chrome'; @@ -52,7 +55,7 @@ export const MESSAGE_TYPE = { ///: BEGIN:ONLY_INCLUDE_IN(flask) SNAP_CONFIRM: RestrictedMethods.snap_confirm, ///: END:ONLY_INCLUDE_IN -}; +} as const; /** * The different kinds of subjects that MetaMask may interact with, including @@ -66,13 +69,13 @@ export const SUBJECT_TYPES = { ///: BEGIN:ONLY_INCLUDE_IN(flask) SNAP: 'snap', ///: END:ONLY_INCLUDE_IN -}; +} as const; export const POLLING_TOKEN_ENVIRONMENT_TYPES = { [ENVIRONMENT_TYPE_POPUP]: 'popupGasPollTokens', [ENVIRONMENT_TYPE_NOTIFICATION]: 'notificationGasPollTokens', [ENVIRONMENT_TYPE_FULLSCREEN]: 'fullScreenGasPollTokens', -}; +} as const; export const ORIGIN_METAMASK = 'metamask'; @@ -84,7 +87,7 @@ export const CHROME_BUILD_IDS = [ METAMASK_BETA_CHROME_ID, METAMASK_PROD_CHROME_ID, METAMASK_FLASK_CHROME_ID, -]; +] as const; const METAMASK_BETA_FIREFOX_ID = 'webextension-beta@metamask.io'; const METAMASK_PROD_FIREFOX_ID = 'webextension@metamask.io'; @@ -94,6 +97,6 @@ export const FIREFOX_BUILD_IDS = [ METAMASK_BETA_FIREFOX_ID, METAMASK_PROD_FIREFOX_ID, METAMASK_FLASK_FIREFOX_ID, -]; +] as const; export const UNKNOWN_TICKER_SYMBOL = 'UNKNOWN'; diff --git a/shared/constants/gas.js b/shared/constants/gas.js index 8954aa7cf..3c05247a4 100644 --- a/shared/constants/gas.js +++ b/shared/constants/gas.js @@ -1,7 +1,9 @@ import { addHexPrefix } from 'ethereumjs-util'; -import { MIN_GAS_LIMIT_HEX } from '../../ui/pages/send/send.constants'; const ONE_HUNDRED_THOUSAND = 100000; +const MIN_GAS_LIMIT_DEC = '21000'; + +export const MIN_GAS_LIMIT_HEX = parseInt(MIN_GAS_LIMIT_DEC, 10).toString(16); export const GAS_LIMITS = { // maximum gasLimit of a simple send diff --git a/shared/constants/metametrics.js b/shared/constants/metametrics.js index 16c0a2eb7..a994ec357 100644 --- a/shared/constants/metametrics.js +++ b/shared/constants/metametrics.js @@ -183,6 +183,7 @@ * @property {'theme'} THEME - when the user's theme changes we identify the theme trait * @property {'token_detection_enabled'} TOKEN_DETECTION_ENABLED - when token detection feature is toggled we * identify the token_detection_enabled trait + * @property {'install_date_ext'} INSTALL_DATE_EXT - when the user installed the extension */ /** @@ -192,6 +193,7 @@ export const TRAITS = { ADDRESS_BOOK_ENTRIES: 'address_book_entries', + INSTALL_DATE_EXT: 'install_date_ext', LEDGER_CONNECTION_TYPE: 'ledger_connection_type', NETWORKS_ADDED: 'networks_added', NETWORKS_WITHOUT_TICKER: 'networks_without_ticker', @@ -201,8 +203,8 @@ export const TRAITS = { NUMBER_OF_NFTS: 'number_of_nfts', NUMBER_OF_TOKENS: 'number_of_tokens', OPENSEA_API_ENABLED: 'opensea_api_enabled', - THREE_BOX_ENABLED: 'three_box_enabled', THEME: 'theme', + THREE_BOX_ENABLED: 'three_box_enabled', TOKEN_DETECTION_ENABLED: 'token_detection_enabled', }; @@ -262,7 +264,7 @@ export const METAMETRICS_BACKGROUND_PAGE_OBJECT = { * callback: (err?: Error) => void * ) => void} track - Track an event with Segment, using the internal batching * mechanism to optimize network requests - * @property {(payload: Object) => void} page - Track a page view with Segment + * @property {(payload: object) => void} page - Track a page view with Segment * @property {() => void} identify - Identify an anonymous user. We do not * currently use this method. */ @@ -276,19 +278,59 @@ export const REJECT_NOTFICIATION_CLOSE_SIG = */ export const EVENT_NAMES = { - ENCRYPTION_PUBLIC_KEY_APPROVED: 'Encryption Public Key Approved', - ENCRYPTION_PUBLIC_KEY_REJECTED: 'Encryption Public Key Rejected', - ENCRYPTION_PUBLIC_KEY_REQUESTED: 'Encryption Public Key Requested', + ACCOUNT_ADDED: 'Account Added', + ACCOUNT_ADD_SELECTED: 'Account Add Selected', + ACCOUNT_ADD_FAILED: 'Account Add Failed', + ACCOUNT_PASSWORD_CREATED: 'Wallet Password Created', + ACCOUNT_RESET: 'Account Reset', + APP_INSTALLED: 'App Installed', + APP_UNLOCKED: 'App Unlocked', + APP_UNLOCKED_FAILED: 'App Unlocked Failed', + APP_WINDOW_EXPANDED: 'App Window Expanded', DECRYPTION_APPROVED: 'Decryption Approved', DECRYPTION_REJECTED: 'Decryption Rejected', DECRYPTION_REQUESTED: 'Decryption Requested', + ENCRYPTION_PUBLIC_KEY_APPROVED: 'Encryption Approved', + ENCRYPTION_PUBLIC_KEY_REJECTED: 'Encryption Rejected', + ENCRYPTION_PUBLIC_KEY_REQUESTED: 'Encryption Requested', + EXTERNAL_LINK_CLICKED: 'External Link Clicked', + KEY_EXPORT_SELECTED: 'Key Export Selected', + KEY_EXPORT_REQUESTED: 'Key Export Requested', + KEY_EXPORT_FAILED: 'Key Export Failed', + KEY_EXPORT_CANCELED: 'Key Export Canceled', + KEY_EXPORT_REVEALED: 'Key Material Revealed', + KEY_EXPORT_COPIED: 'Key Material Copied', + METRICS_OPT_IN: 'Metrics Opt In', + METRICS_OPT_OUT: 'Metrics Opt Out', + NAV_ACCOUNT_MENU_OPENED: 'Account Menu Opened', + NAV_ACCOUNT_DETAILS_OPENED: 'Account Details Opened', + NAV_CONNECTED_SITES_OPENED: 'Connected Sites Opened', + NAV_MAIN_MENU_OPENED: 'Main Menu Opened', + NAV_NETWORK_MENU_OPENED: 'Network Menu Opened', + NAV_SETTINGS_OPENED: 'Settings Opened', + NAV_ACCOUNT_SWITCHED: 'Account Switched', + NAV_NETWORK_SWITCHED: 'Network Switched', + NAV_BUY_BUTTON_CLICKED: 'Buy Button Clicked', + NAV_SEND_BUTTON_CLICKED: 'Send Button Clicked', + NAV_SWAP_BUTTON_CLICKED: 'Swap Button Clicked', + SRP_TO_CONFIRM_BACKUP: 'SRP Backup Confirm Displayed', + WALLET_SETUP_STARTED: 'Wallet Setup Selected', + WALLET_SETUP_CANCELED: 'Wallet Setup Canceled', + WALLET_SETUP_FAILED: 'Wallet Setup Failed', + WALLET_CREATED: 'Wallet Created', + NFT_ADDED: 'NFT Added', + ONRAMP_PROVIDER_SELECTED: 'On-ramp Provider Selected', PERMISSIONS_APPROVED: 'Permissions Approved', PERMISSIONS_REJECTED: 'Permissions Rejected', PERMISSIONS_REQUESTED: 'Permissions Requested', + PUBLIC_ADDRESS_COPIED: 'Public Address Copied', PROVIDER_METHOD_CALLED: 'Provider Method Called', SIGNATURE_APPROVED: 'Signature Approved', SIGNATURE_REJECTED: 'Signature Rejected', SIGNATURE_REQUESTED: 'Signature Requested', + TOKEN_IMPORT_BUTTON_CLICKED: 'Import Token Button Clicked', + TOKEN_SCREEN_OPENED: 'Token Screen Opened', + SUPPORT_LINK_CLICKED: 'Support Link Clicked', TOKEN_ADDED: 'Token Added', TOKEN_DETECTED: 'Token Detected', TOKEN_HIDDEN: 'Token Hidden', @@ -297,11 +339,26 @@ export const EVENT_NAMES = { }; export const EVENT = { + ACCOUNT_TYPES: { + DEFAULT: 'metamask', + IMPORTED: 'imported', + HARDWARE: 'hardware', + }, + ACCOUNT_IMPORT_TYPES: { + JSON: 'json', + PRIVATE_KEY: 'private_key', + SRP: 'srp', + }, CATEGORIES: { ACCOUNTS: 'Accounts', + APP: 'App', AUTH: 'Auth', BACKGROUND: 'Background', + ERROR: 'Error', + FOOTER: 'Footer', + HOME: 'Home', INPAGE_PROVIDER: 'inpage_provider', + KEYS: 'Keys', MESSAGES: 'Messages', NAVIGATION: 'Navigation', NETWORK: 'Network', @@ -313,25 +370,52 @@ export const EVENT = { TRANSACTIONS: 'Transactions', WALLET: 'Wallet', }, + EXTERNAL_LINK_TYPES: { + TRANSACTION_BLOCK_EXPLORER: 'Transaction Block Explorer', + BLOCK_EXPLORER: 'Block Explorer', + ACCOUNT_TRACKER: 'Account Tracker', + TOKEN_TRACKER: 'Token Tracker', + }, + KEY_TYPES: { + PKEY: 'private_key', + SRP: 'srp', + }, + ONRAMP_PROVIDER_TYPES: { + COINBASE: 'coinbase', + MOONPAY: 'moonpay', + WYRE: 'wyre', + TRANSAK: 'transak', + SELF_DEPOSIT: 'direct_deposit', + }, SOURCE: { + NETWORK: { + CUSTOM_NETWORK_FORM: 'custom_network_form', + POPULAR_NETWORK_LIST: 'popular_network_list', + }, SWAPS: { MAIN_VIEW: 'Main View', TOKEN_VIEW: 'Token View', }, - TRANSACTION: { - USER: 'user', - DAPP: 'dapp', - }, TOKEN: { CUSTOM: 'custom', - DETECTED: 'detected', DAPP: 'dapp', + DETECTED: 'detected', LIST: 'list', }, + TRANSACTION: { + DAPP: 'dapp', + USER: 'user', + }, }, LOCATION: { + TOKEN_DETAILS: 'token_details', TOKEN_DETECTION: 'token_detection', TOKEN_MENU: 'token_menu', - TOKEN_DETAILS: 'token_details', }, }; + +// Values below (e.g. 'location') can be used in the "properties" +// tracking object as keys, e.g. { location: 'Home' } +export const CONTEXT_PROPS = { + PAGE_TITLE: 'location', +}; diff --git a/shared/constants/network.js b/shared/constants/network.js index ba43e13de..6891017d9 100644 --- a/shared/constants/network.js +++ b/shared/constants/network.js @@ -7,6 +7,7 @@ export const MAINNET = 'mainnet'; export const GOERLI = 'goerli'; export const LOCALHOST = 'localhost'; export const NETWORK_TYPE_RPC = 'rpc'; +export const HOMESTEAD = 'homestead'; export const MAINNET_NETWORK_ID = '1'; export const ROPSTEN_NETWORK_ID = '3'; @@ -55,7 +56,7 @@ export const FANTOM_DISPLAY_NAME = 'Fantom Opera'; export const HARMONY_DISPLAY_NAME = 'Harmony Mainnet Shard 0'; export const PALM_DISPLAY_NAME = 'Palm'; -const infuraProjectId = process.env.INFURA_PROJECT_ID; +export const infuraProjectId = process.env.INFURA_PROJECT_ID; export const getRpcUrl = ({ network, excludeProjectId = false }) => `https://${network}.infura.io/v3/${excludeProjectId ? '' : infuraProjectId}`; @@ -192,6 +193,13 @@ export const CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP = { [PALM_CHAIN_ID]: PALM_TOKEN_IMAGE_URL, }; +export const NETWORK_ID_TO_ETHERS_NETWORK_NAME_MAP = { + [ROPSTEN_NETWORK_ID]: ROPSTEN, + [RINKEBY_NETWORK_ID]: RINKEBY, + [GOERLI_NETWORK_ID]: GOERLI, + [MAINNET_NETWORK_ID]: HOMESTEAD, +}; + export const CHAIN_ID_TO_NETWORK_ID_MAP = Object.values( NETWORK_TYPE_TO_ID_MAP, ).reduce((chainIdToNetworkIdMap, { chainId, networkId }) => { diff --git a/shared/constants/permissions.js b/shared/constants/permissions.ts similarity index 85% rename from shared/constants/permissions.js rename to shared/constants/permissions.ts index 77df6431f..d2b04238d 100644 --- a/shared/constants/permissions.js +++ b/shared/constants/permissions.ts @@ -1,5 +1,5 @@ export const CaveatTypes = Object.freeze({ - restrictReturnedAccounts: 'restrictReturnedAccounts', + restrictReturnedAccounts: 'restrictReturnedAccounts' as const, }); export const RestrictedMethods = Object.freeze({ @@ -8,21 +8,22 @@ export const RestrictedMethods = Object.freeze({ snap_confirm: 'snap_confirm', snap_notify: 'snap_notify', snap_manageState: 'snap_manageState', + snap_getBip32Entropy: 'snap_getBip32Entropy', 'snap_getBip44Entropy_*': 'snap_getBip44Entropy_*', 'wallet_snap_*': 'wallet_snap_*', ///: END:ONLY_INCLUDE_IN -}); +} as const); ///: BEGIN:ONLY_INCLUDE_IN(flask) export const PermissionNamespaces = Object.freeze({ snap_getBip44Entropy_: 'snap_getBip44Entropy_*', wallet_snap_: 'wallet_snap_*', -}); +} as const); export const EndowmentPermissions = Object.freeze({ 'endowment:network-access': 'endowment:network-access', 'endowment:long-running': 'endowment:long-running', -}); +} as const); // Methods / permissions in external packages that we are temporarily excluding. export const ExcludedSnapPermissions = new Set([]); diff --git a/shared/constants/phishing.js b/shared/constants/phishing.js new file mode 100644 index 000000000..63dea3706 --- /dev/null +++ b/shared/constants/phishing.js @@ -0,0 +1,4 @@ +export const PHISHING_NEW_ISSUE_URLS = { + MetaMask: 'https://github.com/metamask/eth-phishing-detect/issues/new', + PhishFort: 'https://github.com/phishfort/phishfort-lists/issues/new', +}; diff --git a/shared/constants/time.js b/shared/constants/time.ts similarity index 100% rename from shared/constants/time.js rename to shared/constants/time.ts diff --git a/shared/constants/tokens.js b/shared/constants/tokens.js index 86a960a13..c846fff18 100644 --- a/shared/constants/tokens.js +++ b/shared/constants/tokens.js @@ -5,9 +5,9 @@ import contractMap from '@metamask/contract-metadata'; * `@metamask/contract-metadata`. Used primarily to validate if manually entered * contract addresses do not match one of our listed tokens */ -export const LISTED_CONTRACT_ADDRESSES = Object.keys( - contractMap, -).map((address) => address.toLowerCase()); +export const LISTED_CONTRACT_ADDRESSES = Object.keys(contractMap).map( + (address) => address.toLowerCase(), +); /** * @typedef {object} TokenDetails @@ -21,3 +21,21 @@ export const LISTED_CONTRACT_ADDRESSES = Object.keys( * asset. * @property {boolean} [isERC721] - True when the asset is a ERC721 token. */ +export const STATIC_MAINNET_TOKEN_LIST = Object.keys(contractMap).reduce( + (acc, base) => { + const { logo, ...tokenMetadata } = contractMap[base]; + return { + ...acc, + [base.toLowerCase()]: { + ...tokenMetadata, + address: base.toLowerCase(), + iconUrl: `images/contract/${logo}`, + aggregators: [], + }, + }; + }, + {}, +); + +export const TOKEN_API_METASWAP_CODEFI_URL = + 'https://token-api.metaswap.codefi.network/tokens/'; diff --git a/shared/constants/transaction.js b/shared/constants/transaction.js index 7e6e2ed8b..9564f066c 100644 --- a/shared/constants/transaction.js +++ b/shared/constants/transaction.js @@ -189,6 +189,24 @@ export const SMART_TRANSACTION_STATUSES = { SUCCESS: 'success', }; +/** + * Types that are specific to the transaction approval amount. + * + * @typedef {object} TransactionApprovalAmountType + * @property {'custom'} CUSTOM - The user has edited the token amount. + * @property {'revoke'} REVOKE - The selected amount (either CUSTOM or DAPP_PROPOSED) is 0. + * @property {'dapp_proposed'} DAPP_PROPOSED - The dapp proposed token amount. + */ + +/** + * @type {TransactionApprovalAmountType} + */ +export const TRANSACTION_APPROVAL_AMOUNT_TYPE = { + CUSTOM: 'custom', + REVOKE: 'revoke', + DAPP_PROPOSED: 'dapp_proposed', +}; + /** * Transaction Group Category is a MetaMask construct to categorize the intent * of a group of transactions for purposes of displaying in the UI @@ -252,8 +270,23 @@ export const TRANSACTION_GROUP_CATEGORIES = { * @property {number} id - An internally unique tx identifier. * @property {number} time - Time the transaction was first suggested, in unix * epoch time (ms). + * @property {string} contractMethodName - A string representing a name of + * transaction contract method. + * @property {string} customTokenAmount - The custom token amount is the amount + * set by the user + * @property {string} dappProposedTokenAmount - The dapp proposed token amount + * @property {string} currentTokenBalance - The balance of the token that is + * being send + * @property {string} originalApprovalAmount - The original approval amount + * is the originally dapp proposed token amount + * @property {string} finalApprovalAmount - The chosen amount which will be the + * same as the originally proposed token amount if the user does not edit the + * amount or will be a custom token amount set by the user * @property {TransactionTypeString} type - The type of transaction this txMeta * represents. + * @property {string} originalType - When we speed up a transaction, + * we set the type as Retry and we lose information about type of transaction + * that is being set up, so we use original type to track that information. * @property {TransactionStatusString} status - The current status of the * transaction. * @property {string} metamaskNetworkId - The transaction's network ID, used @@ -355,3 +388,36 @@ export const ASSET_TYPES = { COLLECTIBLE: 'COLLECTIBLE', UNKNOWN: 'UNKNOWN', }; + +export const ERC20 = 'ERC20'; +export const ERC721 = 'ERC721'; +export const ERC1155 = 'ERC1155'; + +/** + * @typedef {object} TokenStandards + * @property {'ERC20'} ERC20 - A token that conforms to the ERC20 standard. + * @property {'ERC721'} ERC721 - A token that conforms to the ERC721 standard. + * @property {'ERC1155'} ERC1155 - A token that conforms to the ERC1155 + * standard. + * @property {'NONE'} NONE - Not a token, but rather the base asset of the + * selected chain. + */ + +/** + * This type will work anywhere you expect a string that can be one of the + * above statuses + * + * @typedef {TokenStandards[keyof TokenStandards]} TokenStandardStrings + */ + +/** + * Describes the standard which a token conforms to. + * + * @type {TokenStandards} + */ +export const TOKEN_STANDARDS = { + ERC20, + ERC721, + ERC1155, + NONE: 'NONE', +}; diff --git a/shared/modules/contract-utils.test.js b/shared/modules/contract-utils.test.js index 602a2a3b3..ccdbf328c 100644 --- a/shared/modules/contract-utils.test.js +++ b/shared/modules/contract-utils.test.js @@ -19,12 +19,11 @@ describe('Contract Utils', () => { }, }; - const { - isContractAddress: isNotContractAddress, - } = await readAddressAsContract( - mockEthQuery, - '0x76B4aa9Fc4d351a0062c6af8d186DF959D564A84', - ); + const { isContractAddress: isNotContractAddress } = + await readAddressAsContract( + mockEthQuery, + '0x76B4aa9Fc4d351a0062c6af8d186DF959D564A84', + ); expect(isNotContractAddress).toStrictEqual(false); }); }); diff --git a/shared/modules/export-utils.js b/shared/modules/export-utils.js new file mode 100644 index 000000000..609c881c1 --- /dev/null +++ b/shared/modules/export-utils.js @@ -0,0 +1,19 @@ +import { getRandomFileName } from '../../ui/helpers/utils/util'; + +export function exportAsFile(filename, data, type = 'text/csv') { + // eslint-disable-next-line no-param-reassign + filename = filename || getRandomFileName(); + // source: https://stackoverflow.com/a/33542499 by Ludovic Feltz + const blob = new window.Blob([data], { type }); + if (window.navigator.msSaveOrOpenBlob) { + window.navigator.msSaveBlob(blob, filename); + } else { + const elem = window.document.createElement('a'); + elem.target = '_blank'; + elem.href = window.URL.createObjectURL(blob); + elem.download = filename; + document.body.appendChild(elem); + elem.click(); + document.body.removeChild(elem); + } +} diff --git a/shared/modules/fetch-with-timeout.js b/shared/modules/fetch-with-timeout.js index b12e8cba5..791470d77 100644 --- a/shared/modules/fetch-with-timeout.js +++ b/shared/modules/fetch-with-timeout.js @@ -1,6 +1,7 @@ import { memoize } from 'lodash'; +import { SECOND } from '../constants/time'; -const getFetchWithTimeout = memoize((timeout) => { +const getFetchWithTimeout = memoize((timeout = SECOND * 30) => { if (!Number.isInteger(timeout) || timeout < 1) { throw new Error('Must specify positive integer timeout.'); } diff --git a/shared/modules/fetch-with-timeout.test.js b/shared/modules/fetch-with-timeout.test.js index 8d7ae5785..2129db1c3 100644 --- a/shared/modules/fetch-with-timeout.test.js +++ b/shared/modules/fetch-with-timeout.test.js @@ -6,7 +6,7 @@ describe('getFetchWithTimeout', () => { it('fetches a url', async () => { nock('https://api.infura.io').get('/money').reply(200, '{"hodl": false}'); - const fetchWithTimeout = getFetchWithTimeout(SECOND * 30); + const fetchWithTimeout = getFetchWithTimeout(); const response = await ( await fetchWithTimeout('https://api.infura.io/money') ).json(); @@ -46,15 +46,9 @@ describe('getFetchWithTimeout', () => { }); it('throws on invalid timeout', async () => { - await expect(() => getFetchWithTimeout()).toThrow( - 'Must specify positive integer timeout.', - ); await expect(() => getFetchWithTimeout(-1)).toThrow( 'Must specify positive integer timeout.', ); - await expect(() => getFetchWithTimeout({})).toThrow( - 'Must specify positive integer timeout.', - ); await expect(() => getFetchWithTimeout(true)).toThrow( 'Must specify positive integer timeout.', ); diff --git a/shared/modules/hexstring-utils.js b/shared/modules/hexstring-utils.js index 0e13b8377..50b8a75d4 100644 --- a/shared/modules/hexstring-utils.js +++ b/shared/modules/hexstring-utils.js @@ -71,5 +71,5 @@ export function toChecksumHexAddress(address) { // closely mimics the original behavior. return hexPrefixed; } - return toChecksumAddress(addHexPrefix(address)); + return toChecksumAddress(hexPrefixed); } diff --git a/shared/modules/mv3.utils.js b/shared/modules/mv3.utils.js index a990075b6..3f9388b07 100644 --- a/shared/modules/mv3.utils.js +++ b/shared/modules/mv3.utils.js @@ -1,4 +1,4 @@ import browser from 'webextension-polyfill'; -export const isManifestV3 = () => +export const isManifestV3 = browser.runtime.getManifest().manifest_version === 3; diff --git a/shared/modules/object.utils.js b/shared/modules/object.utils.js index bce38cb9b..24119be56 100644 --- a/shared/modules/object.utils.js +++ b/shared/modules/object.utils.js @@ -8,7 +8,7 @@ * masked according to that sub-mask. * * @param {object} object - The object to mask - * @param {object} mask - The mask to apply to the object + * @param {Object} mask - The mask to apply to the object */ export function maskObject(object, mask) { return Object.keys(object).reduce((state, key) => { diff --git a/shared/modules/provider-injection.js b/shared/modules/provider-injection.js new file mode 100644 index 000000000..c2ce0ef7e --- /dev/null +++ b/shared/modules/provider-injection.js @@ -0,0 +1,93 @@ +/** + * Determines if the provider should be injected + * + * @returns {boolean} {@code true} Whether the provider should be injected + */ +export default function shouldInjectProvider() { + return ( + doctypeCheck() && + suffixCheck() && + documentElementCheck() && + !blockedDomainCheck() + ); +} + +/** + * Checks the doctype of the current document if it exists + * + * @returns {boolean} {@code true} if the doctype is html or if none exists + */ +function doctypeCheck() { + const { doctype } = window.document; + if (doctype) { + return doctype.name === 'html'; + } + return true; +} + +/** + * Returns whether or not the extension (suffix) of the current document is prohibited + * + * This checks {@code window.location.pathname} against a set of file extensions + * that we should not inject the provider into. This check is indifferent of + * query parameters in the location. + * + * @returns {boolean} whether or not the extension of the current document is prohibited + */ +function suffixCheck() { + const prohibitedTypes = [/\.xml$/u, /\.pdf$/u]; + const currentUrl = window.location.pathname; + for (let i = 0; i < prohibitedTypes.length; i++) { + if (prohibitedTypes[i].test(currentUrl)) { + return false; + } + } + return true; +} + +/** + * Checks the documentElement of the current document + * + * @returns {boolean} {@code true} if the documentElement is an html node or if none exists + */ +function documentElementCheck() { + const documentElement = document.documentElement.nodeName; + if (documentElement) { + return documentElement.toLowerCase() === 'html'; + } + return true; +} + +/** + * Checks if the current domain is blocked + * + * @returns {boolean} {@code true} if the current domain is blocked + */ +function blockedDomainCheck() { + const blockedDomains = [ + 'uscourts.gov', + 'dropbox.com', + 'webbyawards.com', + 'cdn.shopify.com/s/javascripts/tricorder/xtld-read-only-frame.html', + 'adyen.com', + 'gravityforms.com', + 'docs.google.com', + 'harbourair.com', + 'ani.gamer.com.tw', + 'blueskybooking.com', + 'sharefile.com', + ]; + const currentUrl = window.location.href; + let currentRegex; + for (let i = 0; i < blockedDomains.length; i++) { + const blockedDomain = blockedDomains[i].replace('.', '\\.'); + currentRegex = new RegExp( + `(?:https?:\\/\\/)(?:(?!${blockedDomain}).)*$`, + 'u', + ); + if (!currentRegex.test(currentUrl)) { + return true; + } + } + return false; +} diff --git a/shared/modules/rpc.utils.js b/shared/modules/rpc.utils.js index ab0c006b6..341ef1d97 100644 --- a/shared/modules/rpc.utils.js +++ b/shared/modules/rpc.utils.js @@ -1,7 +1,6 @@ -import { SECOND } from '../constants/time'; import getFetchWithTimeout from './fetch-with-timeout'; -const fetchWithTimeout = getFetchWithTimeout(SECOND * 30); +const fetchWithTimeout = getFetchWithTimeout(); /** * Makes a JSON RPC request to the given URL, with the given RPC method and params. diff --git a/shared/modules/siwe.js b/shared/modules/siwe.js new file mode 100644 index 000000000..4fa99457a --- /dev/null +++ b/shared/modules/siwe.js @@ -0,0 +1,150 @@ +import { stripHexPrefix } from 'ethereumjs-util'; +import { ParsedMessage } from '@spruceid/siwe-parser'; +import log from 'loglevel'; + +const msgHexToText = (hex) => { + try { + const stripped = stripHexPrefix(hex); + const buff = Buffer.from(stripped, 'hex'); + return buff.length === 32 ? hex : buff.toString('utf8'); + } catch (e) { + log.error(e); + return hex; + } +}; + +/** + * A locally defined object used to provide data to identify a Sign-In With Ethereum (SIWE)(EIP-4361) message and provide the parsed message + * + * @typedef localSIWEObject + * @param {boolean} isSIWEMessage - Does the intercepted message conform to the SIWE specification? + * @param {ParsedMessage} parsedMessage - The data parsed out of the message + */ + +/** + * This function intercepts a sign message, detects if it's a + * Sign-In With Ethereum (SIWE)(EIP-4361) message, and returns an object with + * relevant SIWE data. + * + * {@see {@link https://eips.ethereum.org/EIPS/eip-4361}} + * + * @param {object} msgParams - The params of the message to sign + * @returns {localSIWEObject} + */ +export const detectSIWE = (msgParams) => { + try { + const { data } = msgParams; + const message = msgHexToText(data); + const parsedMessage = new ParsedMessage(message); + + return { + isSIWEMessage: true, + parsedMessage, + }; + } catch (error) { + // ignore error, it's not a valid SIWE message + return { + isSIWEMessage: false, + parsedMessage: null, + }; + } +}; + +/** + * Takes in a parsed Sign-In with Ethereum Message (EIP-4361) + * and generates an array of label-value pairs + * + * @param {object} parsedMessage - A parsed SIWE message with message contents + * @param {Function} t - i18n function + * @returns {Array} An array of label-value pairs with the type of the value as the label + */ +export const formatMessageParams = (parsedMessage, t) => { + const output = []; + + const { + statement, + uri, + version, + chainId, + nonce, + issuedAt, + expirationTime, + notBefore, + requestId, + resources, + } = parsedMessage; + + if (statement) { + output.push({ + label: t('SIWELabelMessage'), + value: statement, + }); + } + + if (uri) { + output.push({ + label: t('SIWELabelURI'), + value: uri, + }); + } + + if (version) { + output.push({ + label: t('SIWELabelVersion'), + value: version, + }); + } + + if (chainId) { + output.push({ + label: t('SIWELabelChainID'), + value: chainId, + }); + } + + if (nonce) { + output.push({ + label: t('SIWELabelNonce'), + value: nonce, + }); + } + + if (issuedAt) { + output.push({ + label: t('SIWELabelIssuedAt'), + value: issuedAt, + }); + } + + if (expirationTime) { + output.push({ + label: t('SIWELabelExpirationTime'), + value: expirationTime, + }); + } + + if (notBefore) { + output.push({ + label: t('SIWELabelNotBefore'), + value: notBefore, + }); + } + + if (requestId) { + output.push({ + label: t('SIWELabelRequestID'), + value: requestId, + }); + } + + if (resources && resources.length > 0) { + output.push({ + label: t('SIWELabelResources', [resources.length]), + value: resources + .reduce((previous, resource) => `${previous}${resource}\n`, '') + .trim(), + }); + } + + return output; +}; diff --git a/shared/modules/string-utils.js b/shared/modules/string-utils.js index fc496227f..c8a1c0e87 100644 --- a/shared/modules/string-utils.js +++ b/shared/modules/string-utils.js @@ -4,3 +4,7 @@ export function isEqualCaseInsensitive(value1, value2) { } return value1.toLowerCase() === value2.toLowerCase(); } + +export function prependZero(num, maxLength) { + return num.toString().padStart(maxLength, '0'); +} diff --git a/shared/modules/transaction.utils.js b/shared/modules/transaction.utils.js index 9b04e6648..001b8beb8 100644 --- a/shared/modules/transaction.utils.js +++ b/shared/modules/transaction.utils.js @@ -2,8 +2,11 @@ import { isHexString } from 'ethereumjs-util'; import { ethers } from 'ethers'; import { abiERC721, abiERC20, abiERC1155 } from '@metamask/metamask-eth-abis'; import log from 'loglevel'; -import { TOKEN_STANDARDS } from '../../ui/helpers/constants/common'; -import { ASSET_TYPES, TRANSACTION_TYPES } from '../constants/transaction'; +import { + ASSET_TYPES, + TOKEN_STANDARDS, + TRANSACTION_TYPES, +} from '../constants/transaction'; import { readAddressAsContract } from './contract-utils'; import { isEqualCaseInsensitive } from './string-utils'; @@ -154,10 +157,8 @@ export async function determineTransactionType(txParams, query) { if (data && !to) { result = TRANSACTION_TYPES.DEPLOY_CONTRACT; } else { - const { - contractCode: resultCode, - isContractAddress, - } = await readAddressAsContract(query, to); + const { contractCode: resultCode, isContractAddress } = + await readAddressAsContract(query, to); contractCode = resultCode; diff --git a/shared/modules/transaction.utils.test.js b/shared/modules/transaction.utils.test.js index 6998022e4..906cdb2bb 100644 --- a/shared/modules/transaction.utils.test.js +++ b/shared/modules/transaction.utils.test.js @@ -149,8 +149,7 @@ describe('Transaction.utils', function () { const result = await determineTransactionType( { to: '0x9e673399f795D01116e9A8B2dD2F156705131ee9', - data: - '0xa9059cbb0000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C970000000000000000000000000000000000000000000000000000000000000000a', + data: '0xa9059cbb0000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C970000000000000000000000000000000000000000000000000000000000000000a', }, new EthQuery(_provider), ); @@ -174,8 +173,7 @@ describe('Transaction.utils', function () { const result = await determineTransactionType( { to: '0x9e673399f795D01116e9A8B2dD2F156705131ee9', - data: - '0xa9059cbb0000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C970000000000000000000000000000000000000000000000000000000000000000a', + data: '0xa9059cbb0000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C970000000000000000000000000000000000000000000000000000000000000000a', }, new EthQuery(_provider), ); @@ -199,8 +197,7 @@ describe('Transaction.utils', function () { const result = await determineTransactionType( { to: '0x9e673399f795D01116e9A8B2dD2F156705131ee9', - data: - '0x095ea7b30000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C9700000000000000000000000000000000000000000000000000000000000000005', + data: '0x095ea7b30000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C9700000000000000000000000000000000000000000000000000000000000000005', }, new EthQuery(_provider), ); diff --git a/shared/notifications/index.js b/shared/notifications/index.js index 65fc49fde..a721b2e00 100644 --- a/shared/notifications/index.js +++ b/shared/notifications/index.js @@ -66,9 +66,13 @@ export const UI_NOTIFICATIONS = { width: '100%', }, }, + 13: { + id: 13, + date: '2022-07-12', + }, }; -export const getTranslatedUINoficiations = (t, locale) => { +export const getTranslatedUINotifications = (t, locale) => { const formattedLocale = locale.replace('_', '-'); return { 1: { @@ -182,5 +186,14 @@ export const getTranslatedUINoficiations = (t, locale) => { new Date(UI_NOTIFICATIONS[12].date), ), }, + 13: { + ...UI_NOTIFICATIONS[13], + title: t('notifications13Title'), + description: t('notifications13Description'), + actionText: t('notifications13ActionText'), + date: new Intl.DateTimeFormat(formattedLocale).format( + new Date(UI_NOTIFICATIONS[13].date), + ), + }, }; }; diff --git a/test/data/mock-state.json b/test/data/mock-state.json index 231f05069..b378b37c4 100644 --- a/test/data/mock-state.json +++ b/test/data/mock-state.json @@ -8,7 +8,44 @@ "context": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc" } }, + "history": { + "mostRecentOverviewPage": "/" + }, "metamask": { + "gasFeeEstimates": { + "low": { + "suggestedMaxPriorityFeePerGas": "1.233864249", + "suggestedMaxFeePerGas": "19.308202033", + "minWaitTimeEstimate": 15000, + "maxWaitTimeEstimate": 30000 + }, + "medium": { + "suggestedMaxPriorityFeePerGas": "1.5", + "suggestedMaxFeePerGas": "25.900356008", + "minWaitTimeEstimate": 15000, + "maxWaitTimeEstimate": 45000 + }, + "high": { + "suggestedMaxPriorityFeePerGas": "2", + "suggestedMaxFeePerGas": "32.726374232", + "minWaitTimeEstimate": 15000, + "maxWaitTimeEstimate": 60000 + }, + "estimatedBaseFee": "18.074337783", + "historicalBaseFeeRange": ["10.621659703", "19.673392581"], + "baseFeeTrend": "up", + "latestPriorityFeeRange": ["1.5", "17.536644176"], + "historicalPriorityFeeRange": ["0.110624865", "718.303816711"], + "priorityFeeTrend": "up", + "networkCongestion": 0.87115 + }, + "preferences": { + "hideZeroBalanceTokens": false, + "showFiatInTestnets": false, + "showTestNetworks": true, + "useNativeCurrencyAsPrimaryCurrency": true + }, + "ensResolutionsByAddress": {}, "featureFlags": { "showIncomingTransactions": true }, @@ -37,6 +74,8 @@ "1559": true } }, + "frequentRpcListDetail": [], + "subjectMetadata": {}, "notifications": { "test": { "id": "test", diff --git a/test/e2e/benchmark.js b/test/e2e/benchmark.js old mode 100644 new mode 100755 index fe2dc7926..df4c95756 --- a/test/e2e/benchmark.js +++ b/test/e2e/benchmark.js @@ -1,12 +1,16 @@ #!/usr/bin/env node const path = require('path'); -const { promises: fs, constants: fsConstants } = require('fs'); +const { promises: fs } = require('fs'); const yargs = require('yargs/yargs'); const { hideBin } = require('yargs/helpers'); const ttest = require('ttest'); const { retry } = require('../../development/lib/retry'); const { exitWithError } = require('../../development/lib/exit-with-error'); +const { + isWritable, + getFirstParentDirectoryThatExists, +} = require('../helpers/file'); const { withFixtures, tinyDelayMs } = require('./helpers'); const { PAGES } = require('./webdriver/driver'); @@ -108,35 +112,6 @@ async function profilePageLoad(pages, numSamples, retries) { return results; } -async function isWritable(directory) { - try { - await fs.access(directory, fsConstants.W_OK); - return true; - } catch (error) { - if (error.code !== 'EACCES') { - throw error; - } - return false; - } -} - -async function getFirstParentDirectoryThatExists(directory) { - let nextDirectory = directory; - for (;;) { - try { - await fs.access(nextDirectory, fsConstants.F_OK); - return nextDirectory; - } catch (error) { - if (error.code !== 'ENOENT') { - throw error; - } else if (nextDirectory === path.dirname(nextDirectory)) { - throw new Error('Failed to find parent directory that exists'); - } - nextDirectory = path.dirname(nextDirectory); - } - } -} - async function main() { const { argv } = yargs(hideBin(process.argv)).usage( '$0 [options]', diff --git a/test/e2e/fixtures/address-entry/state.json b/test/e2e/fixtures/address-entry/state.json index 96b17cdb1..481be663a 100644 --- a/test/e2e/fixtures/address-entry/state.json +++ b/test/e2e/fixtures/address-entry/state.json @@ -67,8 +67,17 @@ "8": { "isShown": true }, + "10": { + "isShown": true + }, + "11": { + "isShown": true + }, "12": { "isShown": true + }, + "13": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/connected-state/state.json b/test/e2e/fixtures/connected-state/state.json index 4d48df472..3c1aa0039 100644 --- a/test/e2e/fixtures/connected-state/state.json +++ b/test/e2e/fixtures/connected-state/state.json @@ -57,8 +57,17 @@ "8": { "isShown": true }, + "10": { + "isShown": true + }, + "11": { + "isShown": true + }, "12": { "isShown": true + }, + "13": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/custom-rpc/state.json b/test/e2e/fixtures/custom-rpc/state.json index 222eb0159..28ca1894a 100644 --- a/test/e2e/fixtures/custom-rpc/state.json +++ b/test/e2e/fixtures/custom-rpc/state.json @@ -53,8 +53,17 @@ "8": { "isShown": true }, + "10": { + "isShown": true + }, + "11": { + "isShown": true + }, "12": { "isShown": true + }, + "13": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/custom-token/state.json b/test/e2e/fixtures/custom-token/state.json index ae1fcd1b4..4546a6ede 100644 --- a/test/e2e/fixtures/custom-token/state.json +++ b/test/e2e/fixtures/custom-token/state.json @@ -71,8 +71,17 @@ "8": { "isShown": true }, + "10": { + "isShown": true + }, + "11": { + "isShown": true + }, "12": { "isShown": true + }, + "13": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/eip-1559-v2-dapp/state.json b/test/e2e/fixtures/eip-1559-v2-dapp/state.json index 839484240..373645f1f 100644 --- a/test/e2e/fixtures/eip-1559-v2-dapp/state.json +++ b/test/e2e/fixtures/eip-1559-v2-dapp/state.json @@ -54,8 +54,17 @@ "8": { "isShown": true }, + "10": { + "isShown": true + }, + "11": { + "isShown": true + }, "12": { "isShown": true + }, + "13": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/eip-1559-v2/state.json b/test/e2e/fixtures/eip-1559-v2/state.json index 0c79d8c61..1346dea32 100644 --- a/test/e2e/fixtures/eip-1559-v2/state.json +++ b/test/e2e/fixtures/eip-1559-v2/state.json @@ -54,8 +54,17 @@ "8": { "isShown": true }, + "10": { + "isShown": true + }, + "11": { + "isShown": true + }, "12": { "isShown": true + }, + "13": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/import-ui/state.json b/test/e2e/fixtures/import-ui/state.json index 20c6bf87c..3d0c40c08 100644 --- a/test/e2e/fixtures/import-ui/state.json +++ b/test/e2e/fixtures/import-ui/state.json @@ -108,8 +108,17 @@ "8": { "isShown": true }, + "10": { + "isShown": true + }, + "11": { + "isShown": true + }, "12": { "isShown": true + }, + "13": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/imported-account/state.json b/test/e2e/fixtures/imported-account/state.json index cb5c96950..4506bac2d 100644 --- a/test/e2e/fixtures/imported-account/state.json +++ b/test/e2e/fixtures/imported-account/state.json @@ -53,8 +53,17 @@ "8": { "isShown": true }, + "10": { + "isShown": true + }, + "11": { + "isShown": true + }, "12": { "isShown": true + }, + "13": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/localization/state.json b/test/e2e/fixtures/localization/state.json index 4b32460b5..80f442a04 100644 --- a/test/e2e/fixtures/localization/state.json +++ b/test/e2e/fixtures/localization/state.json @@ -53,8 +53,17 @@ "8": { "isShown": true }, + "10": { + "isShown": true + }, + "11": { + "isShown": true + }, "12": { "isShown": true + }, + "13": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/metrics-enabled/state.json b/test/e2e/fixtures/metrics-enabled/state.json index 43b345204..a6c7d7be0 100644 --- a/test/e2e/fixtures/metrics-enabled/state.json +++ b/test/e2e/fixtures/metrics-enabled/state.json @@ -57,8 +57,17 @@ "8": { "isShown": true }, + "10": { + "isShown": true + }, + "11": { + "isShown": true + }, "12": { "isShown": true + }, + "13": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/navigate-transactions/state.json b/test/e2e/fixtures/navigate-transactions/state.json index 1613c7f58..1d654f7ac 100644 --- a/test/e2e/fixtures/navigate-transactions/state.json +++ b/test/e2e/fixtures/navigate-transactions/state.json @@ -53,8 +53,17 @@ "8": { "isShown": true }, + "10": { + "isShown": true + }, + "11": { + "isShown": true + }, "12": { "isShown": true + }, + "13": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/onboarding/state.json b/test/e2e/fixtures/onboarding/state.json index 6a4c94b96..a616fc720 100644 --- a/test/e2e/fixtures/onboarding/state.json +++ b/test/e2e/fixtures/onboarding/state.json @@ -28,8 +28,17 @@ }, "NotificationController": { "notifications": { + "10": { + "isShown": true + }, + "11": { + "isShown": true + }, "12": { "isShown": true + }, + "13": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/send-edit-v2/state.json b/test/e2e/fixtures/send-edit-v2/state.json index 9de073c00..14bc11d12 100644 --- a/test/e2e/fixtures/send-edit-v2/state.json +++ b/test/e2e/fixtures/send-edit-v2/state.json @@ -54,8 +54,17 @@ "8": { "isShown": true }, + "10": { + "isShown": true + }, + "11": { + "isShown": true + }, "12": { "isShown": true + }, + "13": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/send-edit/state.json b/test/e2e/fixtures/send-edit/state.json index 1272fbd04..5606126f8 100644 --- a/test/e2e/fixtures/send-edit/state.json +++ b/test/e2e/fixtures/send-edit/state.json @@ -54,8 +54,17 @@ "8": { "isShown": true }, + "10": { + "isShown": true + }, + "11": { + "isShown": true + }, "12": { "isShown": true + }, + "13": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/special-settings/state.json b/test/e2e/fixtures/special-settings/state.json index 6163d7621..668c4143f 100644 --- a/test/e2e/fixtures/special-settings/state.json +++ b/test/e2e/fixtures/special-settings/state.json @@ -55,6 +55,9 @@ }, "12": { "isShown": true + }, + "13": { + "isShown": true } } }, @@ -132,7 +135,7 @@ "useBlockie": false, "useNonceField": false, "usePhishDetect": true, - "useTokenDetection": true + "useTokenDetection": false }, "config": {}, "firstTimeInfo": { diff --git a/test/e2e/fixtures/threebox-enabled/state.json b/test/e2e/fixtures/threebox-enabled/state.json index 78b6f1226..44bc352a9 100644 --- a/test/e2e/fixtures/threebox-enabled/state.json +++ b/test/e2e/fixtures/threebox-enabled/state.json @@ -64,8 +64,17 @@ "8": { "isShown": true }, + "10": { + "isShown": true + }, + "11": { + "isShown": true + }, "12": { "isShown": true + }, + "13": { + "isShown": true } } }, diff --git a/test/e2e/ganache.js b/test/e2e/ganache.js index 68950a79c..107b879ed 100644 --- a/test/e2e/ganache.js +++ b/test/e2e/ganache.js @@ -19,6 +19,10 @@ class Ganache { await this._server.listen(port); } + getProvider() { + return this._server.provider; + } + async quit() { if (!this._server) { throw new Error('Server not running yet'); diff --git a/test/e2e/helpers.js b/test/e2e/helpers.js index 827d9752b..6dadb1e23 100644 --- a/test/e2e/helpers.js +++ b/test/e2e/helpers.js @@ -1,4 +1,5 @@ const path = require('path'); +const { promises: fs } = require('fs'); const BigNumber = require('bignumber.js'); const mockttp = require('mockttp'); const createStaticServer = require('../../development/create-static-server'); @@ -9,6 +10,7 @@ const FixtureServer = require('./fixture-server'); const PhishingWarningPageServer = require('./phishing-warning-page-server'); const { buildWebDriver } = require('./webdriver'); const { ensureXServerIsRunning } = require('./x-server'); +const GanacheSeeder = require('./seeder/ganache-seeder'); const tinyDelayMs = 200; const regularDelayMs = tinyDelayMs * 2; @@ -16,6 +18,11 @@ const largeDelayMs = regularDelayMs * 2; const veryLargeDelayMs = largeDelayMs * 2; const dappBasePort = 8080; +const createDownloadFolder = async (downloadsFolder) => { + await fs.rm(downloadsFolder, { recursive: true, force: true }); + await fs.mkdir(downloadsFolder, { recursive: true }); +}; + const convertToHexValue = (val) => `0x${new BigNumber(val, 10).toString(16)}`; async function withFixtures(options, testSuite) { @@ -23,6 +30,7 @@ async function withFixtures(options, testSuite) { dapp, fixtures, ganacheOptions, + smartContract, driverOptions, dappOptions, title, @@ -46,6 +54,14 @@ async function withFixtures(options, testSuite) { let failed = false; try { await ganacheServer.start(ganacheOptions); + let contractRegistry; + + if (smartContract) { + const ganacheSeeder = new GanacheSeeder(ganacheServer.getProvider()); + await ganacheSeeder.deploySmartContract(smartContract); + contractRegistry = ganacheSeeder.getContractRegistry(); + } + if (ganacheOptions?.concurrent) { const { port, chainId } = ganacheOptions.concurrent; secondaryGanacheServer = new Ganache(); @@ -100,6 +116,7 @@ async function withFixtures(options, testSuite) { await testSuite({ driver, mockServer, + contractRegistry, }); if (process.env.SELENIUM_BROWSER === 'chrome') { @@ -319,4 +336,5 @@ module.exports = { connectDappWithExtensionPopup, completeImportSRPOnboardingFlow, completeImportSRPOnboardingFlowWordByWord, + createDownloadFolder, }; diff --git a/test/e2e/lavamoat-stats.js b/test/e2e/lavamoat-stats.js new file mode 100755 index 000000000..4abf00a68 --- /dev/null +++ b/test/e2e/lavamoat-stats.js @@ -0,0 +1,140 @@ +#!/usr/bin/env node + +/* eslint-disable node/shebang */ +const path = require('path'); +const { promises: fs, constants: fsConstants } = require('fs'); +const yargs = require('yargs/yargs'); +const { hideBin } = require('yargs/helpers'); +const { exitWithError } = require('../../development/lib/exit-with-error'); +const { withFixtures, tinyDelayMs } = require('./helpers'); + +async function measurePage() { + let metrics; + try { + await withFixtures({ fixtures: 'imported-account' }, async ({ driver }) => { + await driver.delay(tinyDelayMs); + await driver.navigate(); + await driver.findElement('#password'); + await driver.delay(1000); + const logs = await driver.checkBrowserForLavamoatLogs(); + + let logString = ''; + let inObject = false; + + const parsedLogs = []; + + logs.forEach((log) => { + if (log.indexOf('"version": 1') >= 0) { + logString += log; + parsedLogs.push(`{${logString}}`); + logString = ''; + inObject = false; + } else if (inObject) { + logString += log; + } else if ( + log.search(/"name": ".*app\/scripts\/background.js",/u) >= 0 || + log.search(/"name": ".*app\/scripts\/ui.js",/u) >= 0 + ) { + logString += log; + inObject = true; + } + }); + + metrics = parsedLogs.map((pl) => JSON.parse(pl)); + }); + } catch (error) { + // do nothing + } + return metrics; +} + +async function profilePageLoad() { + const results = await measurePage(); + const metrics = {}; + + metrics['background.js'] = results[0]; + metrics['ui.js'] = results[1]; + + return metrics; +} + +async function isWritable(directory) { + try { + await fs.access(directory, fsConstants.W_OK); + return true; + } catch (error) { + if (error.code !== 'EACCES') { + throw error; + } + return false; + } +} + +async function getFirstParentDirectoryThatExists(directory) { + let nextDirectory = directory; + for (;;) { + try { + await fs.access(nextDirectory, fsConstants.F_OK); + return nextDirectory; + } catch (error) { + if (error.code !== 'ENOENT') { + throw error; + } else if (nextDirectory === path.dirname(nextDirectory)) { + throw new Error('Failed to find parent directory that exists'); + } + nextDirectory = path.dirname(nextDirectory); + } + } +} + +async function main() { + const { argv } = yargs(hideBin(process.argv)).usage( + '$0 [options]', + 'Run a page load benchmark', + (_yargs) => + _yargs.option('out', { + description: + 'Output filename. Output printed to STDOUT of this is omitted.', + type: 'string', + normalize: true, + }), + ); + + const { out } = argv; + + let outputDirectory; + let existingParentDirectory; + if (out) { + outputDirectory = path.dirname(out); + existingParentDirectory = await getFirstParentDirectoryThatExists( + outputDirectory, + ); + if (!(await isWritable(existingParentDirectory))) { + throw new Error('Specified output file directory is not writable'); + } + } + + const results = await profilePageLoad(); + + if (out) { + if (outputDirectory !== existingParentDirectory) { + await fs.mkdir(outputDirectory, { recursive: true }); + } + + await fs.writeFile( + path.join(out, 'background.json'), + JSON.stringify(results['background.js'], null, 2), + ); + + await fs.writeFile( + path.join(out, 'ui.json'), + JSON.stringify(results['ui.js'], null, 2), + ); + } else { + console.log(JSON.stringify(results, null, 2)); + } +} + +main().catch((error) => { + exitWithError(error); +}); diff --git a/test/e2e/metamask-ui.spec.js b/test/e2e/metamask-ui.spec.js index 9e85bff84..88423ab41 100644 --- a/test/e2e/metamask-ui.spec.js +++ b/test/e2e/metamask-ui.spec.js @@ -105,7 +105,7 @@ describe('MetaMask', function () { }); it('clicks the "Create New Wallet" option', async function () { - await driver.clickElement({ text: 'Create a Wallet', tag: 'button' }); + await driver.clickElement({ text: 'Create a wallet', tag: 'button' }); await driver.delay(largeDelayMs); }); @@ -307,7 +307,7 @@ describe('MetaMask', function () { it('picks the newly created Test token', async function () { await driver.clickElement({ - text: 'Custom Token', + text: 'Custom token', tag: 'button', }); await driver.delay(regularDelayMs); @@ -315,10 +315,10 @@ describe('MetaMask', function () { await driver.fill('#custom-address', tokenAddress); await driver.delay(regularDelayMs); - await driver.clickElement({ text: 'Add Custom Token', tag: 'button' }); + await driver.clickElement({ text: 'Add custom token', tag: 'button' }); await driver.delay(regularDelayMs); - await driver.clickElement({ text: 'Import Tokens', tag: 'button' }); + await driver.clickElement({ text: 'Import tokens', tag: 'button' }); await driver.delay(regularDelayMs); }); @@ -405,8 +405,7 @@ describe('MetaMask', function () { it('finds the transaction in the transactions list', async function () { await driver.waitForSelector( { - css: - '.transaction-list__completed-transactions .transaction-list-item__primary-currency', + css: '.transaction-list__completed-transactions .transaction-list-item__primary-currency', text: '-1 TST', }, { timeout: 10000 }, @@ -488,8 +487,7 @@ describe('MetaMask', function () { it('finds the transaction in the transactions list', async function () { await driver.waitForSelector({ - css: - '.transaction-list__completed-transactions .transaction-list-item__primary-currency', + css: '.transaction-list__completed-transactions .transaction-list-item__primary-currency', text: '-1.5 TST', }); @@ -545,8 +543,7 @@ describe('MetaMask', function () { await driver.waitForSelector({ // Selects only the very first transaction list item immediately following the 'Pending' header - css: - '.transaction-list__pending-transactions .transaction-list__header + .transaction-list-item .list-item__heading', + css: '.transaction-list__pending-transactions .transaction-list__header + .transaction-list-item .list-item__heading', text: 'Approve TST spend limit', }); @@ -638,8 +635,7 @@ describe('MetaMask', function () { it('finds the transaction in the transactions list', async function () { await driver.waitForSelector({ // Select only the heading of the first entry in the transaction list. - css: - '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading', + css: '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading', text: 'Approve TST spend limit', }); }); @@ -691,14 +687,12 @@ describe('MetaMask', function () { await driver.waitForSelector({ // Select the heading of the first transaction list item in the // completed transaction list with text matching Send TST - css: - '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading', + css: '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading', text: 'Send TST', }); await driver.waitForSelector({ - css: - '.transaction-list__completed-transactions .transaction-list-item:first-child .transaction-list-item__primary-currency', + css: '.transaction-list__completed-transactions .transaction-list-item:first-child .transaction-list-item__primary-currency', text: '-1.5 TST', }); }); @@ -735,8 +729,7 @@ describe('MetaMask', function () { await driver.waitForSelector({ // Selects only the very first transaction list item immediately following the 'Pending' header - css: - '.transaction-list__pending-transactions .transaction-list__header + .transaction-list-item .list-item__heading', + css: '.transaction-list__pending-transactions .transaction-list__header + .transaction-list-item .list-item__heading', text: 'Approve TST spend limit', }); @@ -760,8 +753,7 @@ describe('MetaMask', function () { it('finds the transaction in the transactions list', async function () { await driver.waitForSelector({ - css: - '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading', + css: '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading', text: 'Approve TST spend limit', }); }); diff --git a/test/e2e/mock-e2e.js b/test/e2e/mock-e2e.js index 99f5c6e57..ac2121e20 100644 --- a/test/e2e/mock-e2e.js +++ b/test/e2e/mock-e2e.js @@ -176,6 +176,47 @@ async function setupMocking(server, testSpecificMock) { }; }); + await server + .forGet('https://token-api.metaswap.codefi.network/token/0x539') + .thenCallback(() => { + return { + statusCode: 200, + json: {}, + }; + }); + + await server + .forGet( + 'https://static.metaswap.codefi.network/api/v1/tokenIcons/1337/0x0d8775f648430679a709e98d2b0cb6250d2887ef.png', + ) + .thenCallback(() => { + return { + statusCode: 200, + }; + }); + + await server + .forGet( + 'https://static.metaswap.codefi.network/api/v1/tokenIcons/1337/0x2efa2cb29c2341d8e5ba7d3262c9e9d6f1bf3711.png', + ) + .thenCallback(() => { + return { + statusCode: 200, + }; + }); + + await server + .forGet('https://min-api.cryptocompare.com/data/price') + .withQuery({ fsym: 'ETH', tsyms: 'USD' }) + .thenCallback(() => { + return { + statusCode: 200, + json: { + USD: '1700', + }, + }; + }); + testSpecificMock(server); } diff --git a/test/e2e/mv3-perf-stats/bundle-size.js b/test/e2e/mv3-perf-stats/bundle-size.js new file mode 100755 index 000000000..d7360ab9d --- /dev/null +++ b/test/e2e/mv3-perf-stats/bundle-size.js @@ -0,0 +1,131 @@ +#!/usr/bin/env node + +/* eslint-disable node/shebang */ +const path = require('path'); +const { promises: fs } = require('fs'); +const yargs = require('yargs/yargs'); +const { hideBin } = require('yargs/helpers'); +const { + isWritable, + getFirstParentDirectoryThatExists, +} = require('../../helpers/file'); + +const { exitWithError } = require('../../../development/lib/exit-with-error'); + +/** + * The e2e test case is used to capture bundle time statistics for extension. + */ + +const backgroundFiles = [ + 'runtime-lavamoat.js', + 'lockdown-more.js', + 'globalthis.js', + 'sentry-install.js', + 'policy-load.js', +]; + +const uiFiles = [ + 'globalthis.js', + 'sentry-install.js', + 'runtime-lavamoat.js', + 'lockdown-more.js', + 'policy-load.js', +]; + +const BackgroundFileRegex = /background-[0-9]*.js/u; +const CommonFileRegex = /common-[0-9]*.js/u; +const UIFileRegex = /ui-[0-9]*.js/u; + +async function main() { + const { argv } = yargs(hideBin(process.argv)).usage( + '$0 [options]', + 'Run a page load benchmark', + (_yargs) => + _yargs.option('out', { + description: + 'Output filename. Output printed to STDOUT of this is omitted.', + type: 'string', + normalize: true, + }), + ); + const { out } = argv; + + const distFolder = 'dist/chrome'; + const backgroundFileList = []; + const uiFileList = []; + + const files = await fs.readdir(distFolder); + for (let i = 0; i < files.length; i++) { + const file = files[i]; + if (CommonFileRegex.test(file)) { + const stats = await fs.stat(`${distFolder}/${file}`); + backgroundFileList.push({ name: file, size: stats.size }); + uiFileList.push({ name: file, size: stats.size }); + } else if ( + backgroundFiles.includes(file) || + BackgroundFileRegex.test(file) + ) { + const stats = await fs.stat(`${distFolder}/${file}`); + backgroundFileList.push({ name: file, size: stats.size }); + } else if (uiFiles.includes(file) || UIFileRegex.test(file)) { + const stats = await fs.stat(`${distFolder}/${file}`); + uiFileList.push({ name: file, size: stats.size }); + } + } + + const backgroundBundleSize = backgroundFileList.reduce( + (result, file) => result + file.size, + 0, + ); + + const uiBundleSize = uiFileList.reduce( + (result, file) => result + file.size, + 0, + ); + + const result = { + background: { + name: 'background', + size: backgroundBundleSize, + fileList: backgroundFileList, + }, + ui: { + name: 'ui', + size: uiBundleSize, + fileList: uiFileList, + }, + }; + + if (out) { + const outPath = `${out}/bundle_size.json`; + const outputDirectory = path.dirname(outPath); + const existingParentDirectory = await getFirstParentDirectoryThatExists( + outputDirectory, + ); + if (!(await isWritable(existingParentDirectory))) { + throw new Error('Specified output file directory is not writable'); + } + if (outputDirectory !== existingParentDirectory) { + await fs.mkdir(outputDirectory, { recursive: true }); + } + await fs.writeFile(outPath, JSON.stringify(result, null, 2)); + await fs.writeFile( + `${out}/bundle_size_stats.json`, + JSON.stringify( + { + background: backgroundBundleSize, + ui: uiBundleSize, + timestamp: new Date().getTime(), + }, + null, + 2, + ), + ); + } else { + console.log(JSON.stringify(result, null, 2)); + } +} + +main().catch((error) => { + exitWithError(error); +}); diff --git a/test/e2e/mv3-perf-stats/index.js b/test/e2e/mv3-perf-stats/index.js new file mode 100644 index 000000000..4e56a2385 --- /dev/null +++ b/test/e2e/mv3-perf-stats/index.js @@ -0,0 +1,2 @@ +require('./init-load-stats'); +require('./bundle-size'); diff --git a/test/e2e/mv3-perf-stats/init-load-stats.js b/test/e2e/mv3-perf-stats/init-load-stats.js new file mode 100755 index 000000000..de5194031 --- /dev/null +++ b/test/e2e/mv3-perf-stats/init-load-stats.js @@ -0,0 +1,111 @@ +#!/usr/bin/env node + +/* eslint-disable node/shebang */ +const path = require('path'); +const { promises: fs } = require('fs'); +const yargs = require('yargs/yargs'); +const { hideBin } = require('yargs/helpers'); + +const { exitWithError } = require('../../../development/lib/exit-with-error'); +const { + isWritable, + getFirstParentDirectoryThatExists, +} = require('../../helpers/file'); +const { withFixtures, tinyDelayMs } = require('../helpers'); + +/** + * The e2e test case is used to capture load and initialisation time statistics for extension in MV3 environment. + */ + +async function profilePageLoad() { + const parsedLogs = {}; + try { + await withFixtures({ fixtures: 'imported-account' }, async ({ driver }) => { + await driver.delay(tinyDelayMs); + await driver.navigate(); + await driver.delay(1000); + const logs = await driver.checkBrowserForLavamoatLogs(); + + let logString = ''; + let logType = ''; + + logs.forEach((log) => { + if (log.indexOf('"version": 1') >= 0) { + // log end here + logString += log; + parsedLogs[logType] = JSON.parse(`{${logString}}`); + logString = ''; + logType = ''; + } else if (logType) { + // log string continues + logString += log; + } else if ( + log.search(/"name": ".*app\/scripts\/background.js",/u) >= 0 + ) { + // background log starts + logString += log; + logType = 'background'; + } else if (log.search(/"name": ".*app\/scripts\/ui.js",/u) >= 0) { + // ui log starts + logString += log; + logType = 'ui'; + } else if (log.search(/"name": "Total"/u) >= 0) { + // load time log starts + logString += log; + logType = 'loadTime'; + } + }); + }); + } catch (error) { + console.log('Error in trying to parse logs.'); + } + return parsedLogs; +} + +async function main() { + const { argv } = yargs(hideBin(process.argv)).usage( + '$0 [options]', + 'Run a page load benchmark', + (_yargs) => + _yargs.option('out', { + description: + 'Output filename. Output printed to STDOUT of this is omitted.', + type: 'string', + normalize: true, + }), + ); + + const results = await profilePageLoad(); + const { out } = argv; + + const logCategories = [ + { key: 'background', dirPath: 'initialisation/background/stacks.json' }, + { key: 'ui', dirPath: 'initialisation/ui/stacks.json' }, + { key: 'loadTime', dirPath: 'load_time/stats.json' }, + ]; + + if (out) { + logCategories.forEach(async ({ key, dirPath }) => { + if (results[key]) { + const outPath = `${out}/${dirPath}`; + const outputDirectory = path.dirname(outPath); + const existingParentDirectory = await getFirstParentDirectoryThatExists( + outputDirectory, + ); + if (!(await isWritable(existingParentDirectory))) { + throw new Error('Specified output file directory is not writable'); + } + if (outputDirectory !== existingParentDirectory) { + await fs.mkdir(outputDirectory, { recursive: true }); + } + await fs.writeFile(outPath, JSON.stringify(results[key], null, 2)); + } + }); + } else { + console.log(JSON.stringify(results, null, 2)); + } +} + +main().catch((error) => { + exitWithError(error); +}); diff --git a/test/e2e/mv3-stats.js b/test/e2e/mv3-stats.js new file mode 100755 index 000000000..8e8180e02 --- /dev/null +++ b/test/e2e/mv3-stats.js @@ -0,0 +1,111 @@ +#!/usr/bin/env node + +/* eslint-disable node/shebang */ +const path = require('path'); +const { promises: fs } = require('fs'); +const yargs = require('yargs/yargs'); +const { hideBin } = require('yargs/helpers'); + +const { exitWithError } = require('../../development/lib/exit-with-error'); +const { + isWritable, + getFirstParentDirectoryThatExists, +} = require('../helpers/file'); +const { withFixtures, tinyDelayMs } = require('./helpers'); + +/** + * The e2e test case is used to capture load and initialisation time statistics for extension in MV3 environment. + */ + +async function profilePageLoad() { + const parsedLogs = {}; + try { + await withFixtures({ fixtures: 'imported-account' }, async ({ driver }) => { + await driver.delay(tinyDelayMs); + await driver.navigate(); + await driver.delay(1000); + const logs = await driver.checkBrowserForLavamoatLogs(); + + let logString = ''; + let logType = ''; + + logs.forEach((log) => { + if (log.indexOf('"version": 1') >= 0) { + // log end here + logString += log; + parsedLogs[logType] = JSON.parse(`{${logString}}`); + logString = ''; + logType = ''; + } else if (logType) { + // log string continues + logString += log; + } else if ( + log.search(/"name": ".*app\/scripts\/background.js",/u) >= 0 + ) { + // background log starts + logString += log; + logType = 'background'; + } else if (log.search(/"name": ".*app\/scripts\/ui.js",/u) >= 0) { + // ui log starts + logString += log; + logType = 'ui'; + } else if (log.search(/"name": "Total"/u) >= 0) { + // load time log starts + logString += log; + logType = 'loadTime'; + } + }); + }); + } catch (error) { + console.log('Error in trying to parse logs.'); + } + return parsedLogs; +} + +async function main() { + const { argv } = yargs(hideBin(process.argv)).usage( + '$0 [options]', + 'Run a page load benchmark', + (_yargs) => + _yargs.option('out', { + description: + 'Output filename. Output printed to STDOUT of this is omitted.', + type: 'string', + normalize: true, + }), + ); + + const results = await profilePageLoad(); + const { out } = argv; + + const logCategories = [ + { key: 'background', dirPath: 'initialisation/background/stacks.json' }, + { key: 'ui', dirPath: 'initialisation/ui/stacks.json' }, + { key: 'loadTime', dirPath: 'load_time/stats.json' }, + ]; + + if (out) { + logCategories.forEach(async ({ key, dirPath }) => { + if (results[key]) { + const outPath = `${out}/${dirPath}`; + const outputDirectory = path.dirname(outPath); + const existingParentDirectory = await getFirstParentDirectoryThatExists( + outputDirectory, + ); + if (!(await isWritable(existingParentDirectory))) { + throw new Error('Specified output file directory is not writable'); + } + if (outputDirectory !== existingParentDirectory) { + await fs.mkdir(outputDirectory, { recursive: true }); + } + await fs.writeFile(outPath, JSON.stringify(results[key], null, 2)); + } + }); + } else { + console.log(JSON.stringify(results, null, 2)); + } +} + +main().catch((error) => { + exitWithError(error); +}); diff --git a/test/e2e/run-e2e-test.js b/test/e2e/run-e2e-test.js index 195ec41b6..043f061db 100644 --- a/test/e2e/run-e2e-test.js +++ b/test/e2e/run-e2e-test.js @@ -70,10 +70,12 @@ async function main() { } let testTimeoutInMilliseconds = 60 * 1000; + let exit = '--exit'; if (leaveRunning) { process.env.E2E_LEAVE_RUNNING = 'true'; testTimeoutInMilliseconds = 0; + exit = '--no-exit'; } await retry({ retries }, async () => { @@ -83,6 +85,7 @@ async function main() { '--timeout', testTimeoutInMilliseconds, e2eTestPath, + exit, ]); }); } diff --git a/test/e2e/seeder/ganache-contract-address-registry.js b/test/e2e/seeder/ganache-contract-address-registry.js new file mode 100644 index 000000000..bfad708d3 --- /dev/null +++ b/test/e2e/seeder/ganache-contract-address-registry.js @@ -0,0 +1,28 @@ +/* + * Use this class to store pre-deployed smart contract addresses of the contracts deployed to + * a local blockchain instance ran by Ganache. + */ +class GanacheContractAddressRegistry { + #addresses = {}; + + /** + * Store new contract address in key:value pair. + * + * @param contractName + * @param contractAddress + */ + storeNewContractAddress(contractName, contractAddress) { + this.#addresses[contractName] = contractAddress; + } + + /** + * Get deployed contract address by its name (key). + * + * @param contractName + */ + getContractAddress(contractName) { + return this.#addresses[contractName]; + } +} + +module.exports = GanacheContractAddressRegistry; diff --git a/test/e2e/seeder/ganache-seeder.js b/test/e2e/seeder/ganache-seeder.js new file mode 100644 index 000000000..0eaa7ae32 --- /dev/null +++ b/test/e2e/seeder/ganache-seeder.js @@ -0,0 +1,81 @@ +const { ethers } = require('ethers'); +const { SMART_CONTRACTS, contractConfiguration } = require('./smart-contracts'); +const GanacheContractAddressRegistry = require('./ganache-contract-address-registry'); + +/* + * Ganache seeder is used to seed initial smart contract or set initial blockchain state. + */ +class GanacheSeeder { + constructor(ganacheProvider) { + this.smartContractRegistry = new GanacheContractAddressRegistry(); + this.ganacheProvider = ganacheProvider; + } + + /** + * Deploy initial smart contracts that can be used later within the e2e tests. + * + * @param contractName + */ + + async deploySmartContract(contractName) { + const ethersProvider = new ethers.providers.Web3Provider( + this.ganacheProvider, + 'any', + ); + const signer = ethersProvider.getSigner(); + const fromAddress = await signer.getAddress(); + const contractFactory = new ethers.ContractFactory( + contractConfiguration[contractName].abi, + contractConfiguration[contractName].bytecode, + signer, + ); + + let contract; + + if (contractName === SMART_CONTRACTS.HST) { + contract = await contractFactory.deploy( + contractConfiguration[SMART_CONTRACTS.HST].initialAmount, + contractConfiguration[SMART_CONTRACTS.HST].tokenName, + contractConfiguration[SMART_CONTRACTS.HST].decimalUnits, + contractConfiguration[SMART_CONTRACTS.HST].tokenSymbol, + ); + } else { + contract = await contractFactory.deploy(); + } + + await contract.deployTransaction.wait(); + + if (contractName === SMART_CONTRACTS.COLLECTIBLES) { + const transaction = await contract.mintCollectibles(1, { + from: fromAddress, + }); + await transaction.wait(); + } + this.storeSmartContractAddress(contractName, contract.address); + } + + /** + * Store deployed smart contract address within the environment variables + * to make it available everywhere. + * + * @param contractName + * @param contractAddress + */ + storeSmartContractAddress(contractName, contractAddress) { + this.smartContractRegistry.storeNewContractAddress( + contractName, + contractAddress, + ); + } + + /** + * Return an instance of the currently used smart contract registry. + * + * @returns GanacheContractAddressRegistry + */ + getContractRegistry() { + return this.smartContractRegistry; + } +} + +module.exports = GanacheSeeder; diff --git a/test/e2e/seeder/smart-contracts.js b/test/e2e/seeder/smart-contracts.js new file mode 100644 index 000000000..f7cc148c5 --- /dev/null +++ b/test/e2e/seeder/smart-contracts.js @@ -0,0 +1,50 @@ +const { + hstBytecode, + hstAbi, + piggybankBytecode, + piggybankAbi, + collectiblesAbi, + collectiblesBytecode, + failingContractAbi, + failingContractBytecode, +} = require('../../../node_modules/@metamask/test-dapp/dist/constants.json'); + +const hstFactory = { + initialAmount: 100, + tokenName: 'TST', + decimalUnits: 4, + tokenSymbol: 'TST', + bytecode: hstBytecode, + abi: hstAbi, +}; + +const collectiblesFactory = { + bytecode: collectiblesBytecode, + abi: collectiblesAbi, +}; + +const piggybankFactory = { + bytecode: piggybankBytecode, + abi: piggybankAbi, +}; + +const failingContract = { + bytecode: failingContractBytecode, + abi: failingContractAbi, +}; + +const SMART_CONTRACTS = { + HST: 'hst', + COLLECTIBLES: 'collectibles', + PIGGYBANK: 'piggybank', + FAILING: 'failing', +}; + +const contractConfiguration = { + [SMART_CONTRACTS.HST]: hstFactory, + [SMART_CONTRACTS.COLLECTIBLES]: collectiblesFactory, + [SMART_CONTRACTS.PIGGYBANK]: piggybankFactory, + [SMART_CONTRACTS.FAILING]: failingContract, +}; + +module.exports = { SMART_CONTRACTS, contractConfiguration }; diff --git a/test/e2e/send-eth-with-private-key-test/ethereumjs-tx.js b/test/e2e/send-eth-with-private-key-test/ethereumjs-tx.js index 7afccb796..9f3c19600 100644 --- a/test/e2e/send-eth-with-private-key-test/ethereumjs-tx.js +++ b/test/e2e/send-eth-with-private-key-test/ethereumjs-tx.js @@ -708,4 +708,4 @@ function inspect(e,r){var t={seen:[],stylize:stylizeNoColor};return arguments.le "use strict";module.exports={Buffer:require("buffer"),BN:require("ethereumjs-util").BN,RLP:require("ethereumjs-util").rlp,Tx:require("ethereumjs-tx"),Util:require("ethereumjs-util")}; },{"buffer":8,"ethereumjs-tx":31,"ethereumjs-util":33}]},{},[104])(104) -}); \ No newline at end of file +}); diff --git a/test/e2e/send-eth-with-private-key-test/send-eth-with-private-key.js b/test/e2e/send-eth-with-private-key-test/send-eth-with-private-key.js index 4ea215793..62985c31e 100644 --- a/test/e2e/send-eth-with-private-key-test/send-eth-with-private-key.js +++ b/test/e2e/send-eth-with-private-key-test/send-eth-with-private-key.js @@ -9,7 +9,7 @@ const sendButton = document.getElementById('send') sendButton.addEventListener('click', function () { var rawTx = { nonce: '0x00', - gasPrice: '0x09184e72a000', + gasPrice: '0x09184e72a000', gasLimit: '0x22710', value: '0xde0b6b3a7640000', to: document.getElementById('address').value, diff --git a/test/e2e/send-eth-with-private-key-test/web3js.js b/test/e2e/send-eth-with-private-key-test/web3js.js index 29d266567..9d2f635d7 100644 --- a/test/e2e/send-eth-with-private-key-test/web3js.js +++ b/test/e2e/send-eth-with-private-key-test/web3js.js @@ -1,2 +1,2 @@ /* eslint-disable */ -"use strict";var _typeof2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof2(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof2(t)};!function(t){if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Web3=t()}}(function(){var define,module,exports;return function(){return function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var c=r[a]={exports:{}};e[a][0].call(c.exports,function(t){var r=e[a][1][t];return i(r||t)},c,c.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a>6],i=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function h(t,e,r){var n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(0==(128&n))return n;var i=127&n;if(i>4)return t.error("length octect is too long");n=0;for(var o=0;o=31)return n.error("Multi-octet tag encoding unsupported");e||(i|=32);return i|=s.tagClassByName[r||"universal"]<<6}(t,e,r,this.reporter);if(n.length<128)return(o=new i(2))[0]=a,o[1]=n.length,this._createEncoderBuffer([o,n]);for(var u=1,f=n.length;f>=256;f>>=8)u++;(o=new i(2+u))[0]=a,o[1]=128|u;f=1+u;for(var c=n.length;c>0;f--,c>>=8)o[f]=255&c;return this._createEncoderBuffer([o,n])},f.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=new i(2*t.length),n=0;n=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}var o=0;for(n=0;n=128;a>>=7)o++}var s=new i(o),u=s.length-1;for(n=t.length-1;n>=0;n--){a=t[n];for(s[u--]=127&a;(a>>=7)>0;)s[u--]=128|127&a}return this._createEncoderBuffer(s)},f.prototype._encodeTime=function(t,e){var r,n=new Date(t);return"gentime"===e?r=[c(n.getFullYear()),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[c(n.getFullYear()%100),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},f.prototype._encodeNull=function(){return this._createEncoderBuffer("")},f.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!i.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=new i(r)}if(i.isBuffer(t)){var n=t.length;0===t.length&&n++;var o=new i(n);return t.copy(o),0===t.length&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);n=1;for(var a=t;a>=256;a>>=8)n++;for(a=(o=new Array(n)).length-1;a>=0;a--)o[a]=255&t,t>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new i(o))},f.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},f.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},f.prototype._skipDefault=function(t,e,r){var n,i=this._baseState;if(null===i.default)return!1;var o=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,e,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n0?u-4:u;var c=0;for(e=0;e>16&255,s[c++]=n>>8&255,s[c++]=255&n;2===a?(n=i[t.charCodeAt(e)]<<2|i[t.charCodeAt(e+1)]>>4,s[c++]=255&n):1===a&&(n=i[t.charCodeAt(e)]<<10|i[t.charCodeAt(e+1)]<<4|i[t.charCodeAt(e+2)]>>2,s[c++]=n>>8&255,s[c++]=255&n);return s},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o="",a=[],s=0,u=r-i;su?u:s+16383));1===i?(e=t[r-1],o+=n[e>>2],o+=n[e<<4&63],o+="=="):2===i&&(e=(t[r-2]<<8)+t[r-1],o+=n[e>>10],o+=n[e>>4&63],o+=n[e<<2&63],o+="=");return a.push(o),a.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function c(t,e,r){for(var i,o,a=[],s=e;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],16:[function(t,e,r){var n;function i(t){this.rand=t}if(e.exports=function(t){return n||(n=new i(null)),n.generate(t)},e.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r>>24]^c[p>>>16&255]^h[b>>>8&255]^d[255&m]^e[y++],a=f[p>>>24]^c[b>>>16&255]^h[m>>>8&255]^d[255&l]^e[y++],s=f[b>>>24]^c[m>>>16&255]^h[l>>>8&255]^d[255&p]^e[y++],u=f[m>>>24]^c[l>>>16&255]^h[p>>>8&255]^d[255&b]^e[y++],l=o,p=a,b=s,m=u;return o=(n[l>>>24]<<24|n[p>>>16&255]<<16|n[b>>>8&255]<<8|n[255&m])^e[y++],a=(n[p>>>24]<<24|n[b>>>16&255]<<16|n[m>>>8&255]<<8|n[255&l])^e[y++],s=(n[b>>>24]<<24|n[m>>>16&255]<<16|n[l>>>8&255]<<8|n[255&p])^e[y++],u=(n[m>>>24]<<24|n[l>>>16&255]<<16|n[p>>>8&255]<<8|n[255&b])^e[y++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var f=s^s<<1^s<<2^s<<3^s<<4;f=f>>>8^255&f^99,r[a]=f,n[f]=a;var c=t[a],h=t[c],d=t[h],l=257*t[f]^16843008*f;i[0][a]=l<<24|l>>>8,i[1][a]=l<<16|l>>>16,i[2][a]=l<<8|l>>>24,i[3][a]=l,l=16843009*d^65537*h^257*c^16843008*a,o[0][f]=l<<24|l>>>8,o[1][f]=l<<16|l>>>16,o[2][f]=l<<8|l>>>24,o[3][f]=l,0===a?a=s=1:(a=c^t[t[t[d^c]]],s^=t[t[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function f(t){this._key=i(t),this._reset()}f.blockSize=16,f.keySize=32,f.prototype.blockSize=f.blockSize,f.prototype.keySize=f.keySize,f.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o>>24,a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a],a^=s[o/e|0]<<24):e>6&&o%e==4&&(a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a]),i[o]=i[o-e]^a}for(var f=[],c=0;c>>24]]^u.INV_SUB_MIX[1][u.SBOX[d>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[d>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&d]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=f},f.prototype.encryptBlockRaw=function(t){return a(t=i(t),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},f.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},f.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=a(t,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},f.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},e.exports.AES=f},{"safe-buffer":147}],19:[function(t,e,r){var n=t("./aes"),i=t("safe-buffer").Buffer,o=t("cipher-base"),a=t("inherits"),s=t("./ghash"),u=t("buffer-xor"),f=t("./incr32");function c(t,e,r,a){o.call(this);var u=i.alloc(4,0);this._cipher=new n.AES(e);var c=this._cipher.encryptBlock(u);this._ghash=new s(c),r=function(t,e,r){if(12===e.length)return t._finID=i.concat([e,i.from([0,0,0,1])]),i.concat([e,i.from([0,0,0,2])]);var n=new s(r),o=e.length,a=o%16;n.update(e),a&&(a=16-a,n.update(i.alloc(a,0))),n.update(i.alloc(8,0));var u=8*o,c=i.alloc(8);c.writeUIntBE(u,0,8),n.update(c),t._finID=n.state;var h=i.from(t._finID);return f(h),h}(this,r,c),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}a(c,o),c.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=i.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},c.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=0;i16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},h.prototype.flush=function(){if(this.cache.length)return this.cache},r.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=f(e,!1,r.key,r.iv);return d(t,n.key,n.iv)},r.createDecipheriv=d},{"./aes":18,"./authCipher":19,"./modes":31,"./streamCipher":34,"cipher-base":48,evp_bytestokey:84,inherits:101,"safe-buffer":147}],22:[function(t,e,r){var n=t("./modes"),i=t("./authCipher"),o=t("safe-buffer").Buffer,a=t("./streamCipher"),s=t("cipher-base"),u=t("./aes"),f=t("evp_bytestokey");function c(t,e,r){s.call(this),this._cache=new d,this._cipher=new u.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}t("inherits")(c,s),c.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return o.concat(n)};var h=o.alloc(16,16);function d(){this.cache=o.allocUnsafe(0)}function l(t,e,r){var s=n[t.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=o.from(e)),e.length!==s.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new a(s.module,e,r):"auth"===s.type?new i(s.module,e,r):new c(s.module,e,r)}c.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(h))throw this._cipher.scrub(),new Error("data not multiple of block length")},c.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},d.prototype.add=function(t){this.cache=o.concat([this.cache,t])},d.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},d.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function a(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}a.prototype.ghash=function(t){for(var e=-1;++e0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},a.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},a.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,t,0,e])),this.state},e.exports=a},{"safe-buffer":147}],24:[function(t,e,r){e.exports=function(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},{}],25:[function(t,e,r){var n=t("buffer-xor");r.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},r.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},{"buffer-xor":46}],26:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("buffer-xor");function o(t,e,r){var o=e.length,a=i(e,t._cache);return t._cache=t._cache.slice(o),t._prev=n.concat([t._prev,r?e:a]),a}r.encrypt=function(t,e,r){for(var i,a=n.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=n.allocUnsafe(0)),!(t._cache.length<=e.length)){a=n.concat([a,o(t,e,r)]);break}i=t._cache.length,a=n.concat([a,o(t,e.slice(0,i),r)]),e=e.slice(i)}return a}},{"buffer-xor":46,"safe-buffer":147}],27:[function(t,e,r){var n=t("safe-buffer").Buffer;function i(t,e,r){for(var n,i,a=-1,s=0;++a<8;)n=e&1<<7-a?128:0,s+=(128&(i=t._cipher.encryptBlock(t._prev)[0]^n))>>a%8,t._prev=o(t._prev,r?n:i);return s}function o(t,e){var r=t.length,i=-1,o=n.allocUnsafe(t.length);for(t=n.concat([t,n.from([e])]);++i>7;return o}r.encrypt=function(t,e,r){for(var o=e.length,a=n.allocUnsafe(o),s=-1;++s=0||!r.umod(t.prime1)||!r.umod(t.prime2);)r=new n(i(e));return r}e.exports=o,o.getr=a}).call(this,t("buffer").Buffer)},{"bn.js":"BN",buffer:47,randombytes:131}],39:[function(t,e,r){e.exports=t("./browser/algorithms.json")},{"./browser/algorithms.json":40}],40:[function(t,e,r){e.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],41:[function(t,e,r){e.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],42:[function(t,e,r){(function(r){var n=t("create-hash"),i=t("stream"),o=t("inherits"),a=t("./sign"),s=t("./verify"),u=t("./algorithms.json");function f(t){i.Writable.call(this);var e=u[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function c(t){i.Writable.call(this);var e=u[t];if(!e)throw new Error("Unknown message digest");this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function h(t){return new f(t)}function d(t){return new c(t)}Object.keys(u).forEach(function(t){u[t].id=new r(u[t].id,"hex"),u[t.toLowerCase()]=u[t]}),o(f,i.Writable),f.prototype._write=function(t,e,r){this._hash.update(t),r()},f.prototype.update=function(t,e){return"string"==typeof t&&(t=new r(t,e)),this._hash.update(t),this},f.prototype.sign=function(t,e){this.end();var r=this._hash.digest(),n=a(r,t,this._hashType,this._signType,this._tag);return e?n.toString(e):n},o(c,i.Writable),c.prototype._write=function(t,e,r){this._hash.update(t),r()},c.prototype.update=function(t,e){return"string"==typeof t&&(t=new r(t,e)),this._hash.update(t),this},c.prototype.verify=function(t,e,n){"string"==typeof e&&(e=new r(e,n)),this.end();var i=this._hash.digest();return s(e,i,t,this._signType,this._tag)},e.exports={Sign:h,Verify:d,createSign:h,createVerify:d}}).call(this,t("buffer").Buffer)},{"./algorithms.json":40,"./sign":43,"./verify":44,buffer:47,"create-hash":51,inherits:101,stream:156}],43:[function(t,e,r){(function(r){var n=t("create-hmac"),i=t("browserify-rsa"),o=t("elliptic").ec,a=t("bn.js"),s=t("parse-asn1"),u=t("./curves.json");function f(t,e,i,o){if((t=new r(t.toArray())).length0&&r.ishrn(n),r}function h(t,e,i){var o,a;do{for(o=new r(0);8*o.length=e)throw new Error("invalid sig")}e.exports=function(t,e,u,f,c){var h=o(u);if("ec"===h.type){if("ecdsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");return function(t,e,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var o=new i(n),s=r.data.subjectPrivateKey.data;return o.verify(e,t,s)}(t,e,h)}if("dsa"===h.type){if("dsa"!==f)throw new Error("wrong public key type");return function(t,e,r){var i=r.data.p,a=r.data.q,u=r.data.g,f=r.data.pub_key,c=o.signature.decode(t,"der"),h=c.s,d=c.r;s(h,a),s(d,a);var l=n.mont(i),p=h.invm(a);return 0===u.toRed(l).redPow(new n(e).mul(p).mod(a)).fromRed().mul(f.toRed(l).redPow(d.mul(p).mod(a)).fromRed()).mod(i).mod(a).cmp(d)}(t,e,h)}if("rsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");e=r.concat([c,e]);for(var d=h.modulus.byteLength(),l=[1],p=0;e.length+l.length+2o)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(t)}return u(t,e,r)}function u(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return N(t)?function(t,e,r){if(e<0||t.byteLength=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function l(t,e){if(s.isBuffer(t))return t.length;if(L(t)||N(t))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return R(t).length;default:if(n)return P(t).length;e=(""+e).toLowerCase(),n=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),F(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var h=!0,d=0;di&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a239?4:f>223?3:f>191?2:1;if(i+h<=r)switch(h){case 1:f<128&&(c=f);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&f)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&f)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(t){var e=t.length;if(e<=_)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return w(this,e,r);case"ascii":return M(this,e,r);case"latin1":case"binary":return x(this,e,r);case"base64":return g(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},s.prototype.compare=function(t,e,r,n,i){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(o,a),f=this.slice(n,i),c=t.slice(e,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o,a,s,u,f,c,h,d,l,p=!1;;)switch(n){case"hex":return y(this,t,e,r);case"utf8":case"utf-8":return d=e,l=r,O(P(t,(h=this).length-d),h,d,l);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return v(this,t,e,r);case"base64":return u=this,f=e,c=r,O(R(t),u,f,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=e,s=r,O(function(t,e){for(var r,n,i,o=[],a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,(o=this).length-a),o,a,s);default:if(p)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function M(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function A(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function j(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function I(t,e,r,n,o){return e=+e,r>>>=0,o||j(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,o){return e=+e,r>>>=0,o||j(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||E(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||E(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||E(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||E(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||E(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||E(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||E(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||E(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||E(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||E(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||A(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n)||A(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);A(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);A(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function R(t){return n.toByteArray(function(t){if((t=t.trim().replace(T,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function O(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function N(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function L(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function F(t){return t!=t}},{"base64-js":15,ieee754:99}],48:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("stream").Transform,o=t("string_decoder").StringDecoder;function a(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}t("inherits")(a,i),a.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},a.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},a.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},a.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},e.exports=a},{inherits:101,"safe-buffer":147,stream:156,string_decoder:157}],49:[function(t,e,r){(function(t){function e(t){return Object.prototype.toString.call(t)}r.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===e(t)},r.isBoolean=function(t){return"boolean"==typeof t},r.isNull=function(t){return null===t},r.isNullOrUndefined=function(t){return null==t},r.isNumber=function(t){return"number"==typeof t},r.isString=function(t){return"string"==typeof t},r.isSymbol=function(t){return"symbol"===(void 0===t?"undefined":_typeof(t))},r.isUndefined=function(t){return void 0===t},r.isRegExp=function(t){return"[object RegExp]"===e(t)},r.isObject=function(t){return"object"===(void 0===t?"undefined":_typeof(t))&&null!==t},r.isDate=function(t){return"[object Date]"===e(t)},r.isError=function(t){return"[object Error]"===e(t)||t instanceof Error},r.isFunction=function(t){return"function"==typeof t},r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"===(void 0===t?"undefined":_typeof(t))||void 0===t},r.isBuffer=t.isBuffer}).call(this,{isBuffer:t("../../is-buffer/index.js")})},{"../../is-buffer/index.js":102}],50:[function(t,e,r){(function(r){var n=t("elliptic"),i=t("bn.js");e.exports=function(t){return new a(t)};var o={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function a(t){this.curveType=o[t],this.curveType||(this.curveType={name:t}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function s(t,e,n){Array.isArray(t)||(t=t.toArray());var i=new r(t);if(n&&i.length>>2),a=0,s=0;a>5]|=128<>>9<<4)]=e;for(var r=1732584193,n=-271733879,i=-1732584194,o=271733878,h=0;h>>32-s,r);var a,s}function a(t,e,r,n,i,a,s){return o(e&r|~e&n,t,e,i,a,s)}function s(t,e,r,n,i,a,s){return o(e&n|r&~n,t,e,i,a,s)}function u(t,e,r,n,i,a,s){return o(e^r^n,t,e,i,a,s)}function f(t,e,r,n,i,a,s){return o(r^(e|~n),t,e,i,a,s)}function c(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}e.exports=function(t){return n(t,i)}},{"./make-hash":52}],54:[function(t,e,r){var n=t("inherits"),i=t("./legacy"),o=t("cipher-base"),a=t("safe-buffer").Buffer,s=t("create-hash/md5"),u=t("ripemd160"),f=t("sha.js"),c=a.alloc(128);function h(t,e){o.call(this,"digest"),"string"==typeof e&&(e=a.from(e));var r="sha512"===t||"sha384"===t?128:64;(this._alg=t,this._key=e,e.length>r)?e=("rmd160"===t?new u:f(t)).update(e).digest():e.lengths?e=t(e):e.length0;n--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},i.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},i.prototype._pad=function(t,e){if(0===e)return!1;for(;e>>1];r=a.r28shl(r,s),i=a.r28shl(i,s),a.pc2(r,i,t.keys,o)}},u.prototype._update=function(t,e,r,n){var i=this._desState,o=a.readUInt32BE(t,e),s=a.readUInt32BE(t,e+4);a.ip(o,s,i.tmp,0),o=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,o,s,i.tmp,0):this._decrypt(i,o,s,i.tmp,0),o=i.tmp[0],s=i.tmp[1],a.writeUInt32BE(r,o,n),a.writeUInt32BE(r,s,n+4)},u.prototype._pad=function(t,e){for(var r=t.length-e,n=e;n>>0,o=d}a.rip(s,o,n,i)},u.prototype._decrypt=function(t,e,r,n,i){for(var o=r,s=e,u=t.keys.length-2;u>=0;u-=2){var f=t.keys[u],c=t.keys[u+1];a.expand(o,t.tmp,0),f^=t.tmp[0],c^=t.tmp[1];var h=a.substitute(f,c),d=o;o=(s^a.permute(h))>>>0,s=d}a.rip(o,s,n,i)}},{"../des":57,inherits:101,"minimalistic-assert":107}],61:[function(t,e,r){var n=t("minimalistic-assert"),i=t("inherits"),o=t("../des"),a=o.Cipher,s=o.DES;function u(t){a.call(this,t);var e=new function(t,e){n.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),i=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}(this.type,this.options.key);this._edeState=e}i(u,a),e.exports=u,u.create=function(t){return new u(t)},u.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},{"../des":57,inherits:101,"minimalistic-assert":107}],62:[function(t,e,r){r.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},r.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},r.ip=function(t,e,r,n){for(var i=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=t>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1}r[n+0]=i>>>0,r[n+1]=o>>>0},r.rip=function(t,e,r,n){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=e>>>s+a&1,i<<=1,i|=t>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=e>>>s+a&1,o<<=1,o|=t>>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},r.pc1=function(t,e,r,n){for(var i=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},r.r28shl=function(t,e){return t<>>28-e};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(t,e,r,i){for(var o=0,a=0,s=n.length>>>1,u=0;u>>n[u]&1;for(u=s;u>>n[u]&1;r[i+0]=o>>>0,r[i+1]=a>>>0},r.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=t>>>o&63;for(o=11;o>=3;o-=4)i|=t>>>o&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(t,e){for(var r=0,n=0;n<4;n++){r<<=4,r|=i[64*n+(t>>>18-6*n&63)]}for(n=0;n<4;n++){r<<=4,r|=i[256+64*n+(e>>>18-6*n&63)]}return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(t){for(var e=0,r=0;r>>o[r]&1;return e>>>0},r.padSplit=function(t,e,r){for(var n=t.toString(2);n.lengtht;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(u),e.cmp(u)){if(!e.cmp(f))for(;r.mod(c).cmp(h);)r.iadd(l)}else for(;r.mod(o).cmp(d);)r.iadd(l);if(b(p=r.shrn(1))&&b(r)&&m(p)&&m(r)&&a.test(p)&&a.test(r))return r}}},{"bn.js":"BN","miller-rabin":106,randombytes:131}],66:[function(t,e,r){e.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],67:[function(t,e,r){var n=r;n.version=t("../package.json").version,n.utils=t("./elliptic/utils"),n.rand=t("brorand"),n.curve=t("./elliptic/curve"),n.curves=t("./elliptic/curves"),n.ec=t("./elliptic/ec"),n.eddsa=t("./elliptic/eddsa")},{"../package.json":82,"./elliptic/curve":70,"./elliptic/curves":73,"./elliptic/ec":74,"./elliptic/eddsa":77,"./elliptic/utils":81,brorand:16}],68:[function(t,e,r){var n=t("bn.js"),i=t("../../elliptic").utils,o=i.getNAF,a=i.getJSF,s=i.assert;function u(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function f(t,e){this.curve=t,this.type=e,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){s(t.precomputed);var r=t._getDoubles(),n=o(e,1),i=(1<=u;e--)f=(f<<1)+n[e];a.push(f)}for(var c=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(u=0;u=0;f--){for(e=0;f>=0&&0===a[f];f--)e++;if(f>=0&&e++,u=u.dblp(e),f<0)break;var c=a[f];s(0!==c),u="affine"===t.type?c>0?u.mixedAdd(i[c-1>>1]):u.mixedAdd(i[-c-1>>1].neg()):c>0?u.add(i[c-1>>1]):u.add(i[-c-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){for(var s=this._wnafT1,u=this._wnafT2,f=this._wnafT3,c=0,h=0;h=1;h-=2){var l=h-1,p=h;if(1===s[l]&&1===s[p]){var b=[e[l],null,null,e[p]];0===e[l].y.cmp(e[p].y)?(b[1]=e[l].add(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg())):0===e[l].y.cmp(e[p].y.redNeg())?(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].add(e[p].neg())):(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],y=a(r[l],r[p]);c=Math.max(y[0].length,c),f[l]=new Array(c),f[p]=new Array(c);for(var v=0;v=0;h--){for(var x=0;h>=0;){var k=!0;for(v=0;v=0&&x++,_=_.dblp(x),h<0)break;for(v=0;v0?S=u[v][E-1>>1]:E<0&&(S=u[v][-E-1>>1].neg()),_="affine"===S.type?_.mixedAdd(S):_.add(S))}}for(h=0;h=Math.ceil((t.bitLength()+1)/e.step)},f.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i":""},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},c.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),a=o.redSub(r),s=n.redSub(e),u=i.redMul(a),f=o.redMul(s),c=i.redMul(s),h=a.redMul(o);return this.curve.point(u,f,h,c)},c.prototype._projDbl=function(){var t,e,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(f=this.curve._mulA(i)).redAdd(o);if(this.zOne)t=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),e=a.redMul(f.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);t=n.redSub(i).redISub(o).redMul(u),e=a.redMul(f.redSub(o)),r=a.redMul(u)}}else{var f=i.redAdd(o);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),u=f.redSub(s).redSub(s);t=this.curve._mulC(n.redISub(f)).redMul(u),e=this.curve._mulC(f).redMul(i.redISub(o)),r=f.redMul(u)}return this.curve.point(t,e,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(e),f=o.redMul(a),c=s.redMul(u),h=o.redMul(u),d=a.redMul(s);return this.curve.point(f,c,d,h)},c.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),f=i.redAdd(s),c=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),h=n.redMul(u).redMul(c);return this.curve.twisted?(e=n.redMul(f).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(f)):(e=n.redMul(f).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(f)),this.curve.point(h,e,r)},c.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},c.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},c.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},c.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}return!1},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},{"../../elliptic":67,"../curve":70,"bn.js":"BN",inherits:101}],70:[function(t,e,r){var n=r;n.base=t("./base"),n.short=t("./short"),n.mont=t("./mont"),n.edwards=t("./edwards")},{"./base":68,"./edwards":69,"./mont":71,"./short":72}],71:[function(t,e,r){var n=t("../curve"),i=t("bn.js"),o=t("inherits"),a=n.base,s=t("../../elliptic").utils;function u(t){a.call(this,"mont",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function f(t,e,r){a.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(e,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(u,a),e.exports=u,u.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},o(f,a.BasePoint),u.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},u.prototype.point=function(t,e){return new f(this,t,e)},u.prototype.pointFromJSON=function(t){return f.fromJSON(this,t)},f.prototype.precompute=function(){},f.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},f.fromJSON=function(t,e){return new f(t,e[0],e[1]||t.one)},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},f.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},f.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),a=i.redMul(n),s=e.z.redMul(o.redAdd(a).redSqr()),u=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},f.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},f.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},f.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":67,"../curve":70,"bn.js":"BN",inherits:101}],72:[function(t,e,r){var n=t("../curve"),i=t("../../elliptic"),o=t("bn.js"),a=t("inherits"),s=n.base,u=i.utils.assert;function f(t){s.call(this,"short",t),this.a=new o(t.a,16).toRed(this.red),this.b=new o(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(t,e,r,n){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new o(e,16),this.y=new o(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(t,e,r,n){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new o(0)):(this.x=new o(e,16),this.y=new o(r,16),this.z=new o(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(f,s),e.exports=f,f.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new o(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new o(t.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?r=i[0]:(r=i[1],u(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map(function(t){return{a:new o(t.a,16),b:new o(t.b,16)}}):this._getEndoBasis(r)}}},f.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:o.mont(t),r=new o(2).toRed(e).redInvm(),n=r.redNeg(),i=new o(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},f.prototype._getEndoBasis=function(t){for(var e,r,n,i,a,s,u,f,c,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=t,l=this.n.clone(),p=new o(1),b=new o(0),m=new o(0),y=new o(1),v=0;0!==d.cmpn(0);){var g=l.div(d);f=l.sub(g.mul(d)),c=m.sub(g.mul(p));var w=y.sub(g.mul(b));if(!n&&f.cmp(h)<0)e=u.neg(),r=p,n=f.neg(),i=c;else if(n&&2==++v)break;u=f,l=d,d=f,m=p,p=c,y=b,b=w}a=f.neg(),s=c;var _=n.sqr().add(i.sqr());return a.sqr().add(s.sqr()).cmp(_)>=0&&(a=e,s=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:i},{a:a,b:s}]},f.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),f=o.mul(n.b);return{k1:t.sub(a).sub(s),k2:u.add(f).neg()}},f.prototype.pointFromX=function(t,e){(t=new o(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},f.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},f.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(t){return t=new o(t,16),this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},c.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(h,s.BasePoint),f.prototype.jpoint=function(t,e,r){return new h(this,t,e,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),c=f.redMul(s),h=n.redMul(f),d=u.redSqr().redIAdd(c).redISub(h).redISub(h),l=u.redMul(h.redISub(d)).redISub(o.redMul(c)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(d,l,p)},h.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),c=r.redMul(u),h=s.redSqr().redIAdd(f).redISub(c).redISub(c),d=s.redMul(c.redISub(h)).redISub(i.redMul(f)),l=this.z.redMul(a);return this.curve.jpoint(h,d,l)},h.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}return!1},h.prototype.inspect=function(){return this.isInfinity()?"":""},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":67,"../curve":70,"bn.js":"BN",inherits:101}],73:[function(t,e,r){var n,i=r,o=t("hash.js"),a=t("../elliptic"),s=a.utils.assert;function u(t){"short"===t.type?this.curve=new a.curve.short(t):"edwards"===t.type?this.curve=new a.curve.edwards(t):this.curve=new a.curve.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function f(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,f("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),f("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),f("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),f("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),f("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),f("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),f("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=t("./precomputed/secp256k1")}catch(t){n=void 0}f("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},{"../elliptic":67,"./precomputed/secp256k1":80,"hash.js":86}],74:[function(t,e,r){var n=t("bn.js"),i=t("hmac-drbg"),o=t("../../elliptic"),a=o.utils.assert,s=t("./key"),u=t("./signature");function f(t){if(!(this instanceof f))return new f(t);"string"==typeof t&&(a(o.curves.hasOwnProperty(t),"Unknown curve "+t),t=o.curves[t]),t instanceof o.curves.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}e.exports=f,f.prototype.keyPair=function(t){return new s(this,t)},f.prototype.keyFromPrivate=function(t,e){return s.fromPrivate(this,t,e)},f.prototype.keyFromPublic=function(t,e){return s.fromPublic(this,t,e)},f.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||o.rand(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),a=this.n.sub(new n(2));;){var s=new n(e.generate(r));if(!(s.cmp(a)>0))return s.iaddn(1),this.keyFromPrivate(s)}},f.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},f.prototype.sign=function(t,e,r,o){"object"===(void 0===r?"undefined":_typeof(r))&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var a=this.n.byteLength(),s=e.getPrivate().toArray("be",a),f=t.toArray("be",a),c=new i({hash:this.hash,entropy:s,nonce:f,pers:o.pers,persEnc:o.persEnc||"utf8"}),h=this.n.sub(new n(1)),d=0;;d++){var l=o.k?o.k(d):new n(c.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(h)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var y=l.invm(this.n).mul(m.mul(e.getPrivate()).iadd(t));if(0!==(y=y.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),v^=1),new u({r:m,s:y,recoveryParam:v})}}}}}},f.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new u(e,"hex")).r,a=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,f=a.invm(this.n),c=f.mul(t).umod(this.n),h=f.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),h)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),h)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},f.prototype.recoverPubKey=function(t,e,r,i){a((3&r)===r,"The recovery param is more than two bits"),e=new u(e,i);var o=this.n,s=new n(t),f=e.r,c=e.s,h=1&r,d=r>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");f=d?this.curve.pointFromX(f.add(this.curve.n),h):this.curve.pointFromX(f,h);var l=e.r.invm(o),p=o.sub(s).mul(l).umod(o),b=c.mul(l).umod(o);return this.g.mulAdd(p,f,b)},f.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new u(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":67,"./key":75,"./signature":76,"bn.js":"BN","hmac-drbg":98}],75:[function(t,e,r){var n=t("bn.js"),i=t("../../elliptic").utils.assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}e.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return""}},{"../../elliptic":67,"bn.js":"BN"}],76:[function(t,e,r){var n=t("bn.js"),i=t("../../elliptic").utils,o=i.assert;function a(t,e){if(t instanceof a)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function s(t,e){var r=t[e.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,a=e.place;o>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}e.exports=a,a.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new function(){this.place=0};if(48!==t[r.place++])return!1;if(s(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=s(t,r),a=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var u=s(t,r);if(t.length!==u+r.place)return!1;var f=t.slice(r.place,u+r.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new n(a),this.s=new n(f),this.recoveryParam=null,!0},a.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,e.length),(n=n.concat(e)).push(2),f(n,r.length);var o=n.concat(r),a=[48];return f(a,o.length),a=a.concat(o),i.encode(a,t)}},{"../../elliptic":67,"bn.js":"BN"}],77:[function(t,e,r){var n=t("hash.js"),i=t("../../elliptic"),o=i.utils,a=o.assert,s=o.parseBytes,u=t("./key"),f=t("./signature");function c(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof c))return new c(t);t=i.curves[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}e.exports=c,c.prototype.sign=function(t,e){t=s(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},c.prototype.verify=function(t,e,r){t=s(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},c.prototype.hashInt=function(){for(var t=this.hash(),e=0;e=0;){var o;if(i.isOdd()){var a=i.andln(n-1);o=a>(n>>1)-1?(n>>1)-a:a,i.isubn(o)}else o=0;r.push(o);for(var s=0!==i.cmpn(0)&&0===i.andln(n-1)?e+1:1,u=1;u0||e.cmpn(-i)>0;){var o,a,s,u=t.andln(3)+n&3,f=e.andln(3)+i&3;3===u&&(u=-1),3===f&&(f=-1),o=0==(1&u)?0:3!=(s=t.andln(7)+n&7)&&5!==s||2!==f?u:-u,r[0].push(o),a=0==(1&f)?0:3!=(s=e.andln(7)+i&7)&&5!==s||2!==u?f:-f,r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},{"bn.js":"BN","minimalistic-assert":107,"minimalistic-crypto-utils":108}],82:[function(t,e,r){e.exports={_args:[[{raw:"elliptic@^6.0.0",scope:null,escapedName:"elliptic",name:"elliptic",rawSpec:"^6.0.0",spec:">=6.0.0 <7.0.0",type:"range"},"/Users/frozeman/Sites/_ethereum/web3/node_modules/browserify-sign"]],_from:"elliptic@>=6.0.0 <7.0.0",_id:"elliptic@6.4.0",_inCache:!0,_location:"/elliptic",_nodeVersion:"7.0.0",_npmOperationalInternal:{host:"packages-18-east.internal.npmjs.com",tmp:"tmp/elliptic-6.4.0.tgz_1487798866428_0.30510620190761983"},_npmUser:{name:"indutny",email:"fedor@indutny.com"},_npmVersion:"3.10.8",_phantomChildren:{},_requested:{raw:"elliptic@^6.0.0",scope:null,escapedName:"elliptic",name:"elliptic",rawSpec:"^6.0.0",spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh","/secp256k1"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",_shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/Users/frozeman/Sites/_ethereum/web3/node_modules/browserify-sign",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz"},files:["lib"],gitHead:"6b0d2b76caae91471649c8e21f0b1d3ba0f96090",homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.0"}},{}],83:[function(t,e,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function o(t){return"object"===(void 0===t?"undefined":_typeof(t))&&null!==t}function a(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,r,n,s,u,f;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}if(a(r=this._events[t]))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(o(r))for(s=Array.prototype.slice.call(arguments,1),n=(f=r.slice()).length,u=0;u0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){if(!i(e))throw TypeError("listener must be a function");var r=!1;function n(){this.removeListener(t,n),r||(r=!0,e.apply(this,arguments))}return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var r,n,a,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(a=(r=this._events[t]).length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(s=a;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(i(r=this._events[t]))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],84:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("md5.js");e.exports=function(t,e,r,o){if(n.isBuffer(t)||(t=n.from(t,"binary")),e&&(n.isBuffer(e)||(e=n.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,s=n.alloc(a),u=n.alloc(o||0),f=n.alloc(0);a>0||o>0;){var c=new i;c.update(f),c.update(t),e&&c.update(e),f=c.digest();var h=0;if(a>0){var d=s.length-a;h=Math.min(a,f.length),f.copy(s,d,0,h),a-=h}if(h0){var l=u.length-o,p=Math.min(o,f.length-h);f.copy(u,l,h,h+p),o-=p}}return f.fill(0),{key:s,iv:u}}},{"md5.js":104,"safe-buffer":147}],85:[function(t,e,r){(function(r){var n=t("stream").Transform;function i(t){n.call(this),this._block=new r(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t("inherits")(i,n),i.prototype._transform=function(t,e,n){var i=null;try{"buffer"!==e&&(t=new r(t,e)),this.update(t)}catch(t){i=t}n(i)},i.prototype._flush=function(t){var e=null;try{this.push(this._digest())}catch(t){e=t}t(e)},i.prototype.update=function(t,e){if(!r.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");r.isBuffer(t)||(t=new r(t,e||"binary"));for(var n=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},i.prototype._update=function(t){throw new Error("_update is not implemented")},i.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();return void 0!==t&&(e=e.toString(t)),e},i.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=i}).call(this,t("buffer").Buffer)},{buffer:47,inherits:101,stream:156}],86:[function(t,e,r){var n=r;n.utils=t("./hash/utils"),n.common=t("./hash/common"),n.sha=t("./hash/sha"),n.ripemd=t("./hash/ripemd"),n.hmac=t("./hash/hmac"),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},{"./hash/common":87,"./hash/hmac":88,"./hash/ripemd":89,"./hash/sha":90,"./hash/utils":97}],87:[function(t,e,r){var n=t("./utils"),i=t("minimalistic-assert");function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}r.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;othis.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e>>3},r.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},{"../utils":97}],97:[function(t,e,r){var n=t("minimalistic-assert"),i=t("inherits");function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function s(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}r.inherits=i,r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n>8,a=255&i;o?r.push(o,a):r.push(a)}else for(n=0;n>>0}return a},r.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},r.rotr32=function(t,e){return t>>>e|t<<32-e},r.rotl32=function(t,e){return t<>>32-e},r.sum32=function(t,e){return t+e>>>0},r.sum32_3=function(t,e,r){return t+e+r>>>0},r.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},r.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},r.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,a=(o>>0,t[e+1]=o},r.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},r.sum64_lo=function(t,e,r,n){return e+n>>>0},r.sum64_4_hi=function(t,e,r,n,i,o,a,s){var u=0,f=e;return u+=(f=f+n>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(t,e,r,n,i,o,a,s){return e+n+o+s>>>0},r.sum64_5_hi=function(t,e,r,n,i,o,a,s,u,f){var c=0,h=e;return c+=(h=h+n>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(t,e,r,n,i,o,a,s,u,f){return e+n+o+s+f>>>0},r.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},r.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},r.shr64_hi=function(t,e,r){return t>>>r},r.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},{inherits:101,"minimalistic-assert":107}],98:[function(t,e,r){var n=t("hash.js"),i=t("minimalistic-crypto-utils"),o=t("minimalistic-assert");function a(t){if(!(this instanceof a))return new a(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}e.exports=a,a.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},a.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length>1,c=-7,h=r?i-1:0,d=r?-1:1,l=t[e+h];for(h+=d,o=l&(1<<-c)-1,l>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=d,c-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(l?-1:1);a+=Math.pow(2,n),o-=f}return(l?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,u,f=8*o-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+l]=255&s,l+=p,s/=256,i-=8);for(a=a<0;t[r+l]=255&a,l+=p,a/=256,f-=8);t[r+l-p]|=128*b}},{}],100:[function(t,e,r){var n=[].indexOf;e.exports=function(t,e){if(n)return t.indexOf(e);for(var r=0;r>>32-e}function u(t,e,r,n,i,o,a){return s(t+(e&r|~e&n)+i+o|0,a)+e|0}function f(t,e,r,n,i,o,a){return s(t+(e&n|r&~n)+i+o|0,a)+e|0}function c(t,e,r,n,i,o,a){return s(t+(e^r^n)+i+o|0,a)+e|0}function h(t,e,r,n,i,o,a){return s(t+(r^(e|~n))+i+o|0,a)+e|0}n(a,i),a.prototype._update=function(){for(var t=o,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,a=this._d;n=h(n=h(n=h(n=h(n=c(n=c(n=c(n=c(n=f(n=f(n=f(n=f(n=u(n=u(n=u(n=u(n,i=u(i,a=u(a,r=u(r,n,i,a,t[0],3614090360,7),n,i,t[1],3905402710,12),r,n,t[2],606105819,17),a,r,t[3],3250441966,22),i=u(i,a=u(a,r=u(r,n,i,a,t[4],4118548399,7),n,i,t[5],1200080426,12),r,n,t[6],2821735955,17),a,r,t[7],4249261313,22),i=u(i,a=u(a,r=u(r,n,i,a,t[8],1770035416,7),n,i,t[9],2336552879,12),r,n,t[10],4294925233,17),a,r,t[11],2304563134,22),i=u(i,a=u(a,r=u(r,n,i,a,t[12],1804603682,7),n,i,t[13],4254626195,12),r,n,t[14],2792965006,17),a,r,t[15],1236535329,22),i=f(i,a=f(a,r=f(r,n,i,a,t[1],4129170786,5),n,i,t[6],3225465664,9),r,n,t[11],643717713,14),a,r,t[0],3921069994,20),i=f(i,a=f(a,r=f(r,n,i,a,t[5],3593408605,5),n,i,t[10],38016083,9),r,n,t[15],3634488961,14),a,r,t[4],3889429448,20),i=f(i,a=f(a,r=f(r,n,i,a,t[9],568446438,5),n,i,t[14],3275163606,9),r,n,t[3],4107603335,14),a,r,t[8],1163531501,20),i=f(i,a=f(a,r=f(r,n,i,a,t[13],2850285829,5),n,i,t[2],4243563512,9),r,n,t[7],1735328473,14),a,r,t[12],2368359562,20),i=c(i,a=c(a,r=c(r,n,i,a,t[5],4294588738,4),n,i,t[8],2272392833,11),r,n,t[11],1839030562,16),a,r,t[14],4259657740,23),i=c(i,a=c(a,r=c(r,n,i,a,t[1],2763975236,4),n,i,t[4],1272893353,11),r,n,t[7],4139469664,16),a,r,t[10],3200236656,23),i=c(i,a=c(a,r=c(r,n,i,a,t[13],681279174,4),n,i,t[0],3936430074,11),r,n,t[3],3572445317,16),a,r,t[6],76029189,23),i=c(i,a=c(a,r=c(r,n,i,a,t[9],3654602809,4),n,i,t[12],3873151461,11),r,n,t[15],530742520,16),a,r,t[2],3299628645,23),i=h(i,a=h(a,r=h(r,n,i,a,t[0],4096336452,6),n,i,t[7],1126891415,10),r,n,t[14],2878612391,15),a,r,t[5],4237533241,21),i=h(i,a=h(a,r=h(r,n,i,a,t[12],1700485571,6),n,i,t[3],2399980690,10),r,n,t[10],4293915773,15),a,r,t[1],2240044497,21),i=h(i,a=h(a,r=h(r,n,i,a,t[8],1873313359,6),n,i,t[15],4264355552,10),r,n,t[6],2734768916,15),a,r,t[13],1309151649,21),i=h(i,a=h(a,r=h(r,n,i,a,t[4],4149444226,6),n,i,t[11],3174756917,10),r,n,t[2],718787259,15),a,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+a|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=new r(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},e.exports=a}).call(this,t("buffer").Buffer)},{buffer:47,"hash-base":105,inherits:101}],105:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("stream").Transform;function o(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t("inherits")(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},{inherits:101,"safe-buffer":147,stream:156}],106:[function(t,e,r){var n=t("bn.js"),i=t("brorand");function o(t){this.rand=t||new i.Rand}e.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(t)>=0);return i},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var i=t.bitLength(),o=n.mont(t),a=new n(1).toRed(o);e||(e=Math.max(1,i/48|0));for(var s=t.subn(1),u=0;!s.testn(u);u++);for(var f=t.shrn(u),c=s.toRed(o);e>0;e--){var h=this._randrange(new n(2),s);r&&r(h);var d=h.toRed(o).redPow(f);if(0!==d.cmp(a)&&0!==d.cmp(c)){for(var l=1;l0;e--){var c=this._randrange(new n(2),a),h=t.gcd(c);if(0!==h.cmpn(1))return h;var d=c.toRed(i).redPow(u);if(0!==d.cmp(o)&&0!==d.cmp(f)){for(var l=1;l>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(t,e){return"hex"===e?o(t):t}},{}],109:[function(t,e,r){e.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],110:[function(t,e,r){var n=t("asn1.js");r.certificate=t("./certificate");var i=n.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=i;var o=n.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=o;var a=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=a;var s=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),u=n.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=u;var f=n.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=f;var c=n.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=c,r.DSAparam=n.define("DSAparam",function(){this.int()});var h=n.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(d),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=h;var d=n.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=n.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":111,"asn1.js":1}],111:[function(t,e,r){var n=t("asn1.js"),i=n.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),o=n.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),u=n.define("RelativeDistinguishedName",function(){this.setof(o)}),f=n.define("RDNSequence",function(){this.seqof(u)}),c=n.define("Name",function(){this.choice({rdnSequence:this.use(f)})}),h=n.define("Validity",function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))}),d=n.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),l=n.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(c),this.key("validity").use(h),this.key("subject").use(c),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(d).optional())}),p=n.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())});e.exports=p},{"asn1.js":1}],112:[function(t,e,r){(function(r){var n=/Proc-Type: 4,ENCRYPTED\n\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\n\r?\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?/m,i=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n/m,o=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?-----END \1-----$/m,a=t("evp_bytestokey"),s=t("browserify-aes");e.exports=function(t,e){var u,f=t.toString(),c=f.match(n);if(c){var h="aes"+c[1],d=new r(c[2],"hex"),l=new r(c[3].replace(/\r?\n/g,""),"base64"),p=a(e,d.slice(0,8),parseInt(c[1],10)).key,b=[],m=s.createDecipheriv(h,p,d);b.push(m.update(l)),b.push(m.final()),u=r.concat(b)}else{var y=f.match(o);u=new r(y[2].replace(/\r?\n/g,""),"base64")}return{tag:f.match(i)[1],data:u}}}).call(this,t("buffer").Buffer)},{"browserify-aes":20,buffer:47,evp_bytestokey:84}],113:[function(t,e,r){(function(r){var n=t("./asn1"),i=t("./aesid.json"),o=t("./fixProc"),a=t("browserify-aes"),s=t("pbkdf2");function u(t){var e;"object"!==(void 0===t?"undefined":_typeof(t))||r.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=new r(t));var u,f,c,h,d,l,p,b,m,y,v,g,w,_=o(t,e),M=_.tag,x=_.data;switch(M){case"CERTIFICATE":f=n.certificate.decode(x,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(f||(f=n.PublicKey.decode(x,"der")),u=f.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(f.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return f.subjectPrivateKey=f.subjectPublicKey,{type:"ec",data:f};case"1.2.840.10040.4.1":return f.algorithm.params.pub_key=n.DSAparam.decode(f.subjectPublicKey.data,"der"),{type:"dsa",data:f.algorithm.params};default:throw new Error("unknown key id "+u)}throw new Error("unknown key type "+M);case"ENCRYPTED PRIVATE KEY":x=n.EncryptedPrivateKey.decode(x,"der"),h=e,d=(c=x).algorithm.decrypt.kde.kdeparams.salt,l=parseInt(c.algorithm.decrypt.kde.kdeparams.iters.toString(),10),p=i[c.algorithm.decrypt.cipher.algo.join(".")],b=c.algorithm.decrypt.cipher.iv,m=c.subjectPrivateKey,y=parseInt(p.split("-")[1],10)/8,v=s.pbkdf2Sync(h,d,l,y),g=a.createDecipheriv(p,v,b),(w=[]).push(g.update(m)),w.push(g.final()),x=r.concat(w);case"PRIVATE KEY":switch(u=(f=n.PrivateKey.decode(x,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(f.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:f.algorithm.curve,privateKey:n.ECPrivateKey.decode(f.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return f.algorithm.params.priv_key=n.DSAparam.decode(f.subjectPrivateKey,"der"),{type:"dsa",params:f.algorithm.params};default:throw new Error("unknown key id "+u)}throw new Error("unknown key type "+M);case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(x,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(x,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(x,"der")};case"EC PRIVATE KEY":return{curve:(x=n.ECPrivateKey.decode(x,"der")).parameters.value,privateKey:x.privateKey};default:throw new Error("unknown key type "+M)}}e.exports=u,u.signature=n.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":109,"./asn1":110,"./fixProc":112,"browserify-aes":20,buffer:47,pbkdf2:114}],114:[function(t,e,r){r.pbkdf2=t("./lib/async"),r.pbkdf2Sync=t("./lib/sync")},{"./lib/async":115,"./lib/sync":118}],115:[function(t,e,r){(function(r,n){var i,o=t("./precondition"),a=t("./default-encoding"),s=t("./sync"),u=t("safe-buffer").Buffer,f=n.crypto&&n.crypto.subtle,c={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function d(t,e,r,n,i){return f.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then(function(t){return f.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)}).then(function(t){return u.from(t)})}e.exports=function(t,e,l,p,b,m){if(u.isBuffer(t)||(t=u.from(t,a)),u.isBuffer(e)||(e=u.from(e,a)),o(l,p),"function"==typeof b&&(m=b,b=void 0),"function"!=typeof m)throw new Error("No callback provided to pbkdf2");var y,v,g=c[(b=b||"sha1").toLowerCase()];if(!g||"function"!=typeof n.Promise)return r.nextTick(function(){var r;try{r=s(t,e,l,p,b)}catch(t){return m(t)}m(null,r)});y=function(t){if(n.process&&!n.process.browser)return Promise.resolve(!1);if(!f||!f.importKey||!f.deriveBits)return Promise.resolve(!1);if(void 0!==h[t])return h[t];var e=d(i=i||u.alloc(8),i,10,128,t).then(function(){return!0}).catch(function(){return!1});return h[t]=e,e}(g).then(function(r){return r?d(t,e,l,p,g):s(t,e,l,p,b)}),v=m,y.then(function(t){r.nextTick(function(){v(null,t)})},function(t){r.nextTick(function(){v(t)})})}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":116,"./precondition":117,"./sync":118,_process:120,"safe-buffer":147}],116:[function(t,e,r){(function(t){var r;t.browser?r="utf-8":r=parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";e.exports=r}).call(this,t("_process"))},{_process:120}],117:[function(t,e,r){var n=Math.pow(2,30)-1;e.exports=function(t,e){if("number"!=typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!=typeof e)throw new TypeError("Key length not a number");if(e<0||e>n||e!=e)throw new TypeError("Bad key length")}},{}],118:[function(t,e,r){var n=t("create-hash/md5"),i=t("ripemd160"),o=t("sha.js"),a=t("./precondition"),s=t("./default-encoding"),u=t("safe-buffer").Buffer,f=u.alloc(128),c={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function h(t,e,r){var a=function(t){return"rmd160"===t||"ripemd160"===t?i:"md5"===t?n:function(e){return o(t).update(e).digest()}}(t),s="sha512"===t||"sha384"===t?128:64;e.length>s?e=a(e):e.length1)for(var r=1;rp||new a(e).cmp(l.modulus)>=0)throw new Error("decryption error");d=c?f(new a(e),l):s(e,l);var b=new r(p-d.length);if(b.fill(0),d=r.concat([b,d],p),4===h)return function(t,e){t.modulus;var n=t.modulus.byteLength(),a=(e.length,u("sha1").update(new r("")).digest()),s=a.length;if(0!==e[0])throw new Error("decryption error");var f=e.slice(1,s+1),c=e.slice(s+1),h=o(f,i(c,s)),d=o(c,i(h,n-s-1));if(function(t,e){t=new r(t),e=new r(e);var n=0,i=t.length;t.length!==e.length&&(n++,i=Math.min(t.length,e.length));var o=-1;for(;++o=e.length){o++;break}var a=e.slice(2,i-1);e.slice(i-1,i);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return e.slice(i)}(0,d,c);if(3===h)return d;throw new Error("unknown padding")}}).call(this,t("buffer").Buffer)},{"./mgf":122,"./withPublic":125,"./xor":126,"bn.js":"BN","browserify-rsa":38,buffer:47,"create-hash":51,"parse-asn1":113}],124:[function(t,e,r){(function(r){var n=t("parse-asn1"),i=t("randombytes"),o=t("create-hash"),a=t("./mgf"),s=t("./xor"),u=t("bn.js"),f=t("./withPublic"),c=t("browserify-rsa");e.exports=function(t,e,h){var d;d=t.padding?t.padding:h?1:4;var l,p=n(t);if(4===d)l=function(t,e){var n=t.modulus.byteLength(),f=e.length,c=o("sha1").update(new r("")).digest(),h=c.length,d=2*h;if(f>n-d-2)throw new Error("message too long");var l=new r(n-f-d-2);l.fill(0);var p=n-h-1,b=i(h),m=s(r.concat([c,l,new r([1]),e],p),a(b,p)),y=s(b,a(m,h));return new u(r.concat([new r([0]),y,m],n))}(p,e);else if(1===d)l=function(t,e,n){var o,a=e.length,s=t.modulus.byteLength();if(a>s-11)throw new Error("message too long");n?(o=new r(s-a-3)).fill(255):o=function(t,e){var n,o=new r(t),a=0,s=i(2*t),u=0;for(;a=0)throw new Error("data too long for modulus")}return h?c(l,p):f(l,p)}}).call(this,t("buffer").Buffer)},{"./mgf":122,"./withPublic":125,"./xor":126,"bn.js":"BN","browserify-rsa":38,buffer:47,"create-hash":51,"parse-asn1":113,randombytes:131}],125:[function(t,e,r){(function(r){var n=t("bn.js");e.exports=function(t,e){return new r(t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed().toArray())}}).call(this,t("buffer").Buffer)},{"bn.js":"BN",buffer:47}],126:[function(t,e,r){e.exports=function(t,e){for(var r=t.length,n=-1;++n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},M=c-h,x=Math.floor,k=String.fromCharCode;function S(t){throw new RangeError(_[t])}function E(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function A(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+E((t=t.replace(w,".")).split("."),e).join(".")}function j(t){for(var e,r,n=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=k((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=k(t)}).join("")}function B(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function T(t,e,r){var n=0;for(t=r?x(t/p):t>>1,t+=x(t/e);t>M*d>>1;n+=c)t=x(t/M);return x(n+(M+1)*t/(t+l))}function C(t){var e,r,n,i,o,a,s,u,l,p,v,g=[],w=t.length,_=0,M=m,k=b;for((r=t.lastIndexOf(y))<0&&(r=0),n=0;n=128&&S("not-basic"),g.push(t.charCodeAt(n));for(i=r>0?r+1:0;i=w&&S("invalid-input"),((u=(v=t.charCodeAt(i++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:c)>=c||u>x((f-_)/a))&&S("overflow"),_+=u*a,!(u<(l=s<=k?h:s>=k+d?d:s-k));s+=c)a>x(f/(p=c-l))&&S("overflow"),a*=p;k=T(_-o,e=g.length+1,0==o),x(_/e)>f-M&&S("overflow"),M+=x(_/e),_%=e,g.splice(_++,0,M)}return I(g)}function P(t){var e,r,n,i,o,a,s,u,l,p,v,g,w,_,M,E=[];for(g=(t=j(t)).length,e=m,r=0,o=b,a=0;a=e&&vx((f-r)/(w=n+1))&&S("overflow"),r+=(s-e)*w,e=s,a=0;af&&S("overflow"),v==e){for(u=r,l=c;!(u<(p=l<=o?h:l>=o+d?d:l-o));l+=c)M=u-p,_=c-p,E.push(k(B(p+M%_,0))),u=x(M/_);E.push(k(B(u,0))),o=T(r,w,n==i),r=0,++n}++r,++e}return E.join("")}if(s={version:"1.4.1",ucs2:{decode:j,encode:I},decode:C,encode:P,toASCII:function(t){return A(t,function(t){return g.test(t)?"xn--"+P(t):t})},toUnicode:function(t){return A(t,function(t){return v.test(t)?C(t.slice(4).toLowerCase()):t})}},"function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define("punycode",function(){return s});else if(i&&o)if(e.exports==i)o.exports=s;else for(u in s)s.hasOwnProperty(u)&&(i[u]=s[u]);else n.punycode=s}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],128:[function(t,e,r){e.exports=function(t,e,r,i){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var a=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var u,f,c=t.length;s>0&&c>s&&(c=s);for(var h=0;h=0?(d=m.substr(0,y),l=m.substr(y+1)):(d=m,l=""),p=decodeURIComponent(d),b=decodeURIComponent(l),u=o,f=p,Object.prototype.hasOwnProperty.call(u,f)?n(o[p])?o[p].push(b):o[p]=[o[p],b]:o[p]=b}return o};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],129:[function(t,e,r){var n=function(t){switch(void 0===t?"undefined":_typeof(t)){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};e.exports=function(t,e,r,s){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"===(void 0===t?"undefined":_typeof(t))?o(a(t),function(a){var s=encodeURIComponent(n(a))+r;return i(t[a])?o(t[a],function(t){return s+encodeURIComponent(n(t))}).join(e):s+encodeURIComponent(n(t[a]))}).join(e):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n65536)throw new Error("requested too many random bytes");var a=new n.Uint8Array(t);t>0&&o.getRandomValues(a);var s=i.from(a.buffer);if("function"==typeof e)return r.nextTick(function(){e(null,s)});return s}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:120,"safe-buffer":147}],132:[function(t,e,r){(function(e,n){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=t("safe-buffer"),a=t("randombytes"),s=o.Buffer,u=o.kMaxLength,f=n.crypto||n.msCrypto,c=Math.pow(2,32)-1;function h(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>c||t<0)throw new TypeError("offset must be a uint32");if(t>u||t>e)throw new RangeError("offset out of range")}function d(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>c||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>u)throw new RangeError("buffer too small")}function l(t,r,n,i){if(e.browser){var o=t.buffer,s=new Uint8Array(o,r,n);return f.getRandomValues(s),i?void e.nextTick(function(){i(null,t)}):t}if(!i)return a(n).copy(t,r),t;a(n,function(e,n){if(e)return i(e);n.copy(t,r),i(null,t)})}f&&f.getRandomValues||!e.browser?(r.randomFill=function(t,e,r,i){if(!(s.isBuffer(t)||t instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)i=e,e=0,r=t.length;else if("function"==typeof r)i=r,r=t.length-e;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return h(e,t.length),d(r,e,t.length),l(t,e,r,i)},r.randomFillSync=function(t,e,r){void 0===e&&(e=0);if(!(s.isBuffer(t)||t instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');h(e,t.length),void 0===r&&(r=t.length-e);return d(r,e,t.length),l(t,e,r)}):(r.randomFill=i,r.randomFillSync=i)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:120,randombytes:131,"safe-buffer":147}],133:[function(t,e,r){e.exports=t("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":134}],134:[function(t,e,r){var n=t("process-nextick-args").nextTick,i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=h;var o=t("core-util-is");o.inherits=t("inherits");var a=t("./_stream_readable"),s=t("./_stream_writable");o.inherits(h,a);for(var u=i(s.prototype),f=0;f0?("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===f.prototype||(a=e,e=f.from(a)),n?u.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,u,e,!0):u.ended?t.emit("error",new Error("stream.push() after EOF")):(u.reading=!1,u.decoder&&!r?(e=u.decoder.write(e),u.objectMode||0!==e.length?_(t,u,e,!1):E(t,u)):_(t,u,e,!1))):n||(u.reading=!1));return!(s=u).ended&&(s.needReadable||s.lengthe.highWaterMark&&(e.highWaterMark=((r=t)>=M?r=M:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0));var r}function k(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(l("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i(S,t):S(t))}function S(t){l("emit readable"),t.emit("readable"),B(t)}function E(t,e){e.readingMore||(e.readingMore=!0,i(A,t,e))}function A(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;to.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=f.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function C(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i(P,e,t))}function P(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function R(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return l("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?C(this):k(this),null;if(0===(t=x(t,e))&&e.ended)return 0===e.length&&C(this),null;var n,i=e.needReadable;return l("need readable",i),(0===e.length||e.length-t0?T(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&C(this)),null!==n&&this.emit("data",n),n},g.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},g.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,l("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?c:w;function f(e,r){l("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,l("cleanup"),t.removeListener("close",v),t.removeListener("finish",g),t.removeListener("drain",d),t.removeListener("error",y),t.removeListener("unpipe",f),n.removeListener("end",c),n.removeListener("end",w),n.removeListener("data",m),p=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||d())}function c(){l("onend"),t.end()}o.endEmitted?i(u):n.once("end",u),t.on("unpipe",f);var h,d=(h=n,function(){var t=h._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(h,"data")&&(t.flowing=!0,B(h))});t.on("drain",d);var p=!1;var b=!1;function m(e){l("ondata"),b=!1,!1!==t.write(e)||b||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==R(o.pipes,t))&&!p&&(l("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,b=!0),n.pause())}function y(e){l("onerror",e),w(),t.removeListener("error",y),0===s(t,"error")&&t.emit("error",e)}function v(){t.removeListener("finish",g),w()}function g(){l("onfinish"),t.removeListener("close",v),w()}function w(){l("unpipe"),n.unpipe(t)}return n.on("data",m),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",y),t.once("close",v),t.once("finish",g),t.emit("pipe",n),o.flowing||(l("pipe resume"),n.resume()),t},g.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o-1?setImmediate:i;y.WritableState=m;var u=t("core-util-is");u.inherits=t("inherits");var f={deprecate:t("util-deprecate")},c=t("./internal/streams/stream"),h=t("safe-buffer").Buffer,d=n.Uint8Array||function(){};var l,p=t("./internal/streams/destroy");function b(){}function m(e,r){a=a||t("./_stream_duplex"),e=e||{};var n=r instanceof a;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var u=e.highWaterMark,f=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=u||0===u?u:n&&(f||0===f)?f:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===e.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,o=r.writecb;if(l=r,l.writing=!1,l.writecb=null,l.length-=l.writelen,l.writelen=0,e)u=t,f=r,c=n,h=e,d=o,--f.pendingcb,c?(i(d,h),i(x,u,f),u._writableState.errorEmitted=!0,u.emit("error",h)):(d(h),u._writableState.errorEmitted=!0,u.emit("error",h),x(u,f));else{var a=_(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||w(t,r),n?s(g,t,r,a,o):g(t,r,a,o)}var u,f,c,h,d;var l}(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function y(e){if(a=a||t("./_stream_duplex"),!(l.call(y,this)||this instanceof a))return new y(e);this._writableState=new m(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),c.call(this)}function v(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function g(t,e,r,n){var i,o;r||(i=t,0===(o=e).length&&o.needDrain&&(o.needDrain=!1,i.emit("drain"))),e.pendingcb--,n(),x(t,e)}function w(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),a=e.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,v(t,e,!0,e.length,i,"",a.finish),e.pendingcb++,e.lastBufferedRequest=null,a.next?(e.corkedRequestsFree=a.next,a.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,h=r.callback;if(v(t,e,!1,e.objectMode?1:f.length,f,c,h),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function _(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function M(t,e){t._final(function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),x(t,e)})}function x(t,e){var r,n,o=_(e);return o&&(r=t,(n=e).prefinished||n.finalCalled||("function"==typeof r._final?(n.pendingcb++,n.finalCalled=!0,i(M,r,n)):(n.prefinished=!0,r.emit("prefinish"))),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),o}u.inherits(y,c),m.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(m.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(t){return!!l.call(this,t)||this===y&&(t&&t._writableState instanceof m)}})):l=function(t){return t instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(t,e,r){var n,o,a,s,u,f,c,l,p,m,y,g=this._writableState,w=!1,_=!g.objectMode&&(n=t,h.isBuffer(n)||n instanceof d);return _&&!h.isBuffer(t)&&(o=t,t=h.from(o)),"function"==typeof e&&(r=e,e=null),_?e="buffer":e||(e=g.defaultEncoding),"function"!=typeof r&&(r=b),g.ended?(p=this,m=r,y=new Error("write after end"),p.emit("error",y),i(m,y)):(_||(a=this,s=g,f=r,c=!0,l=!1,null===(u=t)?l=new TypeError("May not write null values to stream"):"string"==typeof u||void 0===u||s.objectMode||(l=new TypeError("Invalid non-string/buffer chunk")),l&&(a.emit("error",l),i(f,l),c=!1),c))&&(g.pendingcb++,w=function(t,e,r,n,i,o){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=h.from(e,r));return e}(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},y.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,x(t,e),r&&(e.finished?i(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),y.prototype.destroy=p.destroy,y.prototype._undestroy=p.undestroy,y.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_stream_duplex":134,"./internal/streams/destroy":140,"./internal/streams/stream":141,_process:120,"core-util-is":49,inherits:101,"process-nextick-args":119,"safe-buffer":147,"util-deprecate":160}],139:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("util");e.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i,o=n.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=o,i=s,e.copy(r,i),s+=a.data.length,a=a.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},{"safe-buffer":147,util:17}],140:[function(t,e,r){var n=t("process-nextick-args").nextTick;function i(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||n(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(n(i,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":119}],141:[function(t,e,r){e.exports=t("events").EventEmitter},{events:83}],142:[function(t,e,r){e.exports=t("./readable").PassThrough},{"./readable":143}],143:[function(t,e,r){(r=e.exports=t("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":134,"./lib/_stream_passthrough.js":135,"./lib/_stream_readable.js":136,"./lib/_stream_transform.js":137,"./lib/_stream_writable.js":138}],144:[function(t,e,r){e.exports=t("./readable").Transform},{"./readable":143}],145:[function(t,e,r){e.exports=t("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":138}],146:[function(t,e,r){(function(r){var n=t("inherits"),i=t("hash-base");function o(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function a(t,e){return t<>>32-e}function s(t,e,r,n,i,o,s,u){return a(t+(e^r^n)+o+s|0,u)+i|0}function u(t,e,r,n,i,o,s,u){return a(t+(e&r|~e&n)+o+s|0,u)+i|0}function f(t,e,r,n,i,o,s,u){return a(t+((e|~r)^n)+o+s|0,u)+i|0}function c(t,e,r,n,i,o,s,u){return a(t+(e&n|r&~n)+o+s|0,u)+i|0}function h(t,e,r,n,i,o,s,u){return a(t+(e^(r|~n))+o+s|0,u)+i|0}n(o,i),o.prototype._update=function(){for(var t=new Array(16),e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d,d=this._e;d=s(d,r=s(r,n,i,o,d,t[0],0,11),n,i=a(i,10),o,t[1],0,14),n=s(n=a(n,10),i=s(i,o=s(o,d,r,n,i,t[2],0,15),d,r=a(r,10),n,t[3],0,12),o,d=a(d,10),r,t[4],0,5),o=s(o=a(o,10),d=s(d,r=s(r,n,i,o,d,t[5],0,8),n,i=a(i,10),o,t[6],0,7),r,n=a(n,10),i,t[7],0,9),r=s(r=a(r,10),n=s(n,i=s(i,o,d,r,n,t[8],0,11),o,d=a(d,10),r,t[9],0,13),i,o=a(o,10),d,t[10],0,14),i=s(i=a(i,10),o=s(o,d=s(d,r,n,i,o,t[11],0,15),r,n=a(n,10),i,t[12],0,6),d,r=a(r,10),n,t[13],0,7),d=u(d=a(d,10),r=s(r,n=s(n,i,o,d,r,t[14],0,9),i,o=a(o,10),d,t[15],0,8),n,i=a(i,10),o,t[7],1518500249,7),n=u(n=a(n,10),i=u(i,o=u(o,d,r,n,i,t[4],1518500249,6),d,r=a(r,10),n,t[13],1518500249,8),o,d=a(d,10),r,t[1],1518500249,13),o=u(o=a(o,10),d=u(d,r=u(r,n,i,o,d,t[10],1518500249,11),n,i=a(i,10),o,t[6],1518500249,9),r,n=a(n,10),i,t[15],1518500249,7),r=u(r=a(r,10),n=u(n,i=u(i,o,d,r,n,t[3],1518500249,15),o,d=a(d,10),r,t[12],1518500249,7),i,o=a(o,10),d,t[0],1518500249,12),i=u(i=a(i,10),o=u(o,d=u(d,r,n,i,o,t[9],1518500249,15),r,n=a(n,10),i,t[5],1518500249,9),d,r=a(r,10),n,t[2],1518500249,11),d=u(d=a(d,10),r=u(r,n=u(n,i,o,d,r,t[14],1518500249,7),i,o=a(o,10),d,t[11],1518500249,13),n,i=a(i,10),o,t[8],1518500249,12),n=f(n=a(n,10),i=f(i,o=f(o,d,r,n,i,t[3],1859775393,11),d,r=a(r,10),n,t[10],1859775393,13),o,d=a(d,10),r,t[14],1859775393,6),o=f(o=a(o,10),d=f(d,r=f(r,n,i,o,d,t[4],1859775393,7),n,i=a(i,10),o,t[9],1859775393,14),r,n=a(n,10),i,t[15],1859775393,9),r=f(r=a(r,10),n=f(n,i=f(i,o,d,r,n,t[8],1859775393,13),o,d=a(d,10),r,t[1],1859775393,15),i,o=a(o,10),d,t[2],1859775393,14),i=f(i=a(i,10),o=f(o,d=f(d,r,n,i,o,t[7],1859775393,8),r,n=a(n,10),i,t[0],1859775393,13),d,r=a(r,10),n,t[6],1859775393,6),d=f(d=a(d,10),r=f(r,n=f(n,i,o,d,r,t[13],1859775393,5),i,o=a(o,10),d,t[11],1859775393,12),n,i=a(i,10),o,t[5],1859775393,7),n=c(n=a(n,10),i=c(i,o=f(o,d,r,n,i,t[12],1859775393,5),d,r=a(r,10),n,t[1],2400959708,11),o,d=a(d,10),r,t[9],2400959708,12),o=c(o=a(o,10),d=c(d,r=c(r,n,i,o,d,t[11],2400959708,14),n,i=a(i,10),o,t[10],2400959708,15),r,n=a(n,10),i,t[0],2400959708,14),r=c(r=a(r,10),n=c(n,i=c(i,o,d,r,n,t[8],2400959708,15),o,d=a(d,10),r,t[12],2400959708,9),i,o=a(o,10),d,t[4],2400959708,8),i=c(i=a(i,10),o=c(o,d=c(d,r,n,i,o,t[13],2400959708,9),r,n=a(n,10),i,t[3],2400959708,14),d,r=a(r,10),n,t[7],2400959708,5),d=c(d=a(d,10),r=c(r,n=c(n,i,o,d,r,t[15],2400959708,6),i,o=a(o,10),d,t[14],2400959708,8),n,i=a(i,10),o,t[5],2400959708,6),n=h(n=a(n,10),i=c(i,o=c(o,d,r,n,i,t[6],2400959708,5),d,r=a(r,10),n,t[2],2400959708,12),o,d=a(d,10),r,t[4],2840853838,9),o=h(o=a(o,10),d=h(d,r=h(r,n,i,o,d,t[0],2840853838,15),n,i=a(i,10),o,t[5],2840853838,5),r,n=a(n,10),i,t[9],2840853838,11),r=h(r=a(r,10),n=h(n,i=h(i,o,d,r,n,t[7],2840853838,6),o,d=a(d,10),r,t[12],2840853838,8),i,o=a(o,10),d,t[2],2840853838,13),i=h(i=a(i,10),o=h(o,d=h(d,r,n,i,o,t[10],2840853838,12),r,n=a(n,10),i,t[14],2840853838,5),d,r=a(r,10),n,t[1],2840853838,12),d=h(d=a(d,10),r=h(r,n=h(n,i,o,d,r,t[3],2840853838,13),i,o=a(o,10),d,t[8],2840853838,14),n,i=a(i,10),o,t[11],2840853838,11),n=h(n=a(n,10),i=h(i,o=h(o,d,r,n,i,t[6],2840853838,8),d,r=a(r,10),n,t[15],2840853838,5),o,d=a(d,10),r,t[13],2840853838,6),o=a(o,10);var l=this._a,p=this._b,b=this._c,m=this._d,y=this._e;y=h(y,l=h(l,p,b,m,y,t[5],1352829926,8),p,b=a(b,10),m,t[14],1352829926,9),p=h(p=a(p,10),b=h(b,m=h(m,y,l,p,b,t[7],1352829926,9),y,l=a(l,10),p,t[0],1352829926,11),m,y=a(y,10),l,t[9],1352829926,13),m=h(m=a(m,10),y=h(y,l=h(l,p,b,m,y,t[2],1352829926,15),p,b=a(b,10),m,t[11],1352829926,15),l,p=a(p,10),b,t[4],1352829926,5),l=h(l=a(l,10),p=h(p,b=h(b,m,y,l,p,t[13],1352829926,7),m,y=a(y,10),l,t[6],1352829926,7),b,m=a(m,10),y,t[15],1352829926,8),b=h(b=a(b,10),m=h(m,y=h(y,l,p,b,m,t[8],1352829926,11),l,p=a(p,10),b,t[1],1352829926,14),y,l=a(l,10),p,t[10],1352829926,14),y=c(y=a(y,10),l=h(l,p=h(p,b,m,y,l,t[3],1352829926,12),b,m=a(m,10),y,t[12],1352829926,6),p,b=a(b,10),m,t[6],1548603684,9),p=c(p=a(p,10),b=c(b,m=c(m,y,l,p,b,t[11],1548603684,13),y,l=a(l,10),p,t[3],1548603684,15),m,y=a(y,10),l,t[7],1548603684,7),m=c(m=a(m,10),y=c(y,l=c(l,p,b,m,y,t[0],1548603684,12),p,b=a(b,10),m,t[13],1548603684,8),l,p=a(p,10),b,t[5],1548603684,9),l=c(l=a(l,10),p=c(p,b=c(b,m,y,l,p,t[10],1548603684,11),m,y=a(y,10),l,t[14],1548603684,7),b,m=a(m,10),y,t[15],1548603684,7),b=c(b=a(b,10),m=c(m,y=c(y,l,p,b,m,t[8],1548603684,12),l,p=a(p,10),b,t[12],1548603684,7),y,l=a(l,10),p,t[4],1548603684,6),y=c(y=a(y,10),l=c(l,p=c(p,b,m,y,l,t[9],1548603684,15),b,m=a(m,10),y,t[1],1548603684,13),p,b=a(b,10),m,t[2],1548603684,11),p=f(p=a(p,10),b=f(b,m=f(m,y,l,p,b,t[15],1836072691,9),y,l=a(l,10),p,t[5],1836072691,7),m,y=a(y,10),l,t[1],1836072691,15),m=f(m=a(m,10),y=f(y,l=f(l,p,b,m,y,t[3],1836072691,11),p,b=a(b,10),m,t[7],1836072691,8),l,p=a(p,10),b,t[14],1836072691,6),l=f(l=a(l,10),p=f(p,b=f(b,m,y,l,p,t[6],1836072691,6),m,y=a(y,10),l,t[9],1836072691,14),b,m=a(m,10),y,t[11],1836072691,12),b=f(b=a(b,10),m=f(m,y=f(y,l,p,b,m,t[8],1836072691,13),l,p=a(p,10),b,t[12],1836072691,5),y,l=a(l,10),p,t[2],1836072691,14),y=f(y=a(y,10),l=f(l,p=f(p,b,m,y,l,t[10],1836072691,13),b,m=a(m,10),y,t[0],1836072691,13),p,b=a(b,10),m,t[4],1836072691,7),p=u(p=a(p,10),b=u(b,m=f(m,y,l,p,b,t[13],1836072691,5),y,l=a(l,10),p,t[8],2053994217,15),m,y=a(y,10),l,t[6],2053994217,5),m=u(m=a(m,10),y=u(y,l=u(l,p,b,m,y,t[4],2053994217,8),p,b=a(b,10),m,t[1],2053994217,11),l,p=a(p,10),b,t[3],2053994217,14),l=u(l=a(l,10),p=u(p,b=u(b,m,y,l,p,t[11],2053994217,14),m,y=a(y,10),l,t[15],2053994217,6),b,m=a(m,10),y,t[0],2053994217,14),b=u(b=a(b,10),m=u(m,y=u(y,l,p,b,m,t[5],2053994217,6),l,p=a(p,10),b,t[12],2053994217,9),y,l=a(l,10),p,t[2],2053994217,12),y=u(y=a(y,10),l=u(l,p=u(p,b,m,y,l,t[13],2053994217,9),b,m=a(m,10),y,t[9],2053994217,12),p,b=a(b,10),m,t[7],2053994217,5),p=s(p=a(p,10),b=u(b,m=u(m,y,l,p,b,t[10],2053994217,15),y,l=a(l,10),p,t[14],2053994217,8),m,y=a(y,10),l,t[12],0,8),m=s(m=a(m,10),y=s(y,l=s(l,p,b,m,y,t[15],0,5),p,b=a(b,10),m,t[10],0,12),l,p=a(p,10),b,t[4],0,9),l=s(l=a(l,10),p=s(p,b=s(b,m,y,l,p,t[1],0,12),m,y=a(y,10),l,t[5],0,5),b,m=a(m,10),y,t[8],0,14),b=s(b=a(b,10),m=s(m,y=s(y,l,p,b,m,t[7],0,6),l,p=a(p,10),b,t[6],0,8),y,l=a(l,10),p,t[2],0,13),y=s(y=a(y,10),l=s(l,p=s(p,b,m,y,l,t[13],0,6),b,m=a(m,10),y,t[14],0,5),p,b=a(b,10),m,t[0],0,15),p=s(p=a(p,10),b=s(b,m=s(m,y,l,p,b,t[3],0,13),y,l=a(l,10),p,t[9],0,11),m,y=a(y,10),l,t[11],0,11),m=a(m,10);var v=this._b+i+m|0;this._b=this._c+o+y|0,this._c=this._d+d+l|0,this._d=this._e+r+p|0,this._e=this._a+n+b|0,this._a=v},o.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=new r(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},e.exports=o}).call(this,t("buffer").Buffer)},{buffer:47,"hash-base":85,inherits:101}],147:[function(t,e,r){var n=t("buffer"),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,r),r.Buffer=a),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:47}],148:[function(t,e,r){var n=t("safe-buffer").Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},{"safe-buffer":147}],149:[function(t,e,r){(r=e.exports=function(t){t=t.toLowerCase();var e=r[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e}).sha=t("./sha"),r.sha1=t("./sha1"),r.sha224=t("./sha224"),r.sha256=t("./sha256"),r.sha384=t("./sha384"),r.sha512=t("./sha512")},{"./sha":150,"./sha1":151,"./sha224":152,"./sha256":153,"./sha384":154,"./sha512":155}],150:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r,n,i,o,s,u=this._w,f=0|this._a,c=0|this._b,h=0|this._c,d=0|this._d,l=0|this._e,p=0;p<16;++p)u[p]=t.readInt32BE(4*p);for(;p<80;++p)u[p]=u[p-3]^u[p-8]^u[p-14]^u[p-16];for(var b=0;b<80;++b){var m=~~(b/20),y=0|((s=f)<<5|s>>>27)+(n=c,i=h,o=d,0===(r=m)?n&i|~n&o:2===r?n&i|n&o|i&o:n^i^o)+l+u[b]+a[m];l=d,d=h,h=(e=c)<<30|e>>>2,c=f,f=y}this._a=f+this._a|0,this._b=c+this._b|0,this._c=h+this._c|0,this._d=d+this._d|0,this._e=l+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=u},{"./hash":148,inherits:101,"safe-buffer":147}],151:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r,n,i,o,s,u,f=this._w,c=0|this._a,h=0|this._b,d=0|this._c,l=0|this._d,p=0|this._e,b=0;b<16;++b)f[b]=t.readInt32BE(4*b);for(;b<80;++b)f[b]=(e=f[b-3]^f[b-8]^f[b-14]^f[b-16])<<1|e>>>31;for(var m=0;m<80;++m){var y=~~(m/20),v=0|((u=c)<<5|u>>>27)+(i=h,o=d,s=l,0===(n=y)?i&o|~i&s:2===n?i&o|i&s|o&s:i^o^s)+p+f[m]+a[y];p=l,l=d,d=(r=h)<<30|r>>>2,h=c,c=v}this._a=c+this._a|0,this._b=h+this._b|0,this._c=d+this._c|0,this._d=l+this._d|0,this._e=p+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=u},{"./hash":148,inherits:101,"safe-buffer":147}],152:[function(t,e,r){var n=t("inherits"),i=t("./sha256"),o=t("./hash"),a=t("safe-buffer").Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var t=a.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},e.exports=u},{"./hash":148,"./sha256":153,inherits:101,"safe-buffer":147}],153:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e,r,n,i,o,s,u,f=this._w,c=0|this._a,h=0|this._b,d=0|this._c,l=0|this._d,p=0|this._e,b=0|this._f,m=0|this._g,y=0|this._h,v=0;v<16;++v)f[v]=t.readInt32BE(4*v);for(;v<64;++v)f[v]=0|(((r=f[v-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+f[v-7]+(((e=f[v-15])>>>7|e<<25)^(e>>>18|e<<14)^e>>>3)+f[v-16];for(var g=0;g<64;++g){var w=y+(((u=p)>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+((s=m)^p&(b^s))+a[g]+f[g]|0,_=0|(((o=c)>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+((n=c)&(i=h)|d&(n|i));y=m,m=b,b=p,p=l+w|0,l=d,d=h,h=c,c=w+_|0}this._a=c+this._a|0,this._b=h+this._b|0,this._c=d+this._c|0,this._d=l+this._d|0,this._e=p+this._e|0,this._f=b+this._f|0,this._g=m+this._g|0,this._h=y+this._h|0},u.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},e.exports=u},{"./hash":148,inherits:101,"safe-buffer":147}],154:[function(t,e,r){var n=t("inherits"),i=t("./sha512"),o=t("./hash"),a=t("safe-buffer").Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var t=a.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},e.exports=u},{"./hash":148,"./sha512":155,inherits:101,"safe-buffer":147}],155:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function f(t,e,r){return r^t&(e^r)}function c(t,e,r){return t&e|r&(t|e)}function h(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function d(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function l(t,e){return t>>>0>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e,r,n,i,o,s,u,p,b=this._w,m=0|this._ah,y=0|this._bh,v=0|this._ch,g=0|this._dh,w=0|this._eh,_=0|this._fh,M=0|this._gh,x=0|this._hh,k=0|this._al,S=0|this._bl,E=0|this._cl,A=0|this._dl,j=0|this._el,I=0|this._fl,B=0|this._gl,T=0|this._hl,C=0;C<32;C+=2)b[C]=t.readInt32BE(4*C),b[C+1]=t.readInt32BE(4*C+4);for(;C<160;C+=2){var P=b[C-30],R=b[C-30+1],O=((u=P)>>>1|(p=R)<<31)^(u>>>8|p<<24)^u>>>7,N=((o=R)>>>1|(s=P)<<31)^(o>>>8|s<<24)^(o>>>7|s<<25);P=b[C-4],R=b[C-4+1];var L=((n=P)>>>19|(i=R)<<13)^(i>>>29|n<<3)^n>>>6,F=((e=R)>>>19|(r=P)<<13)^(r>>>29|e<<3)^(e>>>6|r<<26),q=b[C-14],D=b[C-14+1],U=b[C-32],z=b[C-32+1],K=N+D|0,H=O+q+l(K,N)|0;H=(H=H+L+l(K=K+F|0,F)|0)+U+l(K=K+z|0,z)|0,b[C]=H,b[C+1]=K}for(var V=0;V<160;V+=2){H=b[V],K=b[V+1];var W=c(m,y,v),X=c(k,S,E),G=h(m,k),J=h(k,m),Z=d(w,j),$=d(j,w),Y=a[V],Q=a[V+1],tt=f(w,_,M),et=f(j,I,B),rt=T+$|0,nt=x+Z+l(rt,T)|0;nt=(nt=(nt=nt+tt+l(rt=rt+et|0,et)|0)+Y+l(rt=rt+Q|0,Q)|0)+H+l(rt=rt+K|0,K)|0;var it=J+X|0,ot=G+W+l(it,J)|0;x=M,T=B,M=_,B=I,_=w,I=j,w=g+nt+l(j=A+rt|0,A)|0,g=v,A=E,v=y,E=S,y=m,S=k,m=nt+ot+l(k=rt+it|0,rt)|0}this._al=this._al+k|0,this._bl=this._bl+S|0,this._cl=this._cl+E|0,this._dl=this._dl+A|0,this._el=this._el+j|0,this._fl=this._fl+I|0,this._gl=this._gl+B|0,this._hl=this._hl+T|0,this._ah=this._ah+m+l(this._al,k)|0,this._bh=this._bh+y+l(this._bl,S)|0,this._ch=this._ch+v+l(this._cl,E)|0,this._dh=this._dh+g+l(this._dl,A)|0,this._eh=this._eh+w+l(this._el,j)|0,this._fh=this._fh+_+l(this._fl,I)|0,this._gh=this._gh+M+l(this._gl,B)|0,this._hh=this._hh+x+l(this._hl,T)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},e.exports=u},{"./hash":148,inherits:101,"safe-buffer":147}],156:[function(t,e,r){e.exports=i;var n=t("events").EventEmitter;function i(){n.call(this)}t("inherits")(i,n),i.Readable=t("readable-stream/readable.js"),i.Writable=t("readable-stream/writable.js"),i.Duplex=t("readable-stream/duplex.js"),i.Transform=t("readable-stream/transform.js"),i.PassThrough=t("readable-stream/passthrough.js"),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,t.end())}function u(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function f(t){if(c(),0===n.listenerCount(this,"error"))throw t}function c(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("error",f),t.on("error",f),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}},{events:83,inherits:101,"readable-stream/duplex.js":133,"readable-stream/passthrough.js":142,"readable-stream/readable.js":143,"readable-stream/transform.js":144,"readable-stream/writable.js":145}],157:[function(t,e,r){var n=t("safe-buffer").Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=f,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=c,this.end=h,e=3;break;default:return this.write=d,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:-1}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�".repeat(r);if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�".repeat(r+1);if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�".repeat(r+2)}}(this,t,e);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function f(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function c(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function l(t){return t&&t.length?this.write(t):""}r.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":147}],158:[function(t,e,r){var n=t("punycode"),i=t("./util");function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}r.parse=g,r.resolve=function(t,e){return g(t,!1,!0).resolve(e)},r.resolveObject=function(t,e){return t?g(t,!1,!0).resolveObject(e):e},r.format=function(t){i.isString(t)&&(t=g(t));return t instanceof o?t.format():o.prototype.format.call(t)},r.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,f=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(f),h=["%","/","?",";","#"].concat(c),d=["/","?","#"],l=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=t("querystring");function g(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+(void 0===t?"undefined":_typeof(t)));var o=t.indexOf("?"),s=-1!==o&&o127?P+="x":P+=C[R];if(!P.match(l)){var N=B.slice(0,A),L=B.slice(A+1),F=C.match(p);F&&(N.push(F[1]),L.unshift(F[2])),L.length&&(g="/"+L.join(".")+g),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=n.toASCII(this.hostname));var q=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+q,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==g[0]&&(g="/"+g))}if(!b[M])for(A=0,T=c.length;A0)&&r.host.split("@"))&&(r.auth=I.shift(),r.host=r.hostname=I.shift());return r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!x.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var S=x.slice(-1)[0],E=(r.host||t.host||x.length>1)&&("."===S||".."===S)||""===S,A=0,j=x.length;j>=0;j--)"."===(S=x[j])?x.splice(j,1):".."===S?(x.splice(j,1),A++):A&&(x.splice(j,1),A--);if(!_&&!M)for(;A--;A)x.unshift("..");!_||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),E&&"/"!==x.join("/").substr(-1)&&x.push("");var I,B=""===x[0]||x[0]&&"/"===x[0].charAt(0);k&&(r.hostname=r.host=B?"":x.length?x.shift():"",(I=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=I.shift(),r.host=r.hostname=I.shift()));return(_=_||r.host&&x.length)&&!B&&x.unshift(""),x.length?r.pathname=x.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":159,punycode:127,querystring:130}],159:[function(t,e,r){e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"===(void 0===t?"undefined":_typeof(t))&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],160:[function(t,e,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(t){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],161:[function(require,module,exports){var indexOf=require("indexof"),Object_keys=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var r in t)e.push(r);return e},forEach=function(t,e){if(t.forEach)return t.forEach(e);for(var r=0;r>6|192);else{if(i>55295&&i<56320){if(++n==t.length)return null;var o=t.charCodeAt(n);if(o<56320||o>57343)return null;r+=e((i=65536+((1023&i)<<10)+(1023&o))>>18|240),r+=e(i>>12&63|128)}else r+=e(i>>12|224);r+=e(i>>6&63|128)}r+=e(63&i|128)}}return r},toString:function(t){for(var e="",r=0,o=i(t);r127){if(a>191&&a<224){if(r>=o)return null;a=(31&a)<<6|63&n(t,r)}else if(a>223&&a<240){if(r+1>=o)return null;a=(15&a)<<12|(63&n(t,r))<<6|63&n(t,++r)}else{if(!(a>239&&a<248))return null;if(r+2>=o)return null;a=(7&a)<<18|(63&n(t,r))<<12|(63&n(t,++r))<<6|63&n(t,++r)}++r}if(a<=65535)e+=String.fromCharCode(a);else{if(!(a<=1114111))return null;a-=65536,e+=String.fromCharCode(a>>10|55296),e+=String.fromCharCode(1023&a|56320)}}return e},fromNumber:function(t){var e=t.toString(16);return e.length%2==0?"0x"+e:"0x0"+e},toNumber:function(t){return parseInt(t.slice(2),16)},fromNat:function(t){return"0x0"===t?"0x":t.length%2==0?t:"0x0"+t.slice(2)},toNat:function(t){return"0"===t[2]?"0x"+t.slice(3):t},fromArray:a,toArray:o,fromUint8Array:function(t){return a([].slice.call(t,0))},toUint8Array:function(t){return new Uint8Array(o(t))}}},{"./array.js":163}],165:[function(t,e,r){var n="0123456789abcdef".split(""),i=[1,256,65536,16777216],o=[0,8,16,24],a=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],s=function(t){var e,r,n,i,o,s,u,f,c,h,d,l,p,b,m,y,v,g,w,_,M,x,k,S,E,A,j,I,B,T,C,P,R,O,N,L,F,q,D,U,z,K,H,V,W,X,G,J,Z,$,Y,Q,tt,et,rt,nt,it,ot,at,st,ut,ft,ct;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],f=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],h=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],e=(l=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(f<<1|c>>>31),r=o^(c<<1|f>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(h<<1|d>>>31),r=u^(d<<1|h>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=f^(l<<1|p>>>31),r=c^(p<<1|l>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=h^(i<<1|o>>>31),r=d^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,b=t[0],m=t[1],X=t[11]<<4|t[10]>>>28,G=t[10]<<4|t[11]>>>28,I=t[20]<<3|t[21]>>>29,B=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,K=t[40]<<18|t[41]>>>14,H=t[41]<<18|t[40]>>>14,O=t[2]<<1|t[3]>>>31,N=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,Z=t[23]<<10|t[22]>>>22,T=t[33]<<13|t[32]>>>19,C=t[32]<<13|t[33]>>>19,ft=t[42]<<2|t[43]>>>30,ct=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,F=t[15]<<6|t[14]>>>26,g=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,P=t[45]<<29|t[44]>>>3,R=t[44]<<29|t[45]>>>3,S=t[6]<<28|t[7]>>>4,E=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,q=t[26]<<25|t[27]>>>7,D=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,V=t[8]<<27|t[9]>>>5,W=t[9]<<27|t[8]>>>5,A=t[18]<<20|t[19]>>>12,j=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,U=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,x=t[48]<<14|t[49]>>>18,k=t[49]<<14|t[48]>>>18,t[0]=b^~y&g,t[1]=m^~v&w,t[10]=S^~A&I,t[11]=E^~j&B,t[20]=O^~L&q,t[21]=N^~F&D,t[30]=V^~X&J,t[31]=W^~G&Z,t[40]=et^~nt&ot,t[41]=rt^~it&at,t[2]=y^~g&_,t[3]=v^~w&M,t[12]=A^~I&T,t[13]=j^~B&C,t[22]=L^~q&U,t[23]=F^~D&z,t[32]=X^~J&$,t[33]=G^~Z&Y,t[42]=nt^~ot&st,t[43]=it^~at&ut,t[4]=g^~_&x,t[5]=w^~M&k,t[14]=I^~T&P,t[15]=B^~C&R,t[24]=q^~U&K,t[25]=D^~z&H,t[34]=J^~$&Q,t[35]=Z^~Y&tt,t[44]=ot^~st&ft,t[45]=at^~ut&ct,t[6]=_^~x&b,t[7]=M^~k&m,t[16]=T^~P&S,t[17]=C^~R&E,t[26]=U^~K&O,t[27]=z^~H&N,t[36]=$^~Q&V,t[37]=Y^~tt&W,t[46]=st^~ft&et,t[47]=ut^~ct&rt,t[8]=x^~b&y,t[9]=k^~m&v,t[18]=P^~S&A,t[19]=R^~E&j,t[28]=K^~O&L,t[29]=H^~N&F,t[38]=Q^~V&X,t[39]=tt^~W&G,t[48]=ft^~et&nt,t[49]=ct^~rt&it,t[0]^=a[n],t[1]^=a[n+1]},u=function(t){return function(e){var r,a,u;if("0x"===e.slice(0,2)){r=[];for(var f=2,c=e.length;f>2]|=e[l]<>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(u[m>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=f){for(t.start=m-f,t.block=u[c],m=0;m>2]|=i[3&m],t.lastByteIndex===f)for(u[0]=u[c],m=1;m>4&15]+n[15&p]+n[p>>12&15]+n[p>>8&15]+n[p>>20&15]+n[p>>16&15]+n[p>>28&15]+n[p>>24&15];y%c==0&&(s(d),m=0)}return"0x"+b}({blocks:[],reset:!0,block:0,start:0,blockCount:1600-((a=t)<<1)>>5,outputBlocks:a>>5,s:(u=[0,0,0,0,0,0,0,0,0,0],[].concat(u,u,u,u,u))},r)}};e.exports={keccak256:u(256),keccak512:u(512),keccak256s:u(256),keccak512s:u(512)}},{}],166:[function(t,e,r){var n=t("is-function");e.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");arguments.length<3&&(r=this);"[object Array]"===i.call(t)?function(t,e,r){for(var n=0,i=t.length;n0){var a=i.join(r,o);n.push(g(t)(e[o])(a))}return Promise.all(n).then(function(){return r})})}}},_=function(t){return function(e){return u(t+"/bzzr:/",{body:"string"==typeof e?L(e):e,method:"POST"})}},M=function(t){return function(e){return function(r){return function(n){return function i(o){var a="/"===r[0]?r:"/"+r,s=t+"/bzz:/"+e+a,f={method:"PUT",headers:{"Content-Type":n.type},body:n.data};return u(s,f).then(function(t){if(-1!==t.indexOf("error"))throw t;return t}).catch(function(t){return o>0&&i(o-1)})}(3)}}}},x=function(t){return function(e){return S(t)({"":e})}},k=function(t){return function(r){return e.readFile(r).then(function(e){return x(t)({type:a.lookup(r),data:e})})}},S=function(t){return function(e){return _(t)("{}").then(function(r){return Object.keys(e).reduce(function(r,n){return r.then((i=n,function(r){return M(t)(r)(i)(e[i])}));var i},Promise.resolve(r))})}},E=function(t){return function(r){return e.readFile(r).then(_(t))}},A=function(t){return function(n){return function(i){return r.directoryTree(i).then(function(t){return Promise.all(t.map(function(t){return e.readFile(t)})).then(function(e){var r=t.map(function(t){return t.slice(i.length)}),n=t.map(function(t){return a.lookup(t)||"text/plain"});return l(r)(e.map(function(t,e){return{type:n[e],data:t}}))})}).then(function(t){return(e=n?{"":t[n]}:{},function(t){var r={};for(var n in e)r[n]=e[n];for(var i in t)r[i]=t[i];return r})(t);var e}).then(S(t))}}},j=function(t){return function(e){if("data"===e.pick)return d.data().then(_(t));if("file"===e.pick)return d.file().then(x(t));if("directory"===e.pick)return d.directory().then(S(t));if(e.path)switch(e.kind){case"data":return E(t)(e.path);case"file":return k(t)(e.path);case"directory":return A(t)(e.defaultFile)(e.path)}else{if(e.length||"string"==typeof e)return _(t)(e);if(e instanceof Object)return S(t)(e)}return Promise.reject(new Error("Bad arguments"))}},I=function(t){return function(e){return function(r){return R(t)(e).then(function(n){return n?r?w(t)(e)(r):v(t)(e):r?g(t)(e)(r):b(t)(e)})}}},B=function(t,e){var i=n.platform().replace("win32","windows")+"-"+("x64"===n.arch()?"amd64":"386"),o=(e||s)[i],a=f+o.archive+".tar.gz",u=o.archiveMD5,c=o.binaryMD5;return r.safeDownloadArchived(a)(u)(c)(t)},T=function(t){return new Promise(function(e,r){var n=o.spawn,i=function(t){return function(e){return-1!==(""+e).indexOf(t)}},a=t.account,s=t.password,u=t.dataDir,f=t.ensApi,c=t.privateKey,h=0,d=n(t.binPath,["--bzzaccount",a||c,"--datadir",u,"--ens-api",f]),l=function(t){0===h&&i("Passphrase")(t)?setTimeout(function(){h=1,d.stdin.write(s+"\n")},500):i("Swarm http proxy started")(t)&&(h=2,clearTimeout(p),e(d))};d.stdout.on("data",l),d.stderr.on("data",l);var p=setTimeout(function(){return r(new Error("Couldn't start swarm process."))},2e4)})},C=function(t){return new Promise(function(e,r){t.stderr.removeAllListeners("data"),t.stdout.removeAllListeners("data"),t.stdin.removeAllListeners("error"),t.removeAllListeners("error"),t.removeAllListeners("exit"),t.kill("SIGINT");var n=setTimeout(function(){return t.kill("SIGKILL")},8e3);t.once("close",function(){clearTimeout(n),e()})})},P=function(t){return _(t)("test").then(function(t){return"c9a99c7d326dcc6316f32fe2625b311f6dc49a175e6877681ded93137d3569e7"===t}).catch(function(){return!1})},R=function(t){return function(e){return b(t)(e).then(function(t){try{return!!JSON.parse(N(t)).entries}catch(t){return!1}})}},O=function(t){return function(e,r,n,i,o){var a;return void 0!==e&&(a=t(e)),void 0!==r&&(a=t(r)),void 0!==n&&(a=t(n)),void 0!==i&&(a=t(i)),void 0!==o&&(a=t(o)),a}},N=function(t){return c.toString(c.fromUint8Array(t))},L=function(t){return c.toUint8Array(c.fromString(t))},F=function(t){return{download:function(e,r){return I(t)(e)(r)},downloadData:O(b(t)),downloadDataToDisk:O(g(t)),downloadDirectory:O(v(t)),downloadDirectoryToDisk:O(w(t)),downloadEntries:O(m(t)),downloadRoutes:O(y(t)),isAvailable:function(){return P(t)},upload:function(e){return j(t)(e)},uploadData:O(_(t)),uploadFile:O(x(t)),uploadFileFromDisk:O(x(t)),uploadDataFromDisk:O(E(t)),uploadDirectory:O(S(t)),uploadDirectoryFromDisk:O(A(t)),uploadToManifest:O(M(t)),pick:d,hash:h,fromString:L,toString:N}};return{at:F,local:function(t){return function(e){return P("http://localhost:8500").then(function(r){return r?e(F("http://localhost:8500")).then(function(){}):B(t.binPath,t.archives).onData(function(e){return(t.onProgress||function(){})(e.length)}).then(function(){return T(t)}).then(function(t){return e(F("http://localhost:8500")).then(function(){return t})}).then(C)})}},download:I,downloadBinary:B,downloadData:b,downloadDataToDisk:g,downloadDirectory:v,downloadDirectoryToDisk:w,downloadEntries:m,downloadRoutes:y,isAvailable:P,startProcess:T,stopProcess:C,upload:j,uploadData:_,uploadDataFromDisk:E,uploadFile:x,uploadFileFromDisk:k,uploadDirectory:S,uploadDirectoryFromDisk:A,uploadToManifest:M,pick:d,hash:h,fromString:L,toString:N}}},{}],177:[function(t,e,r){(r=e.exports=function(t){return t.replace(/^\s*|\s*$/g,"")}).left=function(t){return t.replace(/^\s*/,"")},r.right=function(t){return t.replace(/\s*$/,"")}},{}],178:[function(t,e,r){(function(){var t=this,n=t._,i=Array.prototype,o=Object.prototype,a=Function.prototype,s=i.push,u=i.slice,f=o.toString,c=o.hasOwnProperty,h=Array.isArray,d=Object.keys,l=a.bind,p=Object.create,b=function(){},m=function t(e){return e instanceof t?e:this instanceof t?void(this._wrapped=e):new t(e)};void 0!==r?(void 0!==e&&e.exports&&(r=e.exports=m),r._=m):t._=m,m.VERSION="1.8.3";var y=function(t,e,r){if(void 0===e)return t;switch(null==r?3:r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)};case 4:return function(r,n,i,o){return t.call(e,r,n,i,o)}}return function(){return t.apply(e,arguments)}},v=function(t,e,r){return null==t?m.identity:m.isFunction(t)?y(t,e,r):m.isObject(t)?m.matcher(t):m.property(t)};m.iteratee=function(t,e){return v(t,e,1/0)};var g=function(t,e){return function(r){var n=arguments.length;if(n<2||null==r)return r;for(var i=1;i=0&&e<=M};function S(t){return function(e,r,n,i){r=y(r,i,4);var o=!k(e)&&m.keys(e),a=(o||e).length,s=t>0?0:a-1;return arguments.length<3&&(n=e[o?o[s]:s],s+=t),function(e,r,n,i,o,a){for(;o>=0&&o=0},m.invoke=function(t,e){var r=u.call(arguments,2),n=m.isFunction(e);return m.map(t,function(t){var i=n?e:t[e];return null==i?i:i.apply(t,r)})},m.pluck=function(t,e){return m.map(t,m.property(e))},m.where=function(t,e){return m.filter(t,m.matcher(e))},m.findWhere=function(t,e){return m.find(t,m.matcher(e))},m.max=function(t,e,r){var n,i,o=-1/0,a=-1/0;if(null==e&&null!=t)for(var s=0,u=(t=k(t)?t:m.values(t)).length;so&&(o=n);else e=v(e,r),m.each(t,function(t,r,n){((i=e(t,r,n))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)});return o},m.min=function(t,e,r){var n,i,o=1/0,a=1/0;if(null==e&&null!=t)for(var s=0,u=(t=k(t)?t:m.values(t)).length;sn||void 0===r)return 1;if(r0?0:i-1;o>=0&&o0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(r&&o&&s)return n[o=r(n,i)]===i?o:-1;if(i!=i)return(o=e(u.call(n,a,s),m.isNaN))>=0?o+a:-1;for(o=t>0?a:s-1;o>=0&&oe?(a&&(clearTimeout(a),a=null),s=f,o=t.apply(n,i),a||(n=i=null)):a||!1===r.trailing||(a=setTimeout(u,c)),o}},m.debounce=function(t,e,r){var n,i,o,a,s,u=function u(){var f=m.now()-a;f=0?n=setTimeout(u,e-f):(n=null,r||(s=t.apply(o,i),n||(o=i=null)))};return function(){o=this,i=arguments,a=m.now();var f=r&&!n;return n||(n=setTimeout(u,e)),f&&(s=t.apply(o,i),o=i=null),s}},m.wrap=function(t,e){return m.partial(e,t)},m.negate=function(t){return function(){return!t.apply(this,arguments)}},m.compose=function(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}},m.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},m.before=function(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}},m.once=m.partial(m.before,2);var T=!{toString:null}.propertyIsEnumerable("toString"),C=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function P(t,e){var r=C.length,n=t.constructor,i=m.isFunction(n)&&n.prototype||o,a="constructor";for(m.has(t,a)&&!m.contains(e,a)&&e.push(a);r--;)(a=C[r])in t&&t[a]!==i[a]&&!m.contains(e,a)&&e.push(a)}m.keys=function(t){if(!m.isObject(t))return[];if(d)return d(t);var e=[];for(var r in t)m.has(t,r)&&e.push(r);return T&&P(t,e),e},m.allKeys=function(t){if(!m.isObject(t))return[];var e=[];for(var r in t)e.push(r);return T&&P(t,e),e},m.values=function(t){for(var e=m.keys(t),r=e.length,n=Array(r),i=0;i":">",'"':""","'":"'","`":"`"},O=m.invert(R),N=function(t){var e=function(e){return t[e]},r="(?:"+m.keys(t).join("|")+")",n=RegExp(r),i=RegExp(r,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(i,e):t}};m.escape=N(R),m.unescape=N(O),m.result=function(t,e,r){var n=null==t?void 0:t[e];return void 0===n&&(n=r),m.isFunction(n)?n.call(t):n};var L=0;m.uniqueId=function(t){var e=++L+"";return t?t+e:e},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var F=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,U=function(t){return"\\"+q[t]};m.template=function(t,e,r){!e&&r&&(e=r),e=m.defaults({},e,m.templateSettings);var n=RegExp([(e.escape||F).source,(e.interpolate||F).source,(e.evaluate||F).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(n,function(e,r,n,a,s){return o+=t.slice(i,s).replace(D,U),i=s+e.length,r?o+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?o+="'+\n((__t=("+n+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(e.variable||"obj","_",o)}catch(t){throw t.source=o,t}var s=function(t){return a.call(this,t,m)},u=e.variable||"obj";return s.source="function("+u+"){\n"+o+"}",s},m.chain=function(t){var e=m(t);return e._chain=!0,e};var z=function(t,e){return t._chain?m(e).chain():e};m.mixin=function(t){m.each(m.functions(t),function(e){var r=m[e]=t[e];m.prototype[e]=function(){var t=[this._wrapped];return s.apply(t,arguments),z(this,r.apply(m,t))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=i[t];m.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!==t&&"splice"!==t||0!==r.length||delete r[0],z(this,r)}}),m.each(["concat","join","slice"],function(t){var e=i[t];m.prototype[t]=function(){return z(this,e.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}).call(this)},{}],179:[function(t,e,r){e.exports=function(t,e){if(e){e=(e=e.trim().replace(/^(\?|#|&)/,""))?"?"+e:e;var r=t.split(/[\?\#]/),n=r[0];e&&/\:\/\/[^\/]*$/.test(n)&&(n+="/");var i=t.match(/(\#.*)$/);t=n+e,i&&(t+=i[0])}return t}},{}],180:[function(t,e,r){var n=t("xhr-request");e.exports=function(t,e){return new Promise(function(r,i){n(t,e,function(t,e){t?i(t):r(e)})})}},{"xhr-request":181}],181:[function(t,e,r){var n=t("query-string"),i=t("url-set-query"),o=t("object-assign"),a=t("./lib/ensure-header.js"),s=t("./lib/request.js"),u="application/json",f=function(){};e.exports=function(t,e,r){if(!t||"string"!=typeof t)throw new TypeError("must specify a URL");"function"==typeof e&&(r=e,e={});if(r&&"function"!=typeof r)throw new TypeError("expected cb to be undefined or a function");r=r||f;var c=(e=e||{}).json?"json":"text",h=(e=o({responseType:c},e)).headers||{},d=(e.method||"GET").toUpperCase(),l=e.query;l&&("string"!=typeof l&&(l=n.stringify(l)),t=i(t,l));"json"===e.responseType&&a(h,"Accept",u);e.json&&"GET"!==d&&"HEAD"!==d&&(a(h,"Content-Type",u),e.body=JSON.stringify(e.body));return e.method=d,e.url=t,e.headers=h,delete e.query,delete e.json,s(e,r)}},{"./lib/ensure-header.js":182,"./lib/request.js":184,"object-assign":169,"query-string":171,"url-set-query":179}],182:[function(t,e,r){e.exports=function(t,e,r){var n=e.toLowerCase();t[e]||t[n]||(t[e]=r)}},{}],183:[function(t,e,r){e.exports=function(t,e){return e?{statusCode:e.statusCode,headers:e.headers,method:t.method,url:t.url,rawRequest:e.rawRequest?e.rawRequest:e}:null}},{}],184:[function(t,e,r){var n=t("xhr"),i=t("./normalize-response"),o=function(){};e.exports=function(t,e){delete t.uri;var r=!1;"json"===t.responseType&&(t.responseType="text",r=!0);var a=n(t,function(n,a,s){if(r&&!n)try{var u=a.rawRequest.responseText;s=JSON.parse(u)}catch(t){n=t}a=i(t,a),e(n,n?null:s,a),e=o}),s=a.onabort;return a.onabort=function(){var t=s.apply(a,Array.prototype.slice.call(arguments));return e(new Error("XHR Aborted")),e=o,t},a}},{"./normalize-response":183,xhr:185}],185:[function(t,e,r){var n=t("global/window"),i=t("is-function"),o=t("parse-headers"),a=t("xtend");function s(t,e,r){var n=t;return i(e)?(r=e,"string"==typeof t&&(n={uri:t})):n=a(e,{uri:t}),n.callback=r,n}function u(t,e,r){return f(e=s(t,e,r))}function f(t){if(void 0===t.callback)throw new Error("callback argument missing");var e=!1,r=function(r,n,i){e||(e=!0,t.callback(r,n,i))};function n(t){return clearTimeout(c),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,r(t,y)}function i(){if(!s){var e;clearTimeout(c),e=t.useXDR&&void 0===f.status?200:1223===f.status?204:f.status;var n=y,i=null;return 0!==e?(n={body:function(){var t=void 0;if(t=f.response?f.response:f.responseText||function(t){try{if("document"===t.responseType)return t.responseXML;var e=t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;if(""===t.responseType&&!e)return t.responseXML}catch(t){}return null}(f),m)try{t=JSON.parse(t)}catch(t){}return t}(),statusCode:e,method:d,headers:{},url:h,rawRequest:f},f.getAllResponseHeaders&&(n.headers=o(f.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),r(i,n,n.body)}}var a,s,f=t.xhr||null;f||(f=t.cors||t.useXDR?new u.XDomainRequest:new u.XMLHttpRequest);var c,h=f.url=t.uri||t.url,d=f.method=t.method||"GET",l=t.body||t.data,p=f.headers=t.headers||{},b=!!t.sync,m=!1,y={body:void 0,headers:{},statusCode:0,method:d,url:h,rawRequest:f};if("json"in t&&!1!==t.json&&(m=!0,p.accept||p.Accept||(p.Accept="application/json"),"GET"!==d&&"HEAD"!==d&&(p["content-type"]||p["Content-Type"]||(p["Content-Type"]="application/json"),l=JSON.stringify(!0===t.json?l:t.json))),f.onreadystatechange=function(){4===f.readyState&&setTimeout(i,0)},f.onload=i,f.onerror=n,f.onprogress=function(){},f.onabort=function(){s=!0},f.ontimeout=n,f.open(d,h,!b,t.username,t.password),b||(f.withCredentials=!!t.withCredentials),!b&&t.timeout>0&&(c=setTimeout(function(){if(!s){s=!0,f.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",n(t)}},t.timeout)),f.setRequestHeader)for(a in p)p.hasOwnProperty(a)&&f.setRequestHeader(a,p[a]);else if(t.headers&&!function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(f.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(f),f.send(l||null),f}e.exports=u,u.XMLHttpRequest=n.XMLHttpRequest||function(){},u.XDomainRequest="withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:n.XDomainRequest,function(t,e){for(var r=0;r1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},f.prototype.getCall=function(t){return n.isFunction(this.call)?this.call(t):this.call},f.prototype.extractCallback=function(t){if(n.isFunction(t[t.length-1]))return t.pop()},f.prototype.validateArgs=function(t){if(t.length!==this.params)throw i.InvalidNumberOfParams(t.length,this.params,this.name)},f.prototype.formatInput=function(t){var e=this;return this.inputFormatter?this.inputFormatter.map(function(r,n){return r?r.call(e,t[n]):t[n]}):t},f.prototype.formatOutput=function(t){var e=this;return n.isArray(t)?t.map(function(t){return e.outputFormatter&&t?e.outputFormatter(t):t}):this.outputFormatter&&t?this.outputFormatter(t):t},f.prototype.toPayload=function(t){var e=this.getCall(t),r=this.extractCallback(t),n=this.formatInput(t);this.validateArgs(n);var i={method:e,params:n,callback:r};return this.transformPayload&&(i=this.transformPayload(i)),i},f.prototype._confirmTransaction=function(t,e,r){var i=this,c=!1,h=!0,d=0,l=0,p=null,b=n.isObject(r.params[0])&&r.params[0].gas?r.params[0].gas:null,m=n.isObject(r.params[0])&&r.params[0].data&&r.params[0].from&&!r.params[0].to,y=[new f({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:o.outputTransactionReceiptFormatter}),new f({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[o.inputAddressFormatter,o.inputDefaultBlockNumberFormatter]}),new u({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:o.outputBlockFormatter}}})],v={};n.each(y,function(t){t.attachToObject(v),t.requestManager=i.requestManager});var g=function(r,n,o,u,f){if(!o)return f||(f={unsubscribe:function(){clearInterval(p)}}),(r?s.resolve(r):v.getTransactionReceipt(e)).catch(function(e){f.unsubscribe(),c=!0,a._fireError({message:"Failed to check for transaction receipt:",data:e},t.eventEmitter,t.reject)}).then(function(e){if(!e||!e.blockHash)throw new Error("Receipt missing or blockHash null");return i.extraFormatters&&i.extraFormatters.receiptFormatter&&(e=i.extraFormatters.receiptFormatter(e)),t.eventEmitter.listeners("confirmation").length>0&&(void 0!==r&&0===l||t.eventEmitter.emit("confirmation",l,e),h=!1,25===++l&&(f.unsubscribe(),t.eventEmitter.removeAllListeners())),e}).then(function(e){if(m&&!c){if(!e.contractAddress)return h&&(f.unsubscribe(),c=!0),void a._fireError(new Error("The transaction receipt didn't contain a contract address."),t.eventEmitter,t.reject);v.getCode(e.contractAddress,function(r,n){n&&(n.length>2?(t.eventEmitter.emit("receipt",e),i.extraFormatters&&i.extraFormatters.contractDeployFormatter?t.resolve(i.extraFormatters.contractDeployFormatter(e)):t.resolve(e),h&&t.eventEmitter.removeAllListeners()):a._fireError(new Error("The contract code couldn't be stored, please check your gas limit."),t.eventEmitter,t.reject),h&&f.unsubscribe(),c=!0)})}return e}).then(function(e){m||c||(e.outOfGas||b&&b===e.gasUsed||!0!==e.status&&"0x1"!==e.status&&void 0!==e.status?(e&&(e=JSON.stringify(e,null,2)),!1===e.status||"0x0"===e.status?a._fireError(new Error("Transaction has been reverted by the EVM:\n"+e),t.eventEmitter,t.reject):a._fireError(new Error("Transaction ran out of gas. Please provide more gas:\n"+e),t.eventEmitter,t.reject)):(t.eventEmitter.emit("receipt",e),t.resolve(e),h&&t.eventEmitter.removeAllListeners()),h&&f.unsubscribe(),c=!0)}).catch(function(){d++,n?d-1>=750&&(f.unsubscribe(),c=!0,a._fireError(new Error("Transaction was not mined within750 seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),t.eventEmitter,t.reject)):d-1>=50&&(f.unsubscribe(),c=!0,a._fireError(new Error("Transaction was not mined within 50 blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),t.eventEmitter,t.reject))});f.unsubscribe(),c=!0,a._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:o},t.eventEmitter,t.reject)},w=function(t){n.isFunction(this.requestManager.provider.on)?v.subscribe("newBlockHeaders",g.bind(null,t,!1)):p=setInterval(g.bind(null,t,!0),1e3)}.bind(this);v.getTransactionReceipt(e).then(function(e){e&&e.blockHash?(t.eventEmitter.listeners("confirmation").length>0&&w(e),g(e,!1)):c||w()}).catch(function(){c||w()})};var c=function(t,e){return n.isNumber(t)?e.wallet[t]:n.isObject(t)&&t.address&&t.privateKey?t:e.wallet[t.toLowerCase()]};f.prototype.buildCall=function(){var t=this,e="eth_sendTransaction"===t.call||"eth_sendRawTransaction"===t.call,r=function(){var r=s(!e),i=t.toPayload(Array.prototype.slice.call(arguments)),o=function(n,o){try{o=t.formatOutput(o)}catch(t){n=t}if(o instanceof Error&&(n=o),n)return n.error&&(n=n.error),a._fireError(n,r.eventEmitter,r.reject,i.callback);i.callback&&i.callback(null,o),e?(r.eventEmitter.emit("transactionHash",o),t._confirmTransaction(r,o,i)):n||r.resolve(o)},u=function(e){var r=n.extend({},i,{method:"eth_sendRawTransaction",params:[e.rawTransaction]});t.requestManager.send(r,o)},h=function(t,e){var i;if(e&&e.accounts&&e.accounts.wallet&&e.accounts.wallet.length)if("eth_sendTransaction"===t.method){var a=t.params[0];if((i=c(n.isObject(a)?a.from:null,e.accounts))&&i.privateKey)return e.accounts.signTransaction(n.omit(a,"from"),i.privateKey).then(u)}else if("eth_sign"===t.method){var s=t.params[1];if((i=c(t.params[0],e.accounts))&&i.privateKey){var f=e.accounts.sign(s,i.privateKey);return t.callback&&t.callback(null,f.signature),void r.resolve(f.signature)}}return e.requestManager.send(t,o)};e&&n.isObject(i.params[0])&&!i.params[0].gasPrice?new f({name:"getGasPrice",call:"eth_gasPrice",params:0}).createFunction(t.requestManager)(function(e,r){r&&(i.params[0].gasPrice=r),h(i,t)}):h(i,t);return r.eventEmitter};return r.method=t,r.request=this.request.bind(this),r},f.prototype.request=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));return t.format=this.formatOutput.bind(this),t},e.exports=f},{underscore:192,"web3-core-helpers":191,"web3-core-promievent":198,"web3-core-subscriptions":206,"web3-utils":393}],194:[function(t,e,r){e.exports=t("./register")().Promise},{"./register":196}],195:[function(t,e,r){var n="@@any-promise/REGISTRATION",i=null;e.exports=function(t,e){return function(r,o){r=r||null;var a=!1!==(o=o||{}).global;if(null===i&&a&&(i=t[n]||null),null!==i&&null!==r&&i.implementation!==r)throw new Error('any-promise already defined as "'+i.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return null===i&&(i=null!==r&&void 0!==o.Promise?{Promise:o.Promise,implementation:r}:e(r),a&&(t[n]=i)),i}}},{}],196:[function(t,e,r){e.exports=t("./loader")(window,function(){if(void 0===window.Promise)throw new Error("any-promise browser requires a polyfill or explicit registration e.g: require('any-promise/register/bluebird')");return{Promise:window.Promise,implementation:"window.Promise"}})},{"./loader":195}],197:[function(t,e,r){var n="function"!=typeof Object.create&&"~";function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(){}o.prototype._events=void 0,o.prototype.listeners=function(t,e){var r=n?n+t:t,i=this._events&&this._events[r];if(e)return!!i;if(!i)return[];if(i.fn)return[i.fn];for(var o=0,a=i.length,s=new Array(a);o1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},i.prototype.buildCall=function(){var t=this;return function(){t.subscriptions[arguments[0]]||console.warn("Subscription "+JSON.stringify(arguments[0])+" doesn't exist. Subscribing anyway.");var e=new n({subscription:t.subscriptions[arguments[0]],requestManager:t.requestManager,type:t.type});return e.subscribe.apply(e,arguments)}},e.exports={subscriptions:i,subscription:n}},{"./subscription.js":207}],207:[function(t,e,r){var n=t("underscore"),i=t("web3-core-helpers").errors,o=t("eventemitter3");function a(t){o.call(this),this.id=null,this.callback=null,this.arguments=null,this._reconnectIntervalId=null,this.options={subscription:t.subscription,type:t.type,requestManager:t.requestManager}}a.prototype=Object.create(o.prototype),a.prototype.constructor=a,a.prototype._extractCallback=function(t){if(n.isFunction(t[t.length-1]))return t.pop()},a.prototype._validateArgs=function(t){var e=this.options.subscription;if(e||(e={}),e.params||(e.params=0),t.length!==e.params)throw i.InvalidNumberOfParams(t.length,e.params+1,t[0])},a.prototype._formatInput=function(t){var e=this.options.subscription;return e&&e.inputFormatter?e.inputFormatter.map(function(e,r){return e?e(t[r]):t[r]}):t},a.prototype._formatOutput=function(t){var e=this.options.subscription;return e&&e.outputFormatter&&t?e.outputFormatter(t):t},a.prototype._toPayload=function(t){var e=[];if(this.callback=this._extractCallback(t),this.subscriptionMethod||(this.subscriptionMethod=t.shift(),this.options.subscription.subscriptionName&&(this.subscriptionMethod=this.options.subscription.subscriptionName)),this.arguments||(this.arguments=this._formatInput(t),this._validateArgs(this.arguments),t=[]),e.push(this.subscriptionMethod),e=e.concat(this.arguments),t.length)throw new Error("Only a callback is allowed as parameter on an already instantiated subscription.");return{method:this.options.type+"_subscribe",params:e}},a.prototype.unsubscribe=function(t){this.options.requestManager.removeSubscription(this.id,t),this.id=null,this.removeAllListeners(),clearInterval(this._reconnectIntervalId)},a.prototype.subscribe=function(){var t=this,e=Array.prototype.slice.call(arguments),r=this._toPayload(e);if(!r)return this;if(!this.options.requestManager.provider){var i=new Error("No provider set.");return this.callback(i,null,this),this.emit("error",i),this}if(!this.options.requestManager.provider.on){var o=new Error("The current provider doesn't support subscriptions: "+this.options.requestManager.provider.constructor.name);return this.callback(o,null,this),this.emit("error",o),this}return this.id&&this.unsubscribe(),this.options.params=r.params[1],"logs"===r.params[0]&&n.isObject(r.params[1])&&r.params[1].hasOwnProperty("fromBlock")&&isFinite(r.params[1].fromBlock)&&this.options.requestManager.send({method:"eth_getLogs",params:[r.params[1]]},function(e,r){e?(t.callback(e,null,t),t.emit("error",e)):r.forEach(function(e){var r=t._formatOutput(e);t.callback(null,r,t),t.emit("data",r)})}),"object"===_typeof(r.params[1])&&delete r.params[1].fromBlock,this.options.requestManager.send(r,function(e,i){!e&&i?(t.id=i,t.options.requestManager.addSubscription(t.id,r.params[0],t.options.type,function(e,r){e?(t.options.requestManager.removeSubscription(t.id),t.options.requestManager.provider.once&&(t._reconnectIntervalId=setInterval(function(){t.options.requestManager.provider.reconnect&&t.options.requestManager.provider.reconnect()},500),t.options.requestManager.provider.once("connect",function(){clearInterval(t._reconnectIntervalId),t.subscribe(t.callback)})),t.emit("error",e),n.isFunction(t.callback)&&t.callback(e,null,t)):(n.isArray(r)||(r=[r]),r.forEach(function(e){var r=t._formatOutput(e);if(n.isFunction(t.options.subscription.subscriptionHandler))return t.options.subscription.subscriptionHandler.call(t,r);t.emit("data",r),n.isFunction(t.callback)&&t.callback(null,r,t)}))})):n.isFunction(t.callback)?(t.callback(e,null,t),t.emit("error",e)):t.emit("error",e)}),this},e.exports=a},{eventemitter3:204,underscore:205,"web3-core-helpers":191}],208:[function(t,e,r){var n=t("web3-core-helpers").formatters,i=t("web3-core-method"),o=t("web3-utils");e.exports=function(t){var e=function(e){var r;return e.property?(t[e.property]||(t[e.property]={}),r=t[e.property]):r=t,e.methods&&e.methods.forEach(function(e){e instanceof i||(e=new i(e)),e.attachToObject(r),e.setRequestManager(t._requestManager)}),t};return e.formatters=n,e.utils=o,e.Method=i,e}},{"web3-core-helpers":191,"web3-core-method":193,"web3-utils":393}],209:[function(t,e,r){var n=t("web3-core-requestmanager"),i=t("./extend.js");e.exports={packageInit:function(t,e){if(e=Array.prototype.slice.call(e),!t)throw new Error('You need to instantiate using the "new" keyword.');Object.defineProperty(t,"currentProvider",{get:function(){return t._provider},set:function(e){return t.setProvider(e)},enumerable:!0,configurable:!0}),e[0]&&e[0]._requestManager?t._requestManager=new n.Manager(e[0].currentProvider):(t._requestManager=new n.Manager,t._requestManager.setProvider(e[0],e[1])),t.givenProvider=n.Manager.givenProvider,t.providers=n.Manager.providers,t._provider=t._requestManager.provider,t.setProvider||(t.setProvider=function(e,r){return t._requestManager.setProvider(e,r),t._provider=t._requestManager.provider,!0}),t.BatchRequest=n.BatchManager.bind(null,t._requestManager),t.extend=i(t)},addProviders:function(t){t.givenProvider=n.Manager.givenProvider,t.providers=n.Manager.providers}}},{"./extend.js":208,"web3-core-requestmanager":202}],210:[function(t,e,r){!function(e,r){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===(void 0===e?"undefined":_typeof(e))?e.exports=o:r.BN=o,o.BN=o,o.wordSize=26;try{a=t("buffer").Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===(void 0===t?"undefined":_typeof(t))&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"===(void 0===t?"undefined":_typeof(t)))return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,f=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var f=1;f>>26,h=67108863&u,d=Math.min(f,e.length-1),l=Math.max(0,f-t.length+1);l<=d;l++){var p=f-l|0;c+=(a=(i=0|t.words[p])*(o=0|e.words[l])+h)/67108864|0,h=67108863&a}r.words[f]=0|h,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=c[t],l=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?b+r:f[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,f=new t(o),c=this.clone();if(u){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),f[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,l=0|a[1],p=8191&l,b=l>>>13,m=0|a[2],y=8191&m,v=m>>>13,g=0|a[3],w=8191&g,_=g>>>13,M=0|a[4],x=8191&M,k=M>>>13,S=0|a[5],E=8191&S,A=S>>>13,j=0|a[6],I=8191&j,B=j>>>13,T=0|a[7],C=8191&T,P=T>>>13,R=0|a[8],O=8191&R,N=R>>>13,L=0|a[9],F=8191&L,q=L>>>13,D=0|s[0],U=8191&D,z=D>>>13,K=0|s[1],H=8191&K,V=K>>>13,W=0|s[2],X=8191&W,G=W>>>13,J=0|s[3],Z=8191&J,$=J>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ft=st>>>13,ct=0|s[8],ht=8191&ct,dt=ct>>>13,lt=0|s[9],pt=8191<,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(f+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,z))+Math.imul(d,U)|0))<<13)|0;f=((o=Math.imul(d,z))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,z))+Math.imul(b,U)|0,o=Math.imul(b,z);var yt=(f+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,V)|0)+Math.imul(d,H)|0))<<13)|0;f=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,z))+Math.imul(v,U)|0,o=Math.imul(v,z),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,V)|0;var vt=(f+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(d,X)|0))<<13)|0;f=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,z))+Math.imul(_,U)|0,o=Math.imul(_,z),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,G)|0;var gt=(f+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,$)|0)+Math.imul(d,Z)|0))<<13)|0;f=((o=o+Math.imul(d,$)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,z))+Math.imul(k,U)|0,o=Math.imul(k,z),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,$)|0;var wt=(f+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,Q)|0))<<13)|0;f=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,z))+Math.imul(A,U)|0,o=Math.imul(A,z),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var _t=(f+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;f=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,z))+Math.imul(B,U)|0,o=Math.imul(B,z),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var Mt=(f+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(d,ot)|0))<<13)|0;f=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,z))+Math.imul(P,U)|0,o=Math.imul(P,z),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0;var xt=(f+(n=n+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(d,ut)|0))<<13)|0;f=((o=o+Math.imul(d,ft)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,z))+Math.imul(N,U)|0,o=Math.imul(N,z),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,$)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0;var kt=(f+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;f=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,z))+Math.imul(q,U)|0,o=Math.imul(q,z),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,G)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ft)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,dt)|0;var St=(f+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(d,pt)|0))<<13)|0;f=((o=o+Math.imul(d,bt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(F,H),i=(i=Math.imul(F,V))+Math.imul(q,H)|0,o=Math.imul(q,V),n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,$)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ft)|0,n=n+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,dt)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,dt)|0;var Et=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(F,X),i=(i=Math.imul(F,G))+Math.imul(q,X)|0,o=Math.imul(q,G),n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ft)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,dt)|0;var At=(f+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,bt)|0)+Math.imul(v,pt)|0))<<13)|0;f=((o=o+Math.imul(v,bt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(F,Z),i=(i=Math.imul(F,$))+Math.imul(q,Z)|0,o=Math.imul(q,$),n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ft)|0,n=n+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,dt)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,dt)|0;var jt=(f+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;f=((o=o+Math.imul(_,bt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,tt))+Math.imul(q,Q)|0,o=Math.imul(q,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ft)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ft)|0,n=n+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,dt)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,dt)|0;var It=(f+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(k,pt)|0))<<13)|0;f=((o=o+Math.imul(k,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(F,rt),i=(i=Math.imul(F,nt))+Math.imul(q,rt)|0,o=Math.imul(q,nt),n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ft)|0,n=n+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(B,ht)|0,o=o+Math.imul(B,dt)|0;var Bt=(f+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,bt)|0)+Math.imul(A,pt)|0))<<13)|0;f=((o=o+Math.imul(A,bt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(F,ot),i=(i=Math.imul(F,at))+Math.imul(q,ot)|0,o=Math.imul(q,at),n=n+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ft)|0,n=n+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,dt)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,dt)|0;var Tt=(f+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,bt)|0)+Math.imul(B,pt)|0))<<13)|0;f=((o=o+Math.imul(B,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(F,ut),i=(i=Math.imul(F,ft))+Math.imul(q,ut)|0,o=Math.imul(q,ft),n=n+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,dt)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,dt)|0;var Ct=(f+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,bt)|0)+Math.imul(P,pt)|0))<<13)|0;f=((o=o+Math.imul(P,bt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(F,ht),i=(i=Math.imul(F,dt))+Math.imul(q,ht)|0,o=Math.imul(q,dt);var Pt=(f+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,bt)|0)+Math.imul(N,pt)|0))<<13)|0;f=((o=o+Math.imul(N,bt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Rt=(f+(n=Math.imul(F,pt))|0)+((8191&(i=(i=Math.imul(F,bt))+Math.imul(q,pt)|0))<<13)|0;return f=((o=Math.imul(q,bt))+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,u[0]=mt,u[1]=yt,u[2]=vt,u[3]=gt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=xt,u[8]=kt,u[9]=St,u[10]=Et,u[11]=At,u[12]=jt,u[13]=It,u[14]=Bt,u[15]=Tt,u[16]=Ct,u[17]=Pt,u[18]=Rt,0!==f&&(u[19]=f,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(l=d),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?l(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,f=0;f=0&&(0!==c||f>=i);f--){var h=0|this.words[f];this.words[f]=c<<26-o|h>>>o,c=h&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var f=0;f=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),f=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++f;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(h)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0==(e.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(e.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(v,y),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new g;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=a;0!==l.cmp(s);){for(var b=l,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m=0;n--){for(var f=e.words[n],c=u-1;c>=0;c--){var h=f>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new x(t)},i(x,M),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{}],211:[function(t,e,r){arguments[4][178][0].apply(r,arguments)},{dup:178}],212:[function(t,e,r){var n=t("underscore"),i=t("web3-utils"),o=t("bn.js"),a=t("./param"),s=function(t){return n.isNumber(t)&&(t=Math.trunc(t)),new a(i.toTwosComplement(t).replace("0x",""))};e.exports={formatInputInt:s,formatInputBytes:function(t){if(!i.isHexStrict(t))throw new Error('Given parameter is not bytes: "'+t+'"');var e=t.replace(/^0x/i,"");if(e.length%2!=0)throw new Error('Given parameter bytes has an invalid length: "'+t+'"');if(e.length>64)throw new Error('Given parameter bytes is too long: "'+t+'"');var r=Math.floor((e.length+63)/64);return e=i.padRight(e,64*r),new a(e)},formatInputDynamicBytes:function(t){if(!i.isHexStrict(t))throw new Error('Given parameter is not bytes: "'+t+'"');var e=t.replace(/^0x/i,"");if(e.length%2!=0)throw new Error('Given parameter bytes has an invalid length: "'+t+'"');var r=e.length/2,n=Math.floor((e.length+63)/64);return e=i.padRight(e,64*n),new a(s(r).value+e)},formatInputString:function(t){if(!n.isString(t))throw new Error("Given parameter is not a valid string: "+t);var e=i.utf8ToHex(t).replace(/^0x/i,""),r=e.length/2,o=Math.floor((e.length+63)/64);return e=i.padRight(e,64*o),new a(s(r).value+e)},formatInputBool:function(t){return new a("000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0"))},formatOutputInt:function(t){var e=t.staticPart();if(!e&&!t.rawValue)throw new Error("Couldn't decode "+name+" from ABI: 0x"+t.rawValue);return"1"===new o(e.substr(0,1),16).toString(2).substr(0,1)?new o(e,16).fromTwos(256).toString(10):new o(e,16).toString(10)},formatOutputUInt:function(t,e){var r=t.staticPart();if(!r&&!t.rawValue)throw new Error("Couldn't decode "+e+" from ABI: 0x"+t.rawValue);return new o(r,16).toString(10)},formatOutputBool:function(t,e){var r=t.staticPart();if(!r&&!t.rawValue)throw new Error("Couldn't decode "+e+" from ABI: 0x"+t.rawValue);return"0000000000000000000000000000000000000000000000000000000000000001"===r},formatOutputBytes:function(t,e){var r=e.match(/^bytes([0-9]*)/),n=parseInt(r[1]);if(t.staticPart().slice(0,2*n).length!==2*n)throw new Error("Couldn't decode "+e+" from ABI: 0x"+t.rawValue+" The size doesn't match.");return"0x"+t.staticPart().slice(0,2*n)},formatOutputDynamicBytes:function(t,e){var r=t.dynamicPart().slice(0,64);if(!r)throw new Error("Couldn't decode "+e+" from ABI: 0x"+t.rawValue);var n=2*new o(r,16).toNumber();return"0x"+t.dynamicPart().substr(64,n)},formatOutputString:function(t){var e=t.dynamicPart().slice(0,64);if(!e)throw new Error("ERROR: The returned value is not a convertible string:"+e);var r=2*new o(e,16).toNumber();return r?i.hexToUtf8("0x"+t.dynamicPart().substr(64,r).replace(/^0x/i,"")):""},formatOutputAddress:function(t,e){var r=t.staticPart();if(!r)throw new Error("Couldn't decode "+e+" from ABI: 0x"+t.rawValue);return i.toChecksumAddress("0x"+r.slice(r.length-40,r.length))},toTwosComplement:i.toTwosComplement}},{"./param":214,"bn.js":210,underscore:211,"web3-utils":393}],213:[function(t,e,r){var n=t("underscore"),i=t("web3-utils"),o=t("./formatters"),a=t("./types/address"),s=t("./types/bool"),u=t("./types/int"),f=t("./types/uint"),c=t("./types/dynamicbytes"),h=t("./types/string"),d=t("./types/bytes"),l=function(t,e){return t.isDynamicType(e)||t.isDynamicArray(e)};function p(){}var b=function(t){this._types=t};b.prototype._requireType=function(t){var e=this._types.filter(function(e){return e.isType(t)})[0];if(!e)throw Error("Invalid solidity type: "+t);return e},b.prototype._getOffsets=function(t,e){for(var r=e.map(function(e,r){return e.staticPartLength(t[r])}),n=1;n=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===(void 0===t?"undefined":_typeof(t))&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"===(void 0===t?"undefined":_typeof(t)))return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,f=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var f=1;f>>26,h=67108863&u,d=Math.min(f,e.length-1),l=Math.max(0,f-t.length+1);l<=d;l++){var p=f-l|0;c+=(a=(i=0|t.words[p])*(o=0|e.words[l])+h)/67108864|0,h=67108863&a}r.words[f]=0|h,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=c[t],l=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?b+r:f[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,f=new t(o),c=this.clone();if(u){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),f[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,l=0|a[1],p=8191&l,b=l>>>13,m=0|a[2],y=8191&m,v=m>>>13,g=0|a[3],w=8191&g,_=g>>>13,M=0|a[4],x=8191&M,k=M>>>13,S=0|a[5],E=8191&S,A=S>>>13,j=0|a[6],I=8191&j,B=j>>>13,T=0|a[7],C=8191&T,P=T>>>13,R=0|a[8],O=8191&R,N=R>>>13,L=0|a[9],F=8191&L,q=L>>>13,D=0|s[0],U=8191&D,z=D>>>13,K=0|s[1],H=8191&K,V=K>>>13,W=0|s[2],X=8191&W,G=W>>>13,J=0|s[3],Z=8191&J,$=J>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ft=st>>>13,ct=0|s[8],ht=8191&ct,dt=ct>>>13,lt=0|s[9],pt=8191<,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(f+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,z))+Math.imul(d,U)|0))<<13)|0;f=((o=Math.imul(d,z))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,z))+Math.imul(b,U)|0,o=Math.imul(b,z);var yt=(f+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,V)|0)+Math.imul(d,H)|0))<<13)|0;f=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,z))+Math.imul(v,U)|0,o=Math.imul(v,z),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,V)|0;var vt=(f+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(d,X)|0))<<13)|0;f=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,z))+Math.imul(_,U)|0,o=Math.imul(_,z),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,G)|0;var gt=(f+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,$)|0)+Math.imul(d,Z)|0))<<13)|0;f=((o=o+Math.imul(d,$)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,z))+Math.imul(k,U)|0,o=Math.imul(k,z),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,$)|0;var wt=(f+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,Q)|0))<<13)|0;f=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,z))+Math.imul(A,U)|0,o=Math.imul(A,z),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var _t=(f+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;f=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,z))+Math.imul(B,U)|0,o=Math.imul(B,z),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var Mt=(f+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(d,ot)|0))<<13)|0;f=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,z))+Math.imul(P,U)|0,o=Math.imul(P,z),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0;var xt=(f+(n=n+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(d,ut)|0))<<13)|0;f=((o=o+Math.imul(d,ft)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,z))+Math.imul(N,U)|0,o=Math.imul(N,z),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,$)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0;var kt=(f+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;f=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,z))+Math.imul(q,U)|0,o=Math.imul(q,z),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,G)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ft)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,dt)|0;var St=(f+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(d,pt)|0))<<13)|0;f=((o=o+Math.imul(d,bt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(F,H),i=(i=Math.imul(F,V))+Math.imul(q,H)|0,o=Math.imul(q,V),n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,$)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ft)|0,n=n+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,dt)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,dt)|0;var Et=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(F,X),i=(i=Math.imul(F,G))+Math.imul(q,X)|0,o=Math.imul(q,G),n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ft)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,dt)|0;var At=(f+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,bt)|0)+Math.imul(v,pt)|0))<<13)|0;f=((o=o+Math.imul(v,bt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(F,Z),i=(i=Math.imul(F,$))+Math.imul(q,Z)|0,o=Math.imul(q,$),n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ft)|0,n=n+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,dt)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,dt)|0;var jt=(f+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;f=((o=o+Math.imul(_,bt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,tt))+Math.imul(q,Q)|0,o=Math.imul(q,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ft)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ft)|0,n=n+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,dt)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,dt)|0;var It=(f+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(k,pt)|0))<<13)|0;f=((o=o+Math.imul(k,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(F,rt),i=(i=Math.imul(F,nt))+Math.imul(q,rt)|0,o=Math.imul(q,nt),n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ft)|0,n=n+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(B,ht)|0,o=o+Math.imul(B,dt)|0;var Bt=(f+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,bt)|0)+Math.imul(A,pt)|0))<<13)|0;f=((o=o+Math.imul(A,bt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(F,ot),i=(i=Math.imul(F,at))+Math.imul(q,ot)|0,o=Math.imul(q,at),n=n+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ft)|0,n=n+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,dt)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,dt)|0;var Tt=(f+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,bt)|0)+Math.imul(B,pt)|0))<<13)|0;f=((o=o+Math.imul(B,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(F,ut),i=(i=Math.imul(F,ft))+Math.imul(q,ut)|0,o=Math.imul(q,ft),n=n+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,dt)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,dt)|0;var Ct=(f+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,bt)|0)+Math.imul(P,pt)|0))<<13)|0;f=((o=o+Math.imul(P,bt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(F,ht),i=(i=Math.imul(F,dt))+Math.imul(q,ht)|0,o=Math.imul(q,dt);var Pt=(f+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,bt)|0)+Math.imul(N,pt)|0))<<13)|0;f=((o=o+Math.imul(N,bt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Rt=(f+(n=Math.imul(F,pt))|0)+((8191&(i=(i=Math.imul(F,bt))+Math.imul(q,pt)|0))<<13)|0;return f=((o=Math.imul(q,bt))+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,u[0]=mt,u[1]=yt,u[2]=vt,u[3]=gt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=xt,u[8]=kt,u[9]=St,u[10]=Et,u[11]=At,u[12]=jt,u[13]=It,u[14]=Bt,u[15]=Tt,u[16]=Ct,u[17]=Pt,u[18]=Rt,0!==f&&(u[19]=f,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(l=d),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?l(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,f=0;f=0&&(0!==c||f>=i);f--){var h=0|this.words[f];this.words[f]=c<<26-o|h>>>o,c=h&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var f=0;f=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),f=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++f;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(h)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0==(e.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(e.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(v,y),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new g;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=a;0!==l.cmp(s);){for(var b=l,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m=0;n--){for(var f=e.words[n],c=u-1;c>=0;c--){var h=f>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new x(t)},i(x,M),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:17}],241:[function(t,e,r){arguments[4][16][0].apply(r,arguments)},{crypto:17,dup:16}],242:[function(t,e,r){arguments[4][18][0].apply(r,arguments)},{dup:18,"safe-buffer":350}],243:[function(t,e,r){arguments[4][19][0].apply(r,arguments)},{"./aes":242,"./ghash":247,"./incr32":248,"buffer-xor":269,"cipher-base":270,dup:19,inherits:325,"safe-buffer":350}],244:[function(t,e,r){arguments[4][20][0].apply(r,arguments)},{"./decrypter":245,"./encrypter":246,"./modes/list.json":256,dup:20}],245:[function(t,e,r){arguments[4][21][0].apply(r,arguments)},{"./aes":242,"./authCipher":243,"./modes":255,"./streamCipher":258,"cipher-base":270,dup:21,evp_bytestokey:310,inherits:325,"safe-buffer":350}],246:[function(t,e,r){arguments[4][22][0].apply(r,arguments)},{"./aes":242,"./authCipher":243,"./modes":255,"./streamCipher":258,"cipher-base":270,dup:22,evp_bytestokey:310,inherits:325,"safe-buffer":350}],247:[function(t,e,r){arguments[4][23][0].apply(r,arguments)},{dup:23,"safe-buffer":350}],248:[function(t,e,r){arguments[4][24][0].apply(r,arguments)},{dup:24}],249:[function(t,e,r){arguments[4][25][0].apply(r,arguments)},{"buffer-xor":269,dup:25}],250:[function(t,e,r){arguments[4][26][0].apply(r,arguments)},{"buffer-xor":269,dup:26,"safe-buffer":350}],251:[function(t,e,r){arguments[4][27][0].apply(r,arguments)},{dup:27,"safe-buffer":350}],252:[function(t,e,r){arguments[4][28][0].apply(r,arguments)},{dup:28,"safe-buffer":350}],253:[function(t,e,r){arguments[4][29][0].apply(r,arguments)},{"../incr32":248,"buffer-xor":269,dup:29,"safe-buffer":350}],254:[function(t,e,r){arguments[4][30][0].apply(r,arguments)},{dup:30}],255:[function(t,e,r){arguments[4][31][0].apply(r,arguments)},{"./cbc":249,"./cfb":250,"./cfb1":251,"./cfb8":252,"./ctr":253,"./ecb":254,"./list.json":256,"./ofb":257,dup:31}],256:[function(t,e,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],257:[function(t,e,r){(function(e){var n=t("buffer-xor");r.encrypt=function(t,r){for(;t._cache.length=0||!r.umod(t.prime1)||!r.umod(t.prime2);)r=new n(i(e));return r}e.exports=o,o.getr=a}).call(this,t("buffer").Buffer)},{"bn.js":240,buffer:47,randombytes:347}],263:[function(t,e,r){arguments[4][39][0].apply(r,arguments)},{"./browser/algorithms.json":264,dup:39}],264:[function(t,e,r){arguments[4][40][0].apply(r,arguments)},{dup:40}],265:[function(t,e,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],266:[function(t,e,r){(function(r){var n=t("create-hash"),i=t("stream"),o=t("inherits"),a=t("./sign"),s=t("./verify"),u=t("./algorithms.json");function f(t){i.Writable.call(this);var e=u[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function c(t){i.Writable.call(this);var e=u[t];if(!e)throw new Error("Unknown message digest");this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function h(t){return new f(t)}function d(t){return new c(t)}Object.keys(u).forEach(function(t){u[t].id=new r(u[t].id,"hex"),u[t.toLowerCase()]=u[t]}),o(f,i.Writable),f.prototype._write=function(t,e,r){this._hash.update(t),r()},f.prototype.update=function(t,e){return"string"==typeof t&&(t=new r(t,e)),this._hash.update(t),this},f.prototype.sign=function(t,e){this.end();var r=this._hash.digest(),n=a(r,t,this._hashType,this._signType,this._tag);return e?n.toString(e):n},o(c,i.Writable),c.prototype._write=function(t,e,r){this._hash.update(t),r()},c.prototype.update=function(t,e){return"string"==typeof t&&(t=new r(t,e)),this._hash.update(t),this},c.prototype.verify=function(t,e,n){"string"==typeof e&&(e=new r(e,n)),this.end();var i=this._hash.digest();return s(e,i,t,this._signType,this._tag)},e.exports={Sign:h,Verify:d,createSign:h,createVerify:d}}).call(this,t("buffer").Buffer)},{"./algorithms.json":264,"./sign":267,"./verify":268,buffer:47,"create-hash":272,inherits:325,stream:156}],267:[function(t,e,r){(function(r){var n=t("create-hmac"),i=t("browserify-rsa"),o=t("elliptic").ec,a=t("bn.js"),s=t("parse-asn1"),u=t("./curves.json");function f(t,e,i,o){if((t=new r(t.toArray())).length0&&r.ishrn(n),r}function h(t,e,i){var o,a;do{for(o=new r(0);8*o.length=e)throw new Error("invalid sig")}e.exports=function(t,e,u,f,c){var h=o(u);if("ec"===h.type){if("ecdsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");return function(t,e,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var o=new i(n),s=r.data.subjectPrivateKey.data;return o.verify(e,t,s)}(t,e,h)}if("dsa"===h.type){if("dsa"!==f)throw new Error("wrong public key type");return function(t,e,r){var i=r.data.p,a=r.data.q,u=r.data.g,f=r.data.pub_key,c=o.signature.decode(t,"der"),h=c.s,d=c.r;s(h,a),s(d,a);var l=n.mont(i),p=h.invm(a);return 0===u.toRed(l).redPow(new n(e).mul(p).mod(a)).fromRed().mul(f.toRed(l).redPow(d.mul(p).mod(a)).fromRed()).mod(i).mod(a).cmp(d)}(t,e,h)}if("rsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");e=r.concat([c,e]);for(var d=h.modulus.byteLength(),l=[1],p=0;e.length+l.length+2>>2),a=0,s=0;a=6.0.0 <7.0.0",type:"range"},"/Users/frozeman/Sites/_ethereum/web3/packages/web3-eth-accounts/node_modules/browserify-sign"]],_from:"elliptic@>=6.0.0 <7.0.0",_id:"elliptic@6.4.0",_inCache:!0,_location:"/elliptic",_nodeVersion:"7.0.0",_npmOperationalInternal:{host:"packages-18-east.internal.npmjs.com",tmp:"tmp/elliptic-6.4.0.tgz_1487798866428_0.30510620190761983"},_npmUser:{name:"indutny",email:"fedor@indutny.com"},_npmVersion:"3.10.8",_phantomChildren:{},_requested:{raw:"elliptic@^6.0.0",scope:null,escapedName:"elliptic",name:"elliptic",rawSpec:"^6.0.0",spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh","/eth-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",_shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/Users/frozeman/Sites/_ethereum/web3/packages/web3-eth-accounts/node_modules/browserify-sign",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz"},files:["lib"],gitHead:"6b0d2b76caae91471649c8e21f0b1d3ba0f96090",homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.0"}},{}],304:[function(t,e,r){(function(r){var n=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=t("./bytes"),o=t("./nat"),a=t("elliptic"),s=(t("./rlp"),new a.ec("secp256k1")),u=t("./hash"),f=u.keccak256,c=u.keccak256s,h=function(t){for(var e=c(t.slice(2)),r="0x",n=0;n<40;n++)r+=parseInt(e[n+2],16)>7?t[n+2].toUpperCase():t[n+2];return r},d=function(t){var e=new r(t.slice(2),"hex"),n="0x"+s.keyFromPrivate(e).getPublic(!1,"hex").slice(2),i=f(n);return{address:h("0x"+i.slice(-40)),privateKey:t}},l=function(t){var e=n(t,3),r=e[0],o=i.pad(32,e[1]),a=i.pad(32,e[2]);return i.flatten([o,a,r])},p=function(t){return[i.slice(64,i.length(t),t),i.slice(0,32,t),i.slice(32,64,t)]},b=function(t){return function(e,n){var a=s.keyFromPrivate(new r(n.slice(2),"hex")).sign(new r(e.slice(2),"hex"),{canonical:!0});return l([o.fromString(i.fromNumber(t+a.recoveryParam)),i.pad(32,i.fromNat("0x"+a.r.toString(16))),i.pad(32,i.fromNat("0x"+a.s.toString(16)))])}},m=b(27);e.exports={create:function(t){var e=f(i.concat(i.random(32),t||i.random(32))),r=i.concat(i.concat(i.random(32),e),i.random(32)),n=f(r);return d(n)},toChecksum:h,fromPrivate:d,sign:m,makeSigner:b,recover:function(t,e){var n=p(e),o={v:i.toNumber(n[0]),r:n[1].slice(2),s:n[2].slice(2)},a="0x"+s.recoverPubKey(new r(t.slice(2),"hex"),o,o.v<2?o.v:1-o.v%2).encode("hex",!1).slice(2),u=f(a);return h("0x"+u.slice(-40))},encodeSignature:l,decodeSignature:p}}).call(this,t("buffer").Buffer)},{"./bytes":306,"./hash":307,"./nat":308,"./rlp":309,buffer:47,elliptic:288}],305:[function(t,e,r){arguments[4][163][0].apply(r,arguments)},{dup:163}],306:[function(t,e,r){arguments[4][164][0].apply(r,arguments)},{"./array.js":305,dup:164}],307:[function(t,e,r){arguments[4][165][0].apply(r,arguments)},{dup:165}],308:[function(t,e,r){var n=t("bn.js"),i=t("./bytes"),o=function(t){return new n(t.slice(2),16)},a=function(t){var e="0x"+("0x"===t.slice(0,2)?new n(t.slice(2),16):new n(t,10)).toString("hex");return"0x0"===e?"0x":e},s=function(t){return"string"==typeof t?/^0x/.test(t)?t:"0x"+t:"0x"+new n(t).toString("hex")},u=function(t){return o(t).toNumber()},f=function(t){return function(e,r){return"0x"+o(e)[t](o(r)).toString("hex")}},c=f("add"),h=f("mul"),d=f("div"),l=f("sub");e.exports={toString:function(t){return o(t).toString(10)},fromString:a,toNumber:u,fromNumber:s,toEther:function(t){return u(d(t,a("10000000000")))/1e8},fromEther:function(t){return h(s(Math.floor(1e8*t)),a("10000000000"))},toUint256:function(t){return i.pad(32,t)},add:c,mul:h,div:d,sub:l}},{"./bytes":306,"bn.js":240}],309:[function(t,e,r){e.exports={encode:function(t){var e=function(t){return(e=t.toString(16)).length%2==0?e:"0"+e;var e},r=function(t,r){return t<56?e(r+t):e(r+e(t).length/2+55)+e(t)};return"0x"+function t(e){if("string"==typeof e){var n=e.slice(2);return(2!=n.length||n>="80"?r(n.length/2,128):"")+n}var i=e.map(t).join("");return r(i.length/2,192)+i}(t)},decode:function(t){var e=2,r=function(){if(e>=t.length)throw"";var r=t.slice(e,e+2);return r<"80"?(e+=2,"0x"+r):r<"c0"?i():o()},n=function(){var r=parseInt(t.slice(e,e+=2),16)%64;return r<56?r:parseInt(t.slice(e,e+=2*(r-55)),16)},i=function(){var r=n();return"0x"+t.slice(e,e+=2*r)},o=function(){for(var t=2*n()+e,i=[];e=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},i.prototype._update=function(t){throw new Error("_update is not implemented")},i.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();return void 0!==t&&(e=e.toString(t)),e},i.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=i}).call(this,t("buffer").Buffer)},{buffer:47,inherits:325,stream:156}],312:[function(t,e,r){arguments[4][86][0].apply(r,arguments)},{"./hash/common":313,"./hash/hmac":314,"./hash/ripemd":315,"./hash/sha":316,"./hash/utils":323,dup:86}],313:[function(t,e,r){arguments[4][87][0].apply(r,arguments)},{"./utils":323,dup:87,"minimalistic-assert":329}],314:[function(t,e,r){arguments[4][88][0].apply(r,arguments)},{"./utils":323,dup:88,"minimalistic-assert":329}],315:[function(t,e,r){arguments[4][89][0].apply(r,arguments)},{"./common":313,"./utils":323,dup:89}],316:[function(t,e,r){arguments[4][90][0].apply(r,arguments)},{"./sha/1":317,"./sha/224":318,"./sha/256":319,"./sha/384":320,"./sha/512":321,dup:90}],317:[function(t,e,r){arguments[4][91][0].apply(r,arguments)},{"../common":313,"../utils":323,"./common":322,dup:91}],318:[function(t,e,r){arguments[4][92][0].apply(r,arguments)},{"../utils":323,"./256":319,dup:92}],319:[function(t,e,r){arguments[4][93][0].apply(r,arguments)},{"../common":313,"../utils":323,"./common":322,dup:93,"minimalistic-assert":329}],320:[function(t,e,r){arguments[4][94][0].apply(r,arguments)},{"../utils":323,"./512":321,dup:94}],321:[function(t,e,r){arguments[4][95][0].apply(r,arguments)},{"../common":313,"../utils":323,dup:95,"minimalistic-assert":329}],322:[function(t,e,r){arguments[4][96][0].apply(r,arguments)},{"../utils":323,dup:96}],323:[function(t,e,r){arguments[4][97][0].apply(r,arguments)},{dup:97,inherits:325,"minimalistic-assert":329}],324:[function(t,e,r){arguments[4][98][0].apply(r,arguments)},{dup:98,"hash.js":312,"minimalistic-assert":329,"minimalistic-crypto-utils":330}],325:[function(t,e,r){arguments[4][101][0].apply(r,arguments)},{dup:101}],326:[function(t,e,r){(function(r){var n=t("inherits"),i=t("hash-base"),o=new Array(16);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function s(t,e){return t<>>32-e}function u(t,e,r,n,i,o,a){return s(t+(e&r|~e&n)+i+o|0,a)+e|0}function f(t,e,r,n,i,o,a){return s(t+(e&n|r&~n)+i+o|0,a)+e|0}function c(t,e,r,n,i,o,a){return s(t+(e^r^n)+i+o|0,a)+e|0}function h(t,e,r,n,i,o,a){return s(t+(r^(e|~n))+i+o|0,a)+e|0}n(a,i),a.prototype._update=function(){for(var t=o,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,a=this._d;n=h(n=h(n=h(n=h(n=c(n=c(n=c(n=c(n=f(n=f(n=f(n=f(n=u(n=u(n=u(n=u(n,i=u(i,a=u(a,r=u(r,n,i,a,t[0],3614090360,7),n,i,t[1],3905402710,12),r,n,t[2],606105819,17),a,r,t[3],3250441966,22),i=u(i,a=u(a,r=u(r,n,i,a,t[4],4118548399,7),n,i,t[5],1200080426,12),r,n,t[6],2821735955,17),a,r,t[7],4249261313,22),i=u(i,a=u(a,r=u(r,n,i,a,t[8],1770035416,7),n,i,t[9],2336552879,12),r,n,t[10],4294925233,17),a,r,t[11],2304563134,22),i=u(i,a=u(a,r=u(r,n,i,a,t[12],1804603682,7),n,i,t[13],4254626195,12),r,n,t[14],2792965006,17),a,r,t[15],1236535329,22),i=f(i,a=f(a,r=f(r,n,i,a,t[1],4129170786,5),n,i,t[6],3225465664,9),r,n,t[11],643717713,14),a,r,t[0],3921069994,20),i=f(i,a=f(a,r=f(r,n,i,a,t[5],3593408605,5),n,i,t[10],38016083,9),r,n,t[15],3634488961,14),a,r,t[4],3889429448,20),i=f(i,a=f(a,r=f(r,n,i,a,t[9],568446438,5),n,i,t[14],3275163606,9),r,n,t[3],4107603335,14),a,r,t[8],1163531501,20),i=f(i,a=f(a,r=f(r,n,i,a,t[13],2850285829,5),n,i,t[2],4243563512,9),r,n,t[7],1735328473,14),a,r,t[12],2368359562,20),i=c(i,a=c(a,r=c(r,n,i,a,t[5],4294588738,4),n,i,t[8],2272392833,11),r,n,t[11],1839030562,16),a,r,t[14],4259657740,23),i=c(i,a=c(a,r=c(r,n,i,a,t[1],2763975236,4),n,i,t[4],1272893353,11),r,n,t[7],4139469664,16),a,r,t[10],3200236656,23),i=c(i,a=c(a,r=c(r,n,i,a,t[13],681279174,4),n,i,t[0],3936430074,11),r,n,t[3],3572445317,16),a,r,t[6],76029189,23),i=c(i,a=c(a,r=c(r,n,i,a,t[9],3654602809,4),n,i,t[12],3873151461,11),r,n,t[15],530742520,16),a,r,t[2],3299628645,23),i=h(i,a=h(a,r=h(r,n,i,a,t[0],4096336452,6),n,i,t[7],1126891415,10),r,n,t[14],2878612391,15),a,r,t[5],4237533241,21),i=h(i,a=h(a,r=h(r,n,i,a,t[12],1700485571,6),n,i,t[3],2399980690,10),r,n,t[10],4293915773,15),a,r,t[1],2240044497,21),i=h(i,a=h(a,r=h(r,n,i,a,t[8],1873313359,6),n,i,t[15],4264355552,10),r,n,t[6],2734768916,15),a,r,t[13],1309151649,21),i=h(i,a=h(a,r=h(r,n,i,a,t[4],4149444226,6),n,i,t[11],3174756917,10),r,n,t[2],718787259,15),a,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+a|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=new r(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},e.exports=a}).call(this,t("buffer").Buffer)},{buffer:47,"hash-base":327,inherits:325}],327:[function(t,e,r){arguments[4][105][0].apply(r,arguments)},{dup:105,inherits:325,"safe-buffer":350,stream:156}],328:[function(t,e,r){arguments[4][106][0].apply(r,arguments)},{"bn.js":240,brorand:241,dup:106}],329:[function(t,e,r){arguments[4][107][0].apply(r,arguments)},{dup:107}],330:[function(t,e,r){arguments[4][108][0].apply(r,arguments)},{dup:108}],331:[function(t,e,r){arguments[4][109][0].apply(r,arguments)},{dup:109}],332:[function(t,e,r){arguments[4][110][0].apply(r,arguments)},{"./certificate":333,"asn1.js":226,dup:110}],333:[function(t,e,r){arguments[4][111][0].apply(r,arguments)},{"asn1.js":226,dup:111}],334:[function(t,e,r){(function(r){var n=/Proc-Type: 4,ENCRYPTED\n\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\n\r?\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?/m,i=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n/m,o=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?-----END \1-----$/m,a=t("evp_bytestokey"),s=t("browserify-aes");e.exports=function(t,e){var u,f=t.toString(),c=f.match(n);if(c){var h="aes"+c[1],d=new r(c[2],"hex"),l=new r(c[3].replace(/\r?\n/g,""),"base64"),p=a(e,d.slice(0,8),parseInt(c[1],10)).key,b=[],m=s.createDecipheriv(h,p,d);b.push(m.update(l)),b.push(m.final()),u=r.concat(b)}else{var y=f.match(o);u=new r(y[2].replace(/\r?\n/g,""),"base64")}return{tag:f.match(i)[1],data:u}}}).call(this,t("buffer").Buffer)},{"browserify-aes":244,buffer:47,evp_bytestokey:310}],335:[function(t,e,r){(function(r){var n=t("./asn1"),i=t("./aesid.json"),o=t("./fixProc"),a=t("browserify-aes"),s=t("pbkdf2");function u(t){var e;"object"!==(void 0===t?"undefined":_typeof(t))||r.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=new r(t));var u,f,c,h,d,l,p,b,m,y,v,g,w,_=o(t,e),M=_.tag,x=_.data;switch(M){case"CERTIFICATE":f=n.certificate.decode(x,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(f||(f=n.PublicKey.decode(x,"der")),u=f.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(f.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return f.subjectPrivateKey=f.subjectPublicKey,{type:"ec",data:f};case"1.2.840.10040.4.1":return f.algorithm.params.pub_key=n.DSAparam.decode(f.subjectPublicKey.data,"der"),{type:"dsa",data:f.algorithm.params};default:throw new Error("unknown key id "+u)}throw new Error("unknown key type "+M);case"ENCRYPTED PRIVATE KEY":x=n.EncryptedPrivateKey.decode(x,"der"),h=e,d=(c=x).algorithm.decrypt.kde.kdeparams.salt,l=parseInt(c.algorithm.decrypt.kde.kdeparams.iters.toString(),10),p=i[c.algorithm.decrypt.cipher.algo.join(".")],b=c.algorithm.decrypt.cipher.iv,m=c.subjectPrivateKey,y=parseInt(p.split("-")[1],10)/8,v=s.pbkdf2Sync(h,d,l,y),g=a.createDecipheriv(p,v,b),(w=[]).push(g.update(m)),w.push(g.final()),x=r.concat(w);case"PRIVATE KEY":switch(u=(f=n.PrivateKey.decode(x,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(f.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:f.algorithm.curve,privateKey:n.ECPrivateKey.decode(f.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return f.algorithm.params.priv_key=n.DSAparam.decode(f.subjectPrivateKey,"der"),{type:"dsa",params:f.algorithm.params};default:throw new Error("unknown key id "+u)}throw new Error("unknown key type "+M);case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(x,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(x,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(x,"der")};case"EC PRIVATE KEY":return{curve:(x=n.ECPrivateKey.decode(x,"der")).parameters.value,privateKey:x.privateKey};default:throw new Error("unknown key type "+M)}}e.exports=u,u.signature=n.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":331,"./asn1":332,"./fixProc":334,"browserify-aes":244,buffer:47,pbkdf2:336}],336:[function(t,e,r){arguments[4][114][0].apply(r,arguments)},{"./lib/async":337,"./lib/sync":340,dup:114}],337:[function(t,e,r){(function(r,n){var i,o=t("./precondition"),a=t("./default-encoding"),s=t("./sync"),u=t("safe-buffer").Buffer,f=n.crypto&&n.crypto.subtle,c={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function d(t,e,r,n,i){return f.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then(function(t){return f.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)}).then(function(t){return u.from(t)})}e.exports=function(t,e,l,p,b,m){if(u.isBuffer(t)||(t=u.from(t,a)),u.isBuffer(e)||(e=u.from(e,a)),o(l,p),"function"==typeof b&&(m=b,b=void 0),"function"!=typeof m)throw new Error("No callback provided to pbkdf2");var y,v,g=c[(b=b||"sha1").toLowerCase()];if(!g||"function"!=typeof n.Promise)return r.nextTick(function(){var r;try{r=s(t,e,l,p,b)}catch(t){return m(t)}m(null,r)});y=function(t){if(n.process&&!n.process.browser)return Promise.resolve(!1);if(!f||!f.importKey||!f.deriveBits)return Promise.resolve(!1);if(void 0!==h[t])return h[t];var e=d(i=i||u.alloc(8),i,10,128,t).then(function(){return!0}).catch(function(){return!1});return h[t]=e,e}(g).then(function(r){return r?d(t,e,l,p,g):s(t,e,l,p,b)}),v=m,y.then(function(t){r.nextTick(function(){v(null,t)})},function(t){r.nextTick(function(){v(t)})})}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":338,"./precondition":339,"./sync":340,_process:120,"safe-buffer":350}],338:[function(t,e,r){(function(t){var r;t.browser?r="utf-8":r=parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";e.exports=r}).call(this,t("_process"))},{_process:120}],339:[function(t,e,r){arguments[4][117][0].apply(r,arguments)},{dup:117}],340:[function(t,e,r){arguments[4][118][0].apply(r,arguments)},{"./default-encoding":338,"./precondition":339,"create-hash/md5":274,dup:118,ripemd160:349,"safe-buffer":350,"sha.js":354}],341:[function(t,e,r){arguments[4][121][0].apply(r,arguments)},{"./privateDecrypt":343,"./publicEncrypt":344,dup:121}],342:[function(t,e,r){(function(r){var n=t("create-hash");function i(t){var e=new r(4);return e.writeUInt32BE(t,0),e}e.exports=function(t,e){for(var o,a=new r(""),s=0;a.lengthp||new a(e).cmp(l.modulus)>=0)throw new Error("decryption error");d=c?f(new a(e),l):s(e,l);var b=new r(p-d.length);if(b.fill(0),d=r.concat([b,d],p),4===h)return function(t,e){t.modulus;var n=t.modulus.byteLength(),a=(e.length,u("sha1").update(new r("")).digest()),s=a.length;if(0!==e[0])throw new Error("decryption error");var f=e.slice(1,s+1),c=e.slice(s+1),h=o(f,i(c,s)),d=o(c,i(h,n-s-1));if(function(t,e){t=new r(t),e=new r(e);var n=0,i=t.length;t.length!==e.length&&(n++,i=Math.min(t.length,e.length));var o=-1;for(;++o=e.length){o++;break}var a=e.slice(2,i-1);e.slice(i-1,i);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return e.slice(i)}(0,d,c);if(3===h)return d;throw new Error("unknown padding")}}).call(this,t("buffer").Buffer)},{"./mgf":342,"./withPublic":345,"./xor":346,"bn.js":240,"browserify-rsa":262,buffer:47,"create-hash":272,"parse-asn1":335}],344:[function(t,e,r){(function(r){var n=t("parse-asn1"),i=t("randombytes"),o=t("create-hash"),a=t("./mgf"),s=t("./xor"),u=t("bn.js"),f=t("./withPublic"),c=t("browserify-rsa");e.exports=function(t,e,h){var d;d=t.padding?t.padding:h?1:4;var l,p=n(t);if(4===d)l=function(t,e){var n=t.modulus.byteLength(),f=e.length,c=o("sha1").update(new r("")).digest(),h=c.length,d=2*h;if(f>n-d-2)throw new Error("message too long");var l=new r(n-f-d-2);l.fill(0);var p=n-h-1,b=i(h),m=s(r.concat([c,l,new r([1]),e],p),a(b,p)),y=s(b,a(m,h));return new u(r.concat([new r([0]),y,m],n))}(p,e);else if(1===d)l=function(t,e,n){var o,a=e.length,s=t.modulus.byteLength();if(a>s-11)throw new Error("message too long");n?(o=new r(s-a-3)).fill(255):o=function(t,e){var n,o=new r(t),a=0,s=i(2*t),u=0;for(;a=0)throw new Error("data too long for modulus")}return h?c(l,p):f(l,p)}}).call(this,t("buffer").Buffer)},{"./mgf":342,"./withPublic":345,"./xor":346,"bn.js":240,"browserify-rsa":262,buffer:47,"create-hash":272,"parse-asn1":335,randombytes:347}],345:[function(t,e,r){(function(r){var n=t("bn.js");e.exports=function(t,e){return new r(t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed().toArray())}}).call(this,t("buffer").Buffer)},{"bn.js":240,buffer:47}],346:[function(t,e,r){arguments[4][126][0].apply(r,arguments)},{dup:126}],347:[function(t,e,r){(function(r,n){var i=t("safe-buffer").Buffer,o=n.crypto||n.msCrypto;o&&o.getRandomValues?e.exports=function(t,e){if(t>65536)throw new Error("requested too many random bytes");var a=new n.Uint8Array(t);t>0&&o.getRandomValues(a);var s=i.from(a.buffer);if("function"==typeof e)return r.nextTick(function(){e(null,s)});return s}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:120,"safe-buffer":350}],348:[function(t,e,r){(function(e,n){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=t("safe-buffer"),a=t("randombytes"),s=o.Buffer,u=o.kMaxLength,f=n.crypto||n.msCrypto,c=Math.pow(2,32)-1;function h(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>c||t<0)throw new TypeError("offset must be a uint32");if(t>u||t>e)throw new RangeError("offset out of range")}function d(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>c||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>u)throw new RangeError("buffer too small")}function l(t,r,n,i){if(e.browser){var o=t.buffer,s=new Uint8Array(o,r,n);return f.getRandomValues(s),i?void e.nextTick(function(){i(null,t)}):t}if(!i)return a(n).copy(t,r),t;a(n,function(e,n){if(e)return i(e);n.copy(t,r),i(null,t)})}f&&f.getRandomValues||!e.browser?(r.randomFill=function(t,e,r,i){if(!(s.isBuffer(t)||t instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)i=e,e=0,r=t.length;else if("function"==typeof r)i=r,r=t.length-e;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return h(e,t.length),d(r,e,t.length),l(t,e,r,i)},r.randomFillSync=function(t,e,r){void 0===e&&(e=0);if(!(s.isBuffer(t)||t instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');h(e,t.length),void 0===r&&(r=t.length-e);return d(r,e,t.length),l(t,e,r)}):(r.randomFill=i,r.randomFillSync=i)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:120,randombytes:347,"safe-buffer":350}],349:[function(t,e,r){(function(r){var n=t("inherits"),i=t("hash-base");function o(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function a(t,e){return t<>>32-e}function s(t,e,r,n,i,o,s,u){return a(t+(e^r^n)+o+s|0,u)+i|0}function u(t,e,r,n,i,o,s,u){return a(t+(e&r|~e&n)+o+s|0,u)+i|0}function f(t,e,r,n,i,o,s,u){return a(t+((e|~r)^n)+o+s|0,u)+i|0}function c(t,e,r,n,i,o,s,u){return a(t+(e&n|r&~n)+o+s|0,u)+i|0}function h(t,e,r,n,i,o,s,u){return a(t+(e^(r|~n))+o+s|0,u)+i|0}n(o,i),o.prototype._update=function(){for(var t=new Array(16),e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d,d=this._e;d=s(d,r=s(r,n,i,o,d,t[0],0,11),n,i=a(i,10),o,t[1],0,14),n=s(n=a(n,10),i=s(i,o=s(o,d,r,n,i,t[2],0,15),d,r=a(r,10),n,t[3],0,12),o,d=a(d,10),r,t[4],0,5),o=s(o=a(o,10),d=s(d,r=s(r,n,i,o,d,t[5],0,8),n,i=a(i,10),o,t[6],0,7),r,n=a(n,10),i,t[7],0,9),r=s(r=a(r,10),n=s(n,i=s(i,o,d,r,n,t[8],0,11),o,d=a(d,10),r,t[9],0,13),i,o=a(o,10),d,t[10],0,14),i=s(i=a(i,10),o=s(o,d=s(d,r,n,i,o,t[11],0,15),r,n=a(n,10),i,t[12],0,6),d,r=a(r,10),n,t[13],0,7),d=u(d=a(d,10),r=s(r,n=s(n,i,o,d,r,t[14],0,9),i,o=a(o,10),d,t[15],0,8),n,i=a(i,10),o,t[7],1518500249,7),n=u(n=a(n,10),i=u(i,o=u(o,d,r,n,i,t[4],1518500249,6),d,r=a(r,10),n,t[13],1518500249,8),o,d=a(d,10),r,t[1],1518500249,13),o=u(o=a(o,10),d=u(d,r=u(r,n,i,o,d,t[10],1518500249,11),n,i=a(i,10),o,t[6],1518500249,9),r,n=a(n,10),i,t[15],1518500249,7),r=u(r=a(r,10),n=u(n,i=u(i,o,d,r,n,t[3],1518500249,15),o,d=a(d,10),r,t[12],1518500249,7),i,o=a(o,10),d,t[0],1518500249,12),i=u(i=a(i,10),o=u(o,d=u(d,r,n,i,o,t[9],1518500249,15),r,n=a(n,10),i,t[5],1518500249,9),d,r=a(r,10),n,t[2],1518500249,11),d=u(d=a(d,10),r=u(r,n=u(n,i,o,d,r,t[14],1518500249,7),i,o=a(o,10),d,t[11],1518500249,13),n,i=a(i,10),o,t[8],1518500249,12),n=f(n=a(n,10),i=f(i,o=f(o,d,r,n,i,t[3],1859775393,11),d,r=a(r,10),n,t[10],1859775393,13),o,d=a(d,10),r,t[14],1859775393,6),o=f(o=a(o,10),d=f(d,r=f(r,n,i,o,d,t[4],1859775393,7),n,i=a(i,10),o,t[9],1859775393,14),r,n=a(n,10),i,t[15],1859775393,9),r=f(r=a(r,10),n=f(n,i=f(i,o,d,r,n,t[8],1859775393,13),o,d=a(d,10),r,t[1],1859775393,15),i,o=a(o,10),d,t[2],1859775393,14),i=f(i=a(i,10),o=f(o,d=f(d,r,n,i,o,t[7],1859775393,8),r,n=a(n,10),i,t[0],1859775393,13),d,r=a(r,10),n,t[6],1859775393,6),d=f(d=a(d,10),r=f(r,n=f(n,i,o,d,r,t[13],1859775393,5),i,o=a(o,10),d,t[11],1859775393,12),n,i=a(i,10),o,t[5],1859775393,7),n=c(n=a(n,10),i=c(i,o=f(o,d,r,n,i,t[12],1859775393,5),d,r=a(r,10),n,t[1],2400959708,11),o,d=a(d,10),r,t[9],2400959708,12),o=c(o=a(o,10),d=c(d,r=c(r,n,i,o,d,t[11],2400959708,14),n,i=a(i,10),o,t[10],2400959708,15),r,n=a(n,10),i,t[0],2400959708,14),r=c(r=a(r,10),n=c(n,i=c(i,o,d,r,n,t[8],2400959708,15),o,d=a(d,10),r,t[12],2400959708,9),i,o=a(o,10),d,t[4],2400959708,8),i=c(i=a(i,10),o=c(o,d=c(d,r,n,i,o,t[13],2400959708,9),r,n=a(n,10),i,t[3],2400959708,14),d,r=a(r,10),n,t[7],2400959708,5),d=c(d=a(d,10),r=c(r,n=c(n,i,o,d,r,t[15],2400959708,6),i,o=a(o,10),d,t[14],2400959708,8),n,i=a(i,10),o,t[5],2400959708,6),n=h(n=a(n,10),i=c(i,o=c(o,d,r,n,i,t[6],2400959708,5),d,r=a(r,10),n,t[2],2400959708,12),o,d=a(d,10),r,t[4],2840853838,9),o=h(o=a(o,10),d=h(d,r=h(r,n,i,o,d,t[0],2840853838,15),n,i=a(i,10),o,t[5],2840853838,5),r,n=a(n,10),i,t[9],2840853838,11),r=h(r=a(r,10),n=h(n,i=h(i,o,d,r,n,t[7],2840853838,6),o,d=a(d,10),r,t[12],2840853838,8),i,o=a(o,10),d,t[2],2840853838,13),i=h(i=a(i,10),o=h(o,d=h(d,r,n,i,o,t[10],2840853838,12),r,n=a(n,10),i,t[14],2840853838,5),d,r=a(r,10),n,t[1],2840853838,12),d=h(d=a(d,10),r=h(r,n=h(n,i,o,d,r,t[3],2840853838,13),i,o=a(o,10),d,t[8],2840853838,14),n,i=a(i,10),o,t[11],2840853838,11),n=h(n=a(n,10),i=h(i,o=h(o,d,r,n,i,t[6],2840853838,8),d,r=a(r,10),n,t[15],2840853838,5),o,d=a(d,10),r,t[13],2840853838,6),o=a(o,10);var l=this._a,p=this._b,b=this._c,m=this._d,y=this._e;y=h(y,l=h(l,p,b,m,y,t[5],1352829926,8),p,b=a(b,10),m,t[14],1352829926,9),p=h(p=a(p,10),b=h(b,m=h(m,y,l,p,b,t[7],1352829926,9),y,l=a(l,10),p,t[0],1352829926,11),m,y=a(y,10),l,t[9],1352829926,13),m=h(m=a(m,10),y=h(y,l=h(l,p,b,m,y,t[2],1352829926,15),p,b=a(b,10),m,t[11],1352829926,15),l,p=a(p,10),b,t[4],1352829926,5),l=h(l=a(l,10),p=h(p,b=h(b,m,y,l,p,t[13],1352829926,7),m,y=a(y,10),l,t[6],1352829926,7),b,m=a(m,10),y,t[15],1352829926,8),b=h(b=a(b,10),m=h(m,y=h(y,l,p,b,m,t[8],1352829926,11),l,p=a(p,10),b,t[1],1352829926,14),y,l=a(l,10),p,t[10],1352829926,14),y=c(y=a(y,10),l=h(l,p=h(p,b,m,y,l,t[3],1352829926,12),b,m=a(m,10),y,t[12],1352829926,6),p,b=a(b,10),m,t[6],1548603684,9),p=c(p=a(p,10),b=c(b,m=c(m,y,l,p,b,t[11],1548603684,13),y,l=a(l,10),p,t[3],1548603684,15),m,y=a(y,10),l,t[7],1548603684,7),m=c(m=a(m,10),y=c(y,l=c(l,p,b,m,y,t[0],1548603684,12),p,b=a(b,10),m,t[13],1548603684,8),l,p=a(p,10),b,t[5],1548603684,9),l=c(l=a(l,10),p=c(p,b=c(b,m,y,l,p,t[10],1548603684,11),m,y=a(y,10),l,t[14],1548603684,7),b,m=a(m,10),y,t[15],1548603684,7),b=c(b=a(b,10),m=c(m,y=c(y,l,p,b,m,t[8],1548603684,12),l,p=a(p,10),b,t[12],1548603684,7),y,l=a(l,10),p,t[4],1548603684,6),y=c(y=a(y,10),l=c(l,p=c(p,b,m,y,l,t[9],1548603684,15),b,m=a(m,10),y,t[1],1548603684,13),p,b=a(b,10),m,t[2],1548603684,11),p=f(p=a(p,10),b=f(b,m=f(m,y,l,p,b,t[15],1836072691,9),y,l=a(l,10),p,t[5],1836072691,7),m,y=a(y,10),l,t[1],1836072691,15),m=f(m=a(m,10),y=f(y,l=f(l,p,b,m,y,t[3],1836072691,11),p,b=a(b,10),m,t[7],1836072691,8),l,p=a(p,10),b,t[14],1836072691,6),l=f(l=a(l,10),p=f(p,b=f(b,m,y,l,p,t[6],1836072691,6),m,y=a(y,10),l,t[9],1836072691,14),b,m=a(m,10),y,t[11],1836072691,12),b=f(b=a(b,10),m=f(m,y=f(y,l,p,b,m,t[8],1836072691,13),l,p=a(p,10),b,t[12],1836072691,5),y,l=a(l,10),p,t[2],1836072691,14),y=f(y=a(y,10),l=f(l,p=f(p,b,m,y,l,t[10],1836072691,13),b,m=a(m,10),y,t[0],1836072691,13),p,b=a(b,10),m,t[4],1836072691,7),p=u(p=a(p,10),b=u(b,m=f(m,y,l,p,b,t[13],1836072691,5),y,l=a(l,10),p,t[8],2053994217,15),m,y=a(y,10),l,t[6],2053994217,5),m=u(m=a(m,10),y=u(y,l=u(l,p,b,m,y,t[4],2053994217,8),p,b=a(b,10),m,t[1],2053994217,11),l,p=a(p,10),b,t[3],2053994217,14),l=u(l=a(l,10),p=u(p,b=u(b,m,y,l,p,t[11],2053994217,14),m,y=a(y,10),l,t[15],2053994217,6),b,m=a(m,10),y,t[0],2053994217,14),b=u(b=a(b,10),m=u(m,y=u(y,l,p,b,m,t[5],2053994217,6),l,p=a(p,10),b,t[12],2053994217,9),y,l=a(l,10),p,t[2],2053994217,12),y=u(y=a(y,10),l=u(l,p=u(p,b,m,y,l,t[13],2053994217,9),b,m=a(m,10),y,t[9],2053994217,12),p,b=a(b,10),m,t[7],2053994217,5),p=s(p=a(p,10),b=u(b,m=u(m,y,l,p,b,t[10],2053994217,15),y,l=a(l,10),p,t[14],2053994217,8),m,y=a(y,10),l,t[12],0,8),m=s(m=a(m,10),y=s(y,l=s(l,p,b,m,y,t[15],0,5),p,b=a(b,10),m,t[10],0,12),l,p=a(p,10),b,t[4],0,9),l=s(l=a(l,10),p=s(p,b=s(b,m,y,l,p,t[1],0,12),m,y=a(y,10),l,t[5],0,5),b,m=a(m,10),y,t[8],0,14),b=s(b=a(b,10),m=s(m,y=s(y,l,p,b,m,t[7],0,6),l,p=a(p,10),b,t[6],0,8),y,l=a(l,10),p,t[2],0,13),y=s(y=a(y,10),l=s(l,p=s(p,b,m,y,l,t[13],0,6),b,m=a(m,10),y,t[14],0,5),p,b=a(b,10),m,t[0],0,15),p=s(p=a(p,10),b=s(b,m=s(m,y,l,p,b,t[3],0,13),y,l=a(l,10),p,t[9],0,11),m,y=a(y,10),l,t[11],0,11),m=a(m,10);var v=this._b+i+m|0;this._b=this._c+o+y|0,this._c=this._d+d+l|0,this._d=this._e+r+p|0,this._e=this._a+n+b|0,this._a=v},o.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=new r(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},e.exports=o}).call(this,t("buffer").Buffer)},{buffer:47,"hash-base":311,inherits:325}],350:[function(t,e,r){arguments[4][147][0].apply(r,arguments)},{buffer:47,dup:147}],351:[function(t,e,r){e.exports=t("scryptsy")},{scryptsy:352}],352:[function(t,e,r){(function(r){var n=t("pbkdf2").pbkdf2Sync,i=2147483647;function o(t,e,n,i,o){if(r.isBuffer(t)&&r.isBuffer(n))t.copy(n,i,e,e+o);else for(;o--;)n[i++]=t[e++]}e.exports=function(t,e,a,s,u,f,c){if(0===a||0!=(a&a-1))throw Error("N must be > 0 and a power of 2");if(a>i/128/s)throw Error("Parameter N is too large");if(s>i/128/u)throw Error("Parameter r is too large");var h,d=new r(256*s),l=new r(128*s*a),p=new Int32Array(16),b=new Int32Array(16),m=new r(64),y=n(t,e,1,128*u*s,"sha256");if(c){var v=u*a*2,g=0;h=function(){++g%1e3==0&&c({current:g,total:v,percent:g/v*100})}}for(var w=0;w>>32-e}function k(t){var e;for(e=0;e<16;e++)p[e]=(255&t[4*e+0])<<0,p[e]|=(255&t[4*e+1])<<8,p[e]|=(255&t[4*e+2])<<16,p[e]|=(255&t[4*e+3])<<24;for(o(p,0,b,0,16),e=8;e>0;e-=2)b[4]^=x(b[0]+b[12],7),b[8]^=x(b[4]+b[0],9),b[12]^=x(b[8]+b[4],13),b[0]^=x(b[12]+b[8],18),b[9]^=x(b[5]+b[1],7),b[13]^=x(b[9]+b[5],9),b[1]^=x(b[13]+b[9],13),b[5]^=x(b[1]+b[13],18),b[14]^=x(b[10]+b[6],7),b[2]^=x(b[14]+b[10],9),b[6]^=x(b[2]+b[14],13),b[10]^=x(b[6]+b[2],18),b[3]^=x(b[15]+b[11],7),b[7]^=x(b[3]+b[15],9),b[11]^=x(b[7]+b[3],13),b[15]^=x(b[11]+b[7],18),b[1]^=x(b[0]+b[3],7),b[2]^=x(b[1]+b[0],9),b[3]^=x(b[2]+b[1],13),b[0]^=x(b[3]+b[2],18),b[6]^=x(b[5]+b[4],7),b[7]^=x(b[6]+b[5],9),b[4]^=x(b[7]+b[6],13),b[5]^=x(b[4]+b[7],18),b[11]^=x(b[10]+b[9],7),b[8]^=x(b[11]+b[10],9),b[9]^=x(b[8]+b[11],13),b[10]^=x(b[9]+b[8],18),b[12]^=x(b[15]+b[14],7),b[13]^=x(b[12]+b[15],9),b[14]^=x(b[13]+b[12],13),b[15]^=x(b[14]+b[13],18);for(e=0;e<16;++e)p[e]=b[e]+p[e];for(e=0;e<16;e++){var r=4*e;t[r+0]=p[e]>>0&255,t[r+1]=p[e]>>8&255,t[r+2]=p[e]>>16&255,t[r+3]=p[e]>>24&255}}function S(t,e,r,n,i){for(var o=0;o>>((3&e)<<3)&255;return i}}e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],363:[function(t,e,r){for(var n=t("./rng"),i=[],o={},a=0;a<256;a++)i[a]=(a+256).toString(16).substr(1),o[i[a]]=a;function s(t,e){var r=e||0,n=i;return n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]}var u=n(),f=[1|u[0],u[1],u[2],u[3],u[4],u[5]],c=16383&(u[6]<<8|u[7]),h=0,d=0;function l(t,e,r){var i=e&&r||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var a=0;a<16;a++)e[i+a]=o[a];return e||s(o)}var p=l;p.v1=function(t,e,r){var n=e&&r||0,i=e||[],o=void 0!==(t=t||{}).clockseq?t.clockseq:c,a=void 0!==t.msecs?t.msecs:(new Date).getTime(),u=void 0!==t.nsecs?t.nsecs:d+1,l=a-h+(u-d)/1e4;if(l<0&&void 0===t.clockseq&&(o=o+1&16383),(l<0||a>h)&&void 0===t.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");h=a,d=u,c=o;var p=(1e4*(268435455&(a+=122192928e5))+u)%4294967296;i[n++]=p>>>24&255,i[n++]=p>>>16&255,i[n++]=p>>>8&255,i[n++]=255&p;var b=a/4294967296*1e4&268435455;i[n++]=b>>>8&255,i[n++]=255&b,i[n++]=b>>>24&15|16,i[n++]=b>>>16&255,i[n++]=o>>>8|128,i[n++]=255&o;for(var m=t.node||f,y=0;y<6;y++)i[n+y]=m[y];return e||s(i)},p.v4=l,p.parse=function(t,e,r){var n=e&&r||0,i=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){i<16&&(e[n+i++]=o[t])});i<16;)e[n+i++]=0;return e},p.unparse=s,e.exports=p},{"./rng":362}],364:[function(t,e,r){(function(r,n){var i=t("underscore"),o=t("web3-core"),a=t("web3-core-method"),s=t("any-promise"),u=t("eth-lib/lib/account"),f=t("eth-lib/lib/hash"),c=t("eth-lib/lib/rlp"),h=t("eth-lib/lib/nat"),d=t("eth-lib/lib/bytes"),l=t(void 0===r?"crypto-browserify":"crypto"),p=t("scrypt.js"),b=t("uuid"),m=t("web3-utils"),y=t("web3-core-helpers"),v=function(t){return i.isUndefined(t)||i.isNull(t)},g=function(t){for(;t&&t.startsWith("0x0");)t="0x"+t.slice(3);return t},w=function(t){return t.length%2==1&&(t=t.replace("0x","0x0")),t},_=function(){var t=this;o.packageInit(this,arguments),delete this.BatchRequest,delete this.extend;var e=[new a({name:"getId",call:"net_version",params:0,outputFormatter:m.hexToNumber}),new a({name:"getGasPrice",call:"eth_gasPrice",params:0}),new a({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[function(t){if(m.isAddress(t))return t;throw new Error("Address "+t+' is not a valid address to get the "transactionCount".')},function(){return"latest"}]})];this._ethereumCall={},i.each(e,function(e){e.attachToObject(t._ethereumCall),e.setRequestManager(t._requestManager)}),this.wallet=new M(this)};function M(t){this._accounts=t,this.length=0,this.defaultKeyName="web3js_wallet"}_.prototype._addAccountFunctions=function(t){var e=this;return t.signTransaction=function(r,n){return e.signTransaction(r,t.privateKey,n)},t.sign=function(r){return e.sign(r,t.privateKey)},t.encrypt=function(r,n){return e.encrypt(t.privateKey,r,n)},t},_.prototype.create=function(t){return this._addAccountFunctions(u.create(t||m.randomHex(32)))},_.prototype.privateKeyToAccount=function(t){return this._addAccountFunctions(u.fromPrivate(t))},_.prototype.signTransaction=function(t,e,r){var n,o=!1;if(r=r||function(){},!t)return o=new Error("No transaction object given!"),r(o),s.reject(o);function a(t){if(t.gas||t.gasLimit||(o=new Error('"gas" is missing')),(t.nonce<0||t.gas<0||t.gasPrice<0||t.chainId<0)&&(o=new Error("Gas, gasPrice, nonce or chainId is lower than 0")),o)return r(o),s.reject(new Error('"gas" is missing'));try{var i=t=y.formatters.inputCallFormatter(t);i.to=t.to||"0x",i.data=t.data||"0x",i.value=t.value||"0x",i.chainId=m.numberToHex(t.chainId);var a=c.encode([d.fromNat(i.nonce),d.fromNat(i.gasPrice),d.fromNat(i.gas),i.to.toLowerCase(),d.fromNat(i.value),i.data,d.fromNat(i.chainId||"0x1"),"0x","0x"]),l=f.keccak256(a),p=u.makeSigner(2*h.toNumber(i.chainId||"0x1")+35)(f.keccak256(a),e),b=c.decode(a).slice(0,6).concat(u.decodeSignature(p));b[6]=w(g(b[6])),b[7]=w(g(b[7])),b[8]=w(g(b[8]));var v=c.encode(b),_=c.decode(v);n={messageHash:l,v:g(_[6]),r:g(_[7]),s:g(_[8]),rawTransaction:v}}catch(t){return r(t),s.reject(t)}return r(null,n),n}return void 0!==t.nonce&&void 0!==t.chainId&&void 0!==t.gasPrice?s.resolve(a(t)):s.all([v(t.chainId)?this._ethereumCall.getId():t.chainId,v(t.gasPrice)?this._ethereumCall.getGasPrice():t.gasPrice,v(t.nonce)?this._ethereumCall.getTransactionCount(this.privateKeyToAccount(e).address):t.nonce]).then(function(e){if(v(e[0])||v(e[1])||v(e[2]))throw new Error('One of the values "chainId", "gasPrice", or "nonce" couldn\'t be fetched: '+JSON.stringify(e));return a(i.extend(t,{chainId:e[0],gasPrice:e[1],nonce:e[2]}))})},_.prototype.recoverTransaction=function(t){var e=c.decode(t),r=u.encodeSignature(e.slice(6,9)),n=d.toNumber(e[6]),i=n<35?[]:[d.fromNumber(n-35>>1),"0x","0x"],o=e.slice(0,6).concat(i),a=c.encode(o);return u.recover(f.keccak256(a),r)},_.prototype.hashMessage=function(t){var e=m.isHexStrict(t)?m.hexToBytes(t):t,r=n.from(e),i="Ethereum Signed Message:\n"+e.length,o=n.from(i),a=n.concat([o,r]);return f.keccak256s(a)},_.prototype.sign=function(t,e){var r=this.hashMessage(t),n=u.sign(r,e),i=u.decodeSignature(n);return{message:t,messageHash:r,v:i[0],r:i[1],s:i[2],signature:n}},_.prototype.recover=function(t,e,r){var n=[].slice.apply(arguments);return i.isObject(t)?this.recover(t.messageHash,u.encodeSignature([t.v,t.r,t.s]),!0):(r||(t=this.hashMessage(t)),n.length>=4?(r=n.slice(-1)[0],r=!!i.isBoolean(r)&&!!r,this.recover(t,u.encodeSignature(n.slice(1,4)),r)):u.recover(t,e))},_.prototype.decrypt=function(t,e,r){if(!i.isString(e))throw new Error("No password given.");var o,a,s=i.isObject(t)?t:JSON.parse(r?t.toLowerCase():t);if(3!==s.version)throw new Error("Not a valid V3 wallet");if("scrypt"===s.crypto.kdf)a=s.crypto.kdfparams,o=p(new n(e),new n(a.salt,"hex"),a.n,a.r,a.p,a.dklen);else{if("pbkdf2"!==s.crypto.kdf)throw new Error("Unsupported key derivation scheme");if("hmac-sha256"!==(a=s.crypto.kdfparams).prf)throw new Error("Unsupported parameters to PBKDF2");o=l.pbkdf2Sync(new n(e),new n(a.salt,"hex"),a.c,a.dklen,"sha256")}var u=new n(s.crypto.ciphertext,"hex");if(m.sha3(n.concat([o.slice(16,32),u])).replace("0x","")!==s.crypto.mac)throw new Error("Key derivation failed - possibly wrong password");var f=l.createDecipheriv(s.crypto.cipher,o.slice(0,16),new n(s.crypto.cipherparams.iv,"hex")),c="0x"+n.concat([f.update(u),f.final()]).toString("hex");return this.privateKeyToAccount(c)},_.prototype.encrypt=function(t,e,r){var i,o=this.privateKeyToAccount(t),a=(r=r||{}).salt||l.randomBytes(32),s=r.iv||l.randomBytes(16),u=r.kdf||"scrypt",f={dklen:r.dklen||32,salt:a.toString("hex")};if("pbkdf2"===u)f.c=r.c||262144,f.prf="hmac-sha256",i=l.pbkdf2Sync(new n(e),a,f.c,f.dklen,"sha256");else{if("scrypt"!==u)throw new Error("Unsupported kdf");f.n=r.n||8192,f.r=r.r||8,f.p=r.p||1,i=p(new n(e),a,f.n,f.r,f.p,f.dklen)}var c=l.createCipheriv(r.cipher||"aes-128-ctr",i.slice(0,16),s);if(!c)throw new Error("Unsupported cipher");var h=n.concat([c.update(new n(o.privateKey.replace("0x",""),"hex")),c.final()]),d=m.sha3(n.concat([i.slice(16,32),new n(h,"hex")])).replace("0x","");return{version:3,id:b.v4({random:r.uuid||l.randomBytes(16)}),address:o.address.toLowerCase().replace("0x",""),crypto:{ciphertext:h.toString("hex"),cipherparams:{iv:s.toString("hex")},cipher:r.cipher||"aes-128-ctr",kdf:u,kdfparams:f,mac:d.toString("hex")}}},M.prototype._findSafeIndex=function(t){return t=t||0,i.has(this,t)?this._findSafeIndex(t+1):t},M.prototype._currentIndexes=function(){return Object.keys(this).map(function(t){return parseInt(t)}).filter(function(t){return t<9e20})},M.prototype.create=function(t,e){for(var r=0;r=2?e.slice(2):e;var r=h.decodeParameters(t,e);return 1===r.__length__?r[0]:(delete r.__length__,r)},d.prototype.deploy=function(t,e){if((t=t||{}).arguments=t.arguments||[],!(t=this._getOrSetDefaultOptions(t)).data)return a._fireError(new Error('No "data" specified in neither the given options, nor the default options.'),null,null,e);var r=n.find(this.options.jsonInterface,function(t){return"constructor"===t.type})||{};return r.signature="constructor",this._createTxObject.apply({method:r,parent:this,deployData:t.data,_ethAccounts:this.constructor._ethAccounts},t.arguments)},d.prototype._generateEventOptions=function(){var t=Array.prototype.slice.call(arguments),e=this._getCallback(t),r=n.isObject(t[t.length-1])?t.pop():{},i=n.isString(t[0])?t[0]:"allevents";if(!(i="allevents"===i.toLowerCase()?{name:"ALLEVENTS",jsonInterface:this.options.jsonInterface}:this.options.jsonInterface.find(function(t){return"event"===t.type&&(t.name===i||t.signature==="0x"+i.replace("0x",""))})))throw new Error('Event "'+i.name+"\" doesn't exist in this contract.");if(!a.isAddress(this.options.address))throw new Error("This contract object doesn't have address set yet, please set an address first.");return{params:this._encodeEventABI(i,r),event:i,callback:e}},d.prototype.clone=function(){return new this.constructor(this.options.jsonInterface,this.options.address,this.options)},d.prototype.once=function(t,e,r){var i=Array.prototype.slice.call(arguments);if(!(r=this._getCallback(i)))throw new Error("Once requires a callback as the second parameter.");e&&delete e.fromBlock,this._on(t,e,function(t,e,i){i.unsubscribe(),n.isFunction(r)&&r(t,e,i)})},d.prototype._on=function(){var t=this._generateEventOptions.apply(this,arguments);this._checkListener("newListener",t.event.name,t.callback),this._checkListener("removeListener",t.event.name,t.callback);var e=new s({subscription:{params:1,inputFormatter:[u.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(t.event),subscriptionHandler:function(t){t.removed?this.emit("changed",t):this.emit("data",t),n.isFunction(this.callback)&&this.callback(null,t,this)}},type:"eth",requestManager:this._requestManager});return e.subscribe("logs",t.params,t.callback||function(){}),e},d.prototype.getPastEvents=function(){var t=this._generateEventOptions.apply(this,arguments),e=new o({name:"getPastLogs",call:"eth_getLogs",params:1,inputFormatter:[u.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(t.event)});e.setRequestManager(this._requestManager);var r=e.buildCall();return e=null,r(t.params,t.callback)},d.prototype._createTxObject=function(){var t=Array.prototype.slice.call(arguments),e={};if("function"===this.method.type&&(e.call=this.parent._executeMethod.bind(e,"call"),e.call.request=this.parent._executeMethod.bind(e,"call",!0)),e.send=this.parent._executeMethod.bind(e,"send"),e.send.request=this.parent._executeMethod.bind(e,"send",!0),e.encodeABI=this.parent._encodeMethodABI.bind(e),e.estimateGas=this.parent._executeMethod.bind(e,"estimate"),t&&this.method.inputs&&t.length!==this.method.inputs.length){if(this.nextMethod)return this.nextMethod.apply(null,t);throw f.InvalidNumberOfParams(t.length,this.method.inputs.length,this.method.name)}return e.arguments=t||[],e._method=this.method,e._parent=this.parent,e._ethAccounts=this.parent.constructor._ethAccounts||this._ethAccounts,this.deployData&&(e._deployData=this.deployData),e},d.prototype._processExecuteArguments=function(t,e){var r={};if(r.type=t.shift(),r.callback=this._parent._getCallback(t),"call"===r.type&&!0!==t[t.length-1]&&(n.isString(t[t.length-1])||isFinite(t[t.length-1]))&&(r.defaultBlock=t.pop()),r.options=n.isObject(t[t.length-1])?t.pop():{},r.generateRequest=!0===t[t.length-1]&&t.pop(),r.options=this._parent._getOrSetDefaultOptions(r.options),r.options.data=this.encodeABI(),!this._deployData&&!a.isAddress(this._parent.options.address))throw new Error("This contract object doesn't have address set yet, please set an address first.");return this._deployData||(r.options.to=this._parent.options.address),r.options.data?r:a._fireError(new Error("Couldn't find a matching contract method, or the number of parameters is wrong."),e.eventEmitter,e.reject,r.callback)},d.prototype._executeMethod=function(){var t=this,e=this._parent._processExecuteArguments.call(this,Array.prototype.slice.call(arguments),r),r=c("send"!==e.type),i=t.constructor._ethAccounts||t._ethAccounts;if(e.generateRequest){var s={params:[u.inputCallFormatter.call(this._parent,e.options)],callback:e.callback};return"call"===e.type?(s.params.push(u.inputDefaultBlockNumberFormatter.call(this._parent,e.defaultBlock)),s.method="eth_call",s.format=this._parent._decodeMethodReturn.bind(null,this._method.outputs)):s.method="eth_sendTransaction",s}switch(e.type){case"estimate":return new o({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[u.inputCallFormatter],outputFormatter:a.hexToNumber,requestManager:t._parent._requestManager,accounts:i,defaultAccount:t._parent.defaultAccount,defaultBlock:t._parent.defaultBlock}).createFunction()(e.options,e.callback);case"call":return new o({name:"call",call:"eth_call",params:2,inputFormatter:[u.inputCallFormatter,u.inputDefaultBlockNumberFormatter],outputFormatter:function(e){return t._parent._decodeMethodReturn(t._method.outputs,e)},requestManager:t._parent._requestManager,accounts:i,defaultAccount:t._parent.defaultAccount,defaultBlock:t._parent.defaultBlock}).createFunction()(e.options,e.defaultBlock,e.callback);case"send":if(!a.isAddress(e.options.from))return a._fireError(new Error('No "from" address specified in neither the given options, nor the default options.'),r.eventEmitter,r.reject,e.callback);if(n.isBoolean(this._method.payable)&&!this._method.payable&&e.options.value&&e.options.value>0)return a._fireError(new Error("Can not send value to non-payable contract method or constructor"),r.eventEmitter,r.reject,e.callback);var f={receiptFormatter:function(e){if(n.isArray(e.logs)){var r=n.map(e.logs,function(e){return t._parent._decodeEventABI.call({name:"ALLEVENTS",jsonInterface:t._parent.options.jsonInterface},e)});e.events={};var i=0;r.forEach(function(t){t.event?e.events[t.event]?Array.isArray(e.events[t.event])?e.events[t.event].push(t):e.events[t.event]=[e.events[t.event],t]:e.events[t.event]=t:(e.events[i]=t,i++)}),delete e.logs}return e},contractDeployFormatter:function(e){var r=t._parent.clone();return r.options.address=e.contractAddress,r}};return new o({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[u.inputTransactionFormatter],requestManager:t._parent._requestManager,accounts:t.constructor._ethAccounts||t._ethAccounts,defaultAccount:t._parent.defaultAccount,defaultBlock:t._parent.defaultBlock,extraFormatters:f}).createFunction()(e.options,e.callback)}},e.exports=d},{underscore:365,"web3-core":209,"web3-core-helpers":191,"web3-core-method":193,"web3-core-promievent":198,"web3-core-subscriptions":206,"web3-eth-abi":213,"web3-utils":393}],367:[function(t,e,r){arguments[4][210][0].apply(r,arguments)},{dup:210}],368:[function(t,e,r){var n=t("web3-utils"),i=t("bn.js"),o=function(t){var e="A".charCodeAt(0),r="Z".charCodeAt(0);return(t=(t=t.toUpperCase()).substr(4)+t.substr(0,4)).split("").map(function(t){var n=t.charCodeAt(0);return n>=e&&n<=r?n-e+10:t}).join("")},a=function(t){for(var e,r=t;r.length>2;)e=r.slice(0,9),r=parseInt(e,10)%97+r.slice(e.length);return parseInt(r,10)%97},s=function(t){this._iban=t};s.toAddress=function(t){if(!(t=new s(t)).isDirect())throw new Error("IBAN is indirect and can't be converted");return t.toAddress()},s.toIban=function(t){return s.fromAddress(t).toString()},s.fromAddress=function(t){if(!n.isAddress(t))throw new Error("Provided address is not a valid address: "+t);t=t.replace("0x","").replace("0X","");var e=function(t,e){for(var r=t;r.length<2*e;)r="0"+r;return r}(new i(t,16).toString(36),15);return s.fromBban(e.toUpperCase())},s.fromBban=function(t){var e=("0"+(98-a(o("XE00"+t)))).slice(-2);return new s("XE"+e+t)},s.createIndirect=function(t){return s.fromBban("ETH"+t.institution+t.identifier)},s.isValid=function(t){return new s(t).isValid()},s.prototype.isValid=function(){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban)&&1===a(o(this._iban))},s.prototype.isDirect=function(){return 34===this._iban.length||35===this._iban.length},s.prototype.isIndirect=function(){return 20===this._iban.length},s.prototype.checksum=function(){return this._iban.substr(2,2)},s.prototype.institution=function(){return this.isIndirect()?this._iban.substr(7,4):""},s.prototype.client=function(){return this.isIndirect()?this._iban.substr(11):""},s.prototype.toAddress=function(){if(this.isDirect()){var t=this._iban.substr(4),e=new i(t,36);return n.toChecksumAddress(e.toString(16,20))}return""},s.prototype.toString=function(){return this._iban},e.exports=s},{"bn.js":367,"web3-utils":393}],369:[function(t,e,r){var n=t("web3-core"),i=t("web3-core-method"),o=t("web3-utils"),a=t("web3-net"),s=t("web3-core-helpers").formatters,u=function(){var t=this;n.packageInit(this,arguments),this.net=new a(this.currentProvider);var e=null,r="latest";Object.defineProperty(this,"defaultAccount",{get:function(){return e},set:function(t){return t&&(e=o.toChecksumAddress(s.inputAddressFormatter(t))),u.forEach(function(t){t.defaultAccount=e}),t},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return r},set:function(t){return r=t,u.forEach(function(t){t.defaultBlock=r}),t},enumerable:!0});var u=[new i({name:"getAccounts",call:"personal_listAccounts",params:0,outputFormatter:o.toChecksumAddress}),new i({name:"newAccount",call:"personal_newAccount",params:1,inputFormatter:[null],outputFormatter:o.toChecksumAddress}),new i({name:"unlockAccount",call:"personal_unlockAccount",params:3,inputFormatter:[s.inputAddressFormatter,null,null]}),new i({name:"lockAccount",call:"personal_lockAccount",params:1,inputFormatter:[s.inputAddressFormatter]}),new i({name:"importRawKey",call:"personal_importRawKey",params:2}),new i({name:"sendTransaction",call:"personal_sendTransaction",params:2,inputFormatter:[s.inputTransactionFormatter,null]}),new i({name:"signTransaction",call:"personal_signTransaction",params:2,inputFormatter:[s.inputTransactionFormatter,null]}),new i({name:"sign",call:"personal_sign",params:3,inputFormatter:[s.inputSignFormatter,s.inputAddressFormatter,null]}),new i({name:"ecRecover",call:"personal_ecRecover",params:2,inputFormatter:[s.inputSignFormatter,null]})];u.forEach(function(e){e.attachToObject(t),e.setRequestManager(t._requestManager),e.defaultBlock=t.defaultBlock,e.defaultAccount=t.defaultAccount})};n.addProviders(u),e.exports=u},{"web3-core":209,"web3-core-helpers":191,"web3-core-method":193,"web3-net":373,"web3-utils":393}],370:[function(t,e,r){arguments[4][178][0].apply(r,arguments)},{dup:178}],371:[function(t,e,r){var n=t("underscore");e.exports=function(t){var e,r=this;return this.net.getId().then(function(t){return e=t,r.getBlock(0)}).then(function(r){var i="private";return"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3"===r.hash&&1===e&&(i="main"),"0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303"===r.hash&&2===e&&(i="morden"),"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"===r.hash&&3===e&&(i="ropsten"),"0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177"===r.hash&&4===e&&(i="rinkeby"),"0xa3c565fc15c7478862d50ccd6561e3c06b24cc509bf388941c25ea985ce32cb9"===r.hash&&42===e&&(i="kovan"),n.isFunction(t)&&t(null,i),i}).catch(function(e){if(!n.isFunction(t))throw e;t(e)})}},{underscore:370}],372:[function(t,e,r){var n=t("underscore"),i=t("web3-core"),o=t("web3-core-helpers"),a=t("web3-core-subscriptions").subscriptions,s=t("web3-core-method"),u=t("web3-utils"),f=t("web3-net"),c=t("web3-eth-personal"),h=t("web3-eth-contract"),d=t("web3-eth-iban"),l=t("web3-eth-accounts"),p=t("web3-eth-abi"),b=t("./getNetworkType.js"),m=o.formatters,y=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getBlockByHash":"eth_getBlockByNumber"},v=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getTransactionByBlockHashAndIndex":"eth_getTransactionByBlockNumberAndIndex"},g=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getUncleByBlockHashAndIndex":"eth_getUncleByBlockNumberAndIndex"},w=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getBlockTransactionCountByHash":"eth_getBlockTransactionCountByNumber"},_=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getUncleCountByBlockHash":"eth_getUncleCountByBlockNumber"},M=function(){var t=this;i.packageInit(this,arguments);var e=this.setProvider;this.setProvider=function(){e.apply(t,arguments),t.net.setProvider.apply(t,arguments),t.personal.setProvider.apply(t,arguments),t.accounts.setProvider.apply(t,arguments),t.Contract.setProvider(t.currentProvider,t.accounts)};var r=null,o="latest";Object.defineProperty(this,"defaultAccount",{get:function(){return r},set:function(e){return e&&(r=u.toChecksumAddress(m.inputAddressFormatter(e))),t.Contract.defaultAccount=r,t.personal.defaultAccount=r,x.forEach(function(t){t.defaultAccount=r}),e},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return o},set:function(e){return o=e,t.Contract.defaultBlock=o,t.personal.defaultBlock=o,x.forEach(function(t){t.defaultBlock=o}),e},enumerable:!0}),this.clearSubscriptions=t._requestManager.clearSubscriptions,this.net=new f(this.currentProvider),this.net.getNetworkType=b.bind(this),this.accounts=new l(this.currentProvider),this.personal=new c(this.currentProvider),this.personal.defaultAccount=this.defaultAccount;var M=function(){h.apply(this,arguments)};M.setProvider=function(){h.setProvider.apply(this,arguments)},(M.prototype=Object.create(h.prototype)).constructor=M,this.Contract=M,this.Contract.defaultAccount=this.defaultAccount,this.Contract.defaultBlock=this.defaultBlock,this.Contract.setProvider(this.currentProvider,this.accounts),this.Iban=d,this.abi=p;var x=[new s({name:"getNodeInfo",call:"web3_clientVersion"}),new s({name:"getProtocolVersion",call:"eth_protocolVersion",params:0}),new s({name:"getCoinbase",call:"eth_coinbase",params:0}),new s({name:"isMining",call:"eth_mining",params:0}),new s({name:"getHashrate",call:"eth_hashrate",params:0,outputFormatter:u.hexToNumber}),new s({name:"isSyncing",call:"eth_syncing",params:0,outputFormatter:m.outputSyncingFormatter}),new s({name:"getGasPrice",call:"eth_gasPrice",params:0,outputFormatter:m.outputBigNumberFormatter}),new s({name:"getAccounts",call:"eth_accounts",params:0,outputFormatter:u.toChecksumAddress}),new s({name:"getBlockNumber",call:"eth_blockNumber",params:0,outputFormatter:u.hexToNumber}),new s({name:"getBalance",call:"eth_getBalance",params:2,inputFormatter:[m.inputAddressFormatter,m.inputDefaultBlockNumberFormatter],outputFormatter:m.outputBigNumberFormatter}),new s({name:"getStorageAt",call:"eth_getStorageAt",params:3,inputFormatter:[m.inputAddressFormatter,u.numberToHex,m.inputDefaultBlockNumberFormatter]}),new s({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[m.inputAddressFormatter,m.inputDefaultBlockNumberFormatter]}),new s({name:"getBlock",call:y,params:2,inputFormatter:[m.inputBlockNumberFormatter,function(t){return!!t}],outputFormatter:m.outputBlockFormatter}),new s({name:"getUncle",call:g,params:2,inputFormatter:[m.inputBlockNumberFormatter,u.numberToHex],outputFormatter:m.outputBlockFormatter}),new s({name:"getBlockTransactionCount",call:w,params:1,inputFormatter:[m.inputBlockNumberFormatter],outputFormatter:u.hexToNumber}),new s({name:"getBlockUncleCount",call:_,params:1,inputFormatter:[m.inputBlockNumberFormatter],outputFormatter:u.hexToNumber}),new s({name:"getTransaction",call:"eth_getTransactionByHash",params:1,inputFormatter:[null],outputFormatter:m.outputTransactionFormatter}),new s({name:"getTransactionFromBlock",call:v,params:2,inputFormatter:[m.inputBlockNumberFormatter,u.numberToHex],outputFormatter:m.outputTransactionFormatter}),new s({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:m.outputTransactionReceiptFormatter}),new s({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[m.inputAddressFormatter,m.inputDefaultBlockNumberFormatter],outputFormatter:u.hexToNumber}),new s({name:"sendSignedTransaction",call:"eth_sendRawTransaction",params:1,inputFormatter:[null]}),new s({name:"signTransaction",call:"eth_signTransaction",params:1,inputFormatter:[m.inputTransactionFormatter]}),new s({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[m.inputTransactionFormatter]}),new s({name:"sign",call:"eth_sign",params:2,inputFormatter:[m.inputSignFormatter,m.inputAddressFormatter],transformPayload:function(t){return t.params.reverse(),t}}),new s({name:"call",call:"eth_call",params:2,inputFormatter:[m.inputCallFormatter,m.inputDefaultBlockNumberFormatter]}),new s({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[m.inputCallFormatter],outputFormatter:u.hexToNumber}),new s({name:"getCompilers",call:"eth_getCompilers",params:0}),new s({name:"compile.solidity",call:"eth_compileSolidity",params:1}),new s({name:"compile.lll",call:"eth_compileLLL",params:1}),new s({name:"compile.serpent",call:"eth_compileSerpent",params:1}),new s({name:"submitWork",call:"eth_submitWork",params:3}),new s({name:"getWork",call:"eth_getWork",params:0}),new s({name:"getPastLogs",call:"eth_getLogs",params:1,inputFormatter:[m.inputLogFormatter],outputFormatter:m.outputLogFormatter}),new a({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:m.outputBlockFormatter},pendingTransactions:{subscriptionName:"newPendingTransactions",params:0},logs:{params:1,inputFormatter:[m.inputLogFormatter],outputFormatter:m.outputLogFormatter,subscriptionHandler:function(t){t.removed?this.emit("changed",t):this.emit("data",t),n.isFunction(this.callback)&&this.callback(null,t,this)}},syncing:{params:0,outputFormatter:m.outputSyncingFormatter,subscriptionHandler:function(t){var e=this;!0!==this._isSyncing?(this._isSyncing=!0,this.emit("changed",e._isSyncing),n.isFunction(this.callback)&&this.callback(null,e._isSyncing,this),setTimeout(function(){e.emit("data",t),n.isFunction(e.callback)&&e.callback(null,t,e)},0)):(this.emit("data",t),n.isFunction(e.callback)&&this.callback(null,t,this),clearTimeout(this._isSyncingTimeout),this._isSyncingTimeout=setTimeout(function(){t.currentBlock>t.highestBlock-200&&(e._isSyncing=!1,e.emit("changed",e._isSyncing),n.isFunction(e.callback)&&e.callback(null,e._isSyncing,e))},500))}}}})];x.forEach(function(e){e.attachToObject(t),e.setRequestManager(t._requestManager,t.accounts),e.defaultBlock=t.defaultBlock,e.defaultAccount=t.defaultAccount})};i.addProviders(M),e.exports=M},{"./getNetworkType.js":371,underscore:370,"web3-core":209,"web3-core-helpers":191,"web3-core-method":193,"web3-core-subscriptions":206,"web3-eth-abi":213,"web3-eth-accounts":364,"web3-eth-contract":366,"web3-eth-iban":368,"web3-eth-personal":369,"web3-net":373,"web3-utils":393}],373:[function(t,e,r){var n=t("web3-core"),i=t("web3-core-method"),o=t("web3-utils"),a=function(){var t=this;n.packageInit(this,arguments),[new i({name:"getId",call:"net_version",params:0,outputFormatter:o.hexToNumber}),new i({name:"isListening",call:"net_listening",params:0}),new i({name:"getPeerCount",call:"net_peerCount",params:0,outputFormatter:o.hexToNumber})].forEach(function(e){e.attachToObject(t),e.setRequestManager(t._requestManager)})};n.addProviders(a),e.exports=a},{"web3-core":209,"web3-core-method":193,"web3-utils":393}],374:[function(t,e,r){e.exports=XMLHttpRequest},{}],375:[function(t,e,r){var n=t("web3-core-helpers").errors,i=t("xhr2"),o=function(t,e,r){this.host=t||"http://localhost:8545",this.timeout=e||0,this.connected=!1,this.headers=r};o.prototype._prepareRequest=function(){var t=new i;return t.open("POST",this.host,!0),t.setRequestHeader("Content-Type","application/json"),this.headers&&this.headers.forEach(function(e){t.setRequestHeader(e.name,e.value)}),t},o.prototype.send=function(t,e){var r=this,i=this._prepareRequest();i.onreadystatechange=function(){if(4===i.readyState&&1!==i.timeout){var t=i.responseText,o=null;try{t=JSON.parse(t)}catch(t){o=n.InvalidResponse(i.responseText)}r.connected=!0,e(o,t)}},i.ontimeout=function(){r.connected=!1,e(n.ConnectionTimeout(this.timeout))};try{i.send(JSON.stringify(t))}catch(t){this.connected=!1,e(n.InvalidConnection(this.host))}},e.exports=o},{"web3-core-helpers":191,xhr2:374}],376:[function(t,e,r){!function(t,n,i,o,a,s){var u=l(function(t,e){var r=e.length;return l(function(n){for(var i=0;i0;)if(U+=r,r=t.charAt(o++),4===z?(O+=String.fromCharCode(parseInt(U,16)),z=0,f=o-1):z++,!r)break t;if('"'===r&&!L){q=D.pop()||p,O+=t.substring(f,o-1);break}if(!("\\"!==r||L||(L=!0,O+=t.substring(f,o-1),r=t.charAt(o++))))break;if(L){if(L=!1,"n"===r?O+="\n":"r"===r?O+="\r":"t"===r?O+="\t":"f"===r?O+="\f":"b"===r?O+="\b":"u"===r?(z=1,U=""):O+=r,r=t.charAt(o++),f=o-1,r)continue;break}h.lastIndex=o;var d=h.exec(t);if(!d){o=t.length+1,O+=t.substring(f,o-1);break}if(o=d.index+1,!(r=t.charAt(d.index))){O+=t.substring(f,o-1);break}}continue;case M:if(!r)continue;if("r"!==r)return X("Invalid true started with t"+r);q=x;continue;case x:if(!r)continue;if("u"!==r)return X("Invalid true started with tr"+r);q=k;continue;case k:if(!r)continue;if("e"!==r)return X("Invalid true started with tru"+r);a(!0),u(),q=D.pop()||p;continue;case S:if(!r)continue;if("a"!==r)return X("Invalid false started with f"+r);q=E;continue;case E:if(!r)continue;if("l"!==r)return X("Invalid false started with fa"+r);q=A;continue;case A:if(!r)continue;if("s"!==r)return X("Invalid false started with fal"+r);q=j;continue;case j:if(!r)continue;if("e"!==r)return X("Invalid false started with fals"+r);a(!1),u(),q=D.pop()||p;continue;case I:if(!r)continue;if("u"!==r)return X("Invalid null started with n"+r);q=B;continue;case B:if(!r)continue;if("l"!==r)return X("Invalid null started with nu"+r);q=T;continue;case T:if(!r)continue;if("l"!==r)return X("Invalid null started with nul"+r);a(null),u(),q=D.pop()||p;continue;case C:if("."!==r)return X("Leading zero not followed by .");N+=r,q=P;continue;case P:if(-1!=="0123456789".indexOf(r))N+=r;else if("."===r){if(-1!==N.indexOf("."))return X("Invalid number has two dots");N+=r}else if("e"===r||"E"===r){if(-1!==N.indexOf("e")||-1!==N.indexOf("E"))return X("Invalid number has two exponential");N+=r}else if("+"===r||"-"===r){if("e"!==n&&"E"!==n)return X("Invalid symbol in number");N+=r}else N&&(a(parseFloat(N)),u(),N=""),o--,q=D.pop()||p;continue;default:return X("Unknown state: "+q)}H>=R&&(J=0,O!==s&&O.length>c&&(X("Max buffer length exceeded: textNode"),J=Math.max(J,O.length)),N.length>c&&(X("Max buffer length exceeded: numberNode"),J=Math.max(J,N.length)),R=c-J+H);var J}),t(ft).on(function(){if(q==l)return a({}),u(),void(F=!0);q===p&&0===K||X("Unexpected end");O!==s&&(a(O),u(),O=s);F=!0})}var R,O,N,L,F,q,D,U,z,K,H,V=(R=l(function(t){return t.unshift(/^/),(e=RegExp(t.map(c("source")).join(""))).exec.bind(e);var e}),L=R(O=/(\$?)/,/([\w-_]+|\*)/,N=/(?:{([\w ]*?)})?/),F=R(O,/\["([^"]+)"\]/,N),q=R(O,/\[(\d+|\*)\]/,N),D=R(O,/()/,/{([\w ]*?)}/),U=R(/\.\./),z=R(/\./),K=R(O,/!/),H=R(/$/),function(t){return t(h(L,F,q,D),U,z,K,H)});function W(t,e){return{key:t,node:e}}var X=c("key"),G=c("node"),J={};function Z(t){var e=t(tt).emit,r=t(et).emit,n=t(at).emit,o=t(ot).emit;function a(t,e,r){G(k(t))[e]=r}function s(t,r,n){t&&a(t,r,n);var i=M(W(r,n),t);return e(i),i}var u={};return u[dt]=function(t,e){if(!t)return n(e),s(t,J,e);var r,o,u,f=(o=e,u=G(k(r=t)),y(i,u)?s(r,v(u),o):r),c=S(f),h=X(k(f));return a(c,h,e),M(W(h,e),c)},u[lt]=function(t){return r(t),S(t)||o(G(k(t)))},u[ht]=s,u}var $=V(function(t,e,r,n,i){var a=1,s=2,c=3,d=f(X,k),l=f(G,k);function b(t,e){return!!e[a]?p(t,k):t}function y(t){if(t==m)return m;return p(function(t){return d(t)!=J},f(t,S))}function g(){return function(t){return d(t)==J}}function w(t,e,r,n,i){var o,a=t(r);if(a){var s=(o=a,B(function(t,e){return e(t,o)},n,e));return i(r.substr(v(a[0])),s)}}function M(t,e){return u(w,t,e)}var x=h(M(t,A(b,function(t,e){var r=e[c];return r?p(f(u(_,E(r.split(/\W+/))),l),t):t},function(t,e){var r=e[s];return p(r&&"*"!=r?function(t){return d(t)==r}:m,t)},y)),M(e,A(function(t){if(t==m)return m;var e=g(),r=t,n=y(function(t){return i(t)}),i=h(e,r,n);return i})),M(r,A()),M(n,A(b,g)),M(i,A(function(t){return function(e){var r=t(e);return!0===r?k(e):r}})),function(t){throw o('"'+t+'" could not be tokenised')});function j(t,e){return e}function I(t,e){return x(t,e,t?I:j)}return function(t){try{return I(t,m)}catch(e){throw o('Could not compile "'+t+'" because '+e.message)}}});function Y(t,e,r){var n,i;function o(t){return function(e){return e.id==t}}return{on:function(r,o){var a={listener:r,id:o||r};return e&&e.emit(t,r,a.id),n=M(a,n),i=M(r,i),this},emit:function(){!function t(e,r){e&&(k(e).apply(null,r),t(S(e),r))}(i,arguments)},un:function(e){var a;n=T(n,o(e),function(t){a=t}),a&&(i=T(i,function(t){return t==a.listener}),r&&r.emit(t,a.listener,a.id))},listeners:function(){return i},hasListener:function(t){return w(function t(e,r){return r&&(e(k(r))?k(r):t(e,S(r)))}(t?o(t):m,n))}}}var Q=1,tt=Q++,et=Q++,rt=Q++,nt=Q++,it="fail",ot=Q++,at=Q++,st="start",ut="data",ft="end",ct=Q++,ht=Q++,dt=Q++,lt=Q++;function pt(t,e,r){try{var n=a.parse(e)}catch(t){}return{statusCode:t,body:e,jsonBody:n,thrown:r}}function bt(t,e){var r={node:t(et),path:t(tt)};function n(e,r,n){var i=t(e).emit;r.on(function(t){var e,r,o,a=n(t);!1!==a&&(e=i,r=G(a),o=C(t),e(r,j(S(I(X,o))),j(I(G,o))))},e),t("removeListener").on(function(n){n==e&&(t(n).listeners()||r.un(e))})}t("newListener").on(function(t){var i=/(node|path):(.*)/.exec(t);if(i){var o=r[i[1]];o.hasListener(t)||n(t,o,e(i[2]))}})}function mt(t,e){var r,n=/^(node|path):./,i=t(ot),o=t(nt).emit,a=t(rt).emit,s=l(function(e,i){if(r[e])d(i,r[e]);else{var o=t(e),a=i[0];n.test(e)?f(o,a):o.on(a)}return r});function f(t,e,n){n=n||e;var i=c(e);return t.on(function(){var e=!1;r.forget=function(){e=!0},d(arguments,i),delete r.forget,e&&t.un(n)},n),r}function c(t){return function(){try{return t.apply(r,arguments)}catch(t){setTimeout(function(){throw t})}}}function h(e,r,n){var i,s;"node"==e?(s=n,i=function(){var t=s.apply(this,arguments);w(t)&&(t==gt.drop?o():a(t))}):i=n,f(t(e+":"+r),i,n)}function p(t,e,n){return g(e)?h(t,e,n):function(t,e){for(var r in e)h(t,r,e[r])}(t,e),r}return t(at).on(function(t){var e;r.root=(e=t,function(){return e})}),t(st).on(function(t,e){r.header=function(t){return t?e[t]:e}}),r={on:s,addListener:s,removeListener:function(e,n,o){if("done"==e)i.un(n);else if("node"==e||"path"==e)t.un(e+":"+n,o);else{var a=n;t(e).un(a)}return r},emit:t.emit,node:u(p,"node"),path:u(p,"path"),done:u(f,i),start:u(function(e,n){return t(e).on(c(n),n),r},st),fail:t(it).on,abort:t(ct).emit,header:b,root:b,source:e}}function yt(e,r,n,i,o){var a=function(){var t={},e=n("newListener"),r=n("removeListener");function n(n){return t[n]=Y(n,e,r)}function i(e){return t[e]||n(e)}return["emit","on","un"].forEach(function(t){i[t]=l(function(e,r){d(r,i(e)[t])})}),i}();return r&&function(e,r,n,i,o,a,f){var c,h=e(ut).emit,d=e(it).emit,l=0,p=!0;function b(){var t=r.responseText,e=t.substr(l);e&&h(e),l=v(t)}e(ct).on(function(){r.onreadystatechange=null,r.abort()}),"onprogress"in r&&(r.onprogress=b),r.onreadystatechange=function(){function t(){try{p&&e(st).emit(r.status,(t=r.getAllResponseHeaders(),n={},t&&t.split("\r\n").forEach(function(t){var e=t.indexOf(": ");n[t.substring(0,e)]=t.substring(e+2)}),n)),p=!1}catch(t){}var t,n}switch(r.readyState){case 2:case 3:return t();case 4:t(),2==String(r.status)[0]?(b(),e(ft).emit()):d(pt(r.status,r.responseText))}};try{for(var m in r.open(n,i,!0),a)r.setRequestHeader(m,a[m]);(function(t,e){function r(e){return e.port||{"http:":80,"https:":443}[e.protocol||t.protocol]}return!!(e.protocol&&e.protocol!=t.protocol||e.host&&e.host!=t.host||e.host&&r(e)!=r(t))})(t.location,{protocol:(c=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(i)||[])[1]||"",host:c[2]||"",port:c[3]||""})||r.setRequestHeader("X-Requested-With","XMLHttpRequest"),r.withCredentials=f,r.send(o)}catch(e){t.setTimeout(u(d,pt(s,s,e)),0)}}(a,new XMLHttpRequest,e,r,n,i,o),P(a),function(t,e){var r,n={};function i(t){return function(e){r=t(r,e)}}for(var o in e)t(o).on(i(e[o]),n);t(rt).on(function(t){var e=k(r),n=X(e),i=S(r);i&&(G(k(i))[n]=t)}),t(nt).on(function(){var t=k(r),e=X(t),n=S(r);n&&delete G(k(n))[e]}),t(ct).on(function(){for(var r in e)t(r).un(n)})}(a,Z(a)),bt(a,$),mt(a,r)}function vt(t,e,r,n,i,o,s){return i=i?a.parse(a.stringify(i)):{},n?g(n)||(n=a.stringify(n),i["Content-Type"]=i["Content-Type"]||"application/json"):n=null,t(r||"GET",(u=e,!1===s&&(-1==u.indexOf("?")?u+="?":u+="&",u+="_="+(new Date).getTime()),u),n,i,o||!1);var u}function gt(t){var e=A("resume","pause","pipe"),r=u(_,e);return t?r(t)||g(t)?vt(yt,t):vt(yt,t.url,t.method,t.body,t.headers,t.withCredentials,t.cached):yt()}gt.drop=function(){return gt.drop},"function"==typeof define&&define.amd?define("oboe",[],function(){return gt}):"object"===(void 0===r?"undefined":_typeof(r))?e.exports=gt:t.oboe=gt}(function(){try{return window}catch(t){return self}}(),Object,Array,Error,JSON)},{}],377:[function(t,e,r){arguments[4][178][0].apply(r,arguments)},{dup:178}],378:[function(t,e,r){var n=t("underscore"),i=t("web3-core-helpers").errors,o=t("oboe"),a=function(t,e){var r=this;this.responseCallbacks={},this.notificationCallbacks=[],this.path=t,this.connection=e.connect({path:this.path}),this.addDefaultEvents();var i=function(t){var e=null;n.isArray(t)?t.forEach(function(t){r.responseCallbacks[t.id]&&(e=t.id)}):e=t.id,e||-1===t.method.indexOf("_subscription")?r.responseCallbacks[e]&&(r.responseCallbacks[e](null,t),delete r.responseCallbacks[e]):r.notificationCallbacks.forEach(function(e){n.isFunction(e)&&e(t)})};"Socket"===e.constructor.name?o(this.connection).done(i):this.connection.on("data",function(t){r._parseResponse(t.toString()).forEach(i)})};a.prototype.addDefaultEvents=function(){var t=this;this.connection.on("connect",function(){}),this.connection.on("error",function(){t._timeout()}),this.connection.on("end",function(){t._timeout()}),this.connection.on("timeout",function(){t._timeout()})},a.prototype._parseResponse=function(t){var e=this,r=[];return t.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach(function(t){e.lastChunk&&(t=e.lastChunk+t);var n=null;try{n=JSON.parse(t)}catch(r){return e.lastChunk=t,clearTimeout(e.lastChunkTimeout),void(e.lastChunkTimeout=setTimeout(function(){throw e._timeout(),i.InvalidResponse(t)},15e3))}clearTimeout(e.lastChunkTimeout),e.lastChunk=null,n&&r.push(n)}),r},a.prototype._addResponseCallback=function(t,e){var r=t.id||t[0].id,n=t.method||t[0].method;this.responseCallbacks[r]=e,this.responseCallbacks[r].method=n},a.prototype._timeout=function(){for(var t in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(t)&&(this.responseCallbacks[t](i.InvalidConnection("on IPC")),delete this.responseCallbacks[t])},a.prototype.reconnect=function(){this.connection.connect({path:this.path})},a.prototype.send=function(t,e){this.connection.writable||this.connection.connect({path:this.path}),this.connection.write(JSON.stringify(t)),this._addResponseCallback(t,e)},a.prototype.on=function(t,e){if("function"!=typeof e)throw new Error("The second parameter callback must be a function.");switch(t){case"data":this.notificationCallbacks.push(e);break;default:this.connection.on(t,e)}},a.prototype.once=function(t,e){if("function"!=typeof e)throw new Error("The second parameter callback must be a function.");this.connection.once(t,e)},a.prototype.removeListener=function(t,e){var r=this;switch(t){case"data":this.notificationCallbacks.forEach(function(t,n){t===e&&r.notificationCallbacks.splice(n,1)});break;default:this.connection.removeListener(t,e)}},a.prototype.removeAllListeners=function(t){switch(t){case"data":this.notificationCallbacks=[];break;default:this.connection.removeAllListeners(t)}},a.prototype.reset=function(){this._timeout(),this.notificationCallbacks=[],this.connection.removeAllListeners("error"),this.connection.removeAllListeners("end"),this.connection.removeAllListeners("timeout"),this.addDefaultEvents()},e.exports=a},{oboe:376,underscore:377,"web3-core-helpers":191}],379:[function(t,e,r){arguments[4][178][0].apply(r,arguments)},{dup:178}],380:[function(t,e,r){(function(r){var n=t("underscore"),i=t("web3-core-helpers").errors,o=null,a=null,s=null;"undefined"!=typeof window?(o=window.WebSocket,a=btoa,s=function(t){return new URL(t)}):(o=t("websocket").w3cwebsocket,a=function(t){return r(t).toString("base64")},s=t("url").parse);var u=function(t,e){var r=this;this.responseCallbacks={},this.notificationCallbacks=[],e=e||{},this._customTimeout=e.timeout;var i=s(t),u=e.headers||{};i.username&&i.password&&(u.authorization="Basic "+a(i.username+":"+i.password)),this.connection=new o(t,void 0,void 0,u),this.addDefaultEvents(),this.connection.onmessage=function(t){var e="string"==typeof t.data?t.data:"";r._parseResponse(e).forEach(function(t){var e=null;n.isArray(t)?t.forEach(function(t){r.responseCallbacks[t.id]&&(e=t.id)}):e=t.id,e||-1===t.method.indexOf("_subscription")?r.responseCallbacks[e]&&(r.responseCallbacks[e](null,t),delete r.responseCallbacks[e]):r.notificationCallbacks.forEach(function(e){n.isFunction(e)&&e(t)})})}};u.prototype.addDefaultEvents=function(){var t=this;this.connection.onerror=function(){t._timeout()},this.connection.onclose=function(){t._timeout(),t.reset()}},u.prototype._parseResponse=function(t){var e=this,r=[];return t.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach(function(t){e.lastChunk&&(t=e.lastChunk+t);var n=null;try{n=JSON.parse(t)}catch(r){return e.lastChunk=t,clearTimeout(e.lastChunkTimeout),void(e.lastChunkTimeout=setTimeout(function(){throw e._timeout(),i.InvalidResponse(t)},15e3))}clearTimeout(e.lastChunkTimeout),e.lastChunk=null,n&&r.push(n)}),r},u.prototype._addResponseCallback=function(t,e){var r=t.id||t[0].id,n=t.method||t[0].method;this.responseCallbacks[r]=e,this.responseCallbacks[r].method=n;var o=this;this._customTimeout&&setTimeout(function(){o.responseCallbacks[r]&&(o.responseCallbacks[r](i.ConnectionTimeout(o._customTimeout)),delete o.responseCallbacks[r])},this._customTimeout)},u.prototype._timeout=function(){for(var t in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(t)&&(this.responseCallbacks[t](i.InvalidConnection("on WS")),delete this.responseCallbacks[t])},u.prototype.send=function(t,e){var r=this;if(this.connection.readyState!==this.connection.CONNECTING){if(this.connection.readyState!==this.connection.OPEN)return console.error("connection not open on send()"),"function"==typeof this.connection.onerror?this.connection.onerror(new Error("connection not open")):console.error("no error callback"),void e(new Error("connection not open"));this.connection.send(JSON.stringify(t)),this._addResponseCallback(t,e)}else setTimeout(function(){r.send(t,e)},10)},u.prototype.on=function(t,e){if("function"!=typeof e)throw new Error("The second parameter callback must be a function.");switch(t){case"data":this.notificationCallbacks.push(e);break;case"connect":this.connection.onopen=e;break;case"end":this.connection.onclose=e;break;case"error":this.connection.onerror=e}},u.prototype.removeListener=function(t,e){var r=this;switch(t){case"data":this.notificationCallbacks.forEach(function(t,n){t===e&&r.notificationCallbacks.splice(n,1)})}},u.prototype.removeAllListeners=function(t){switch(t){case"data":this.notificationCallbacks=[];break;case"connect":this.connection.onopen=null;break;case"end":this.connection.onclose=null;break;case"error":this.connection.onerror=null}},u.prototype.reset=function(){this._timeout(),this.notificationCallbacks=[],this.addDefaultEvents()},e.exports=u}).call(this,t("buffer").Buffer)},{buffer:47,underscore:379,url:158,"web3-core-helpers":191,websocket:45}],381:[function(t,e,r){var n=t("web3-core"),i=t("web3-core-subscriptions").subscriptions,o=t("web3-core-method"),a=t("web3-net"),s=function(){var t=this;n.packageInit(this,arguments);var e=this.setProvider;this.setProvider=function(){e.apply(t,arguments),t.net.setProvider.apply(t,arguments)},this.clearSubscriptions=t._requestManager.clearSubscriptions,this.net=new a(this.currentProvider),[new i({name:"subscribe",type:"shh",subscriptions:{messages:{params:1}}}),new o({name:"getVersion",call:"shh_version",params:0}),new o({name:"getInfo",call:"shh_info",params:0}),new o({name:"setMaxMessageSize",call:"shh_setMaxMessageSize",params:1}),new o({name:"setMinPoW",call:"shh_setMinPoW",params:1}),new o({name:"markTrustedPeer",call:"shh_markTrustedPeer",params:1}),new o({name:"newKeyPair",call:"shh_newKeyPair",params:0}),new o({name:"addPrivateKey",call:"shh_addPrivateKey",params:1}),new o({name:"deleteKeyPair",call:"shh_deleteKeyPair",params:1}),new o({name:"hasKeyPair",call:"shh_hasKeyPair",params:1}),new o({name:"getPublicKey",call:"shh_getPublicKey",params:1}),new o({name:"getPrivateKey",call:"shh_getPrivateKey",params:1}),new o({name:"newSymKey",call:"shh_newSymKey",params:0}),new o({name:"addSymKey",call:"shh_addSymKey",params:1}),new o({name:"generateSymKeyFromPassword",call:"shh_generateSymKeyFromPassword",params:1}),new o({name:"hasSymKey",call:"shh_hasSymKey",params:1}),new o({name:"getSymKey",call:"shh_getSymKey",params:1}),new o({name:"deleteSymKey",call:"shh_deleteSymKey",params:1}),new o({name:"newMessageFilter",call:"shh_newMessageFilter",params:1}),new o({name:"getFilterMessages",call:"shh_getFilterMessages",params:1}),new o({name:"deleteMessageFilter",call:"shh_deleteMessageFilter",params:1}),new o({name:"post",call:"shh_post",params:1,inputFormatter:[null]})].forEach(function(e){e.attachToObject(t),e.setRequestManager(t._requestManager)})};n.addProviders(s),e.exports=s},{"web3-core":209,"web3-core-method":193,"web3-core-subscriptions":206,"web3-net":373}],382:[function(t,e,r){arguments[4][210][0].apply(r,arguments)},{dup:210}],383:[function(t,e,r){arguments[4][165][0].apply(r,arguments)},{dup:165}],384:[function(t,e,r){var n=t("bn.js"),i=t("number-to-bn"),o=new n(0),a=new n(-1),s={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};function u(t){var e=t?t.toLowerCase():"ether",r=s[e];if("string"!=typeof r)throw new Error("[ethjs-unit] the unit provided "+t+" doesn't exists, please use the one of the following units "+JSON.stringify(s,null,2));return new n(r,10)}function f(t){if("string"==typeof t){if(!t.match(/^-?[0-9.]+$/))throw new Error("while converting number to string, invalid number value '"+t+"', should be a number matching (^-?[0-9.]+).");return t}if("number"==typeof t)return String(t);if("object"===(void 0===t?"undefined":_typeof(t))&&t.toString&&(t.toTwos||t.dividedToIntegerBy))return t.toPrecision?String(t.toPrecision()):t.toString(10);throw new Error("while converting number to string, invalid number value '"+t+"' type "+(void 0===t?"undefined":_typeof(t))+".")}e.exports={unitMap:s,numberToString:f,getValueOfUnit:u,fromWei:function(t,e,r){var n=i(t),f=n.lt(o),c=u(e),h=s[e].length-1||1,d=r||{};f&&(n=n.mul(a));for(var l=n.mod(c).toString(10);l.length2)throw new Error("[ethjs-unit] while converting number "+t+" to wei, too many decimal points");var d=h[0],l=h[1];if(d||(d="0"),l||(l="0"),l.length>o)throw new Error("[ethjs-unit] while converting number "+t+" to wei, too many decimal places");for(;l.length65536){if(!i)throw new Error("Requested too many random bytes.");r(new Error("Requested too many random bytes."))}if(void 0!==n&&n.randomBytes){if(!i)return"0x"+n.randomBytes(e).toString("hex");n.randomBytes(e,function(t,e){t?r(u):r(null,"0x"+e.toString("hex"))})}else{var o;if(void 0!==n?o=n:"undefined"!=typeof msCrypto&&(o=msCrypto),o&&o.getRandomValues){var a=o.getRandomValues(new Uint8Array(e)),s="0x"+Array.from(a).map(function(t){return t.toString(16)}).join("");if(!i)return s;r(null,s)}else{var u=new Error('No "crypto" object available. This Browser doesn\'t support generating secure random bytes.');if(!i)throw u;r(u)}}}},{"./crypto.js":388}],390:[function(t,e,r){var n=t("is-hex-prefixed");e.exports=function(t){return"string"!=typeof t?t:n(t)?t.slice(2):t}},{"is-hex-prefixed":385}],391:[function(t,e,r){arguments[4][178][0].apply(r,arguments)},{dup:178}],392:[function(t,e,r){(function(t){!function(n){var i="object"==(void 0===r?"undefined":_typeof(r))&&r,o="object"==(void 0===e?"undefined":_typeof(e))&&e&&e.exports==i&&e,a="object"==(void 0===t?"undefined":_typeof(t))&&t;a.global!==a&&a.window!==a||(n=a);var s,u,f,c=String.fromCharCode;function h(t){for(var e,r,n=[],i=0,o=t.length;i=55296&&e<=56319&&i=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function l(t,e){return c(t>>e&63|128)}function p(t){if(0==(4294967168&t))return c(t);var e="";return 0==(4294965248&t)?e=c(t>>6&31|192):0==(4294901760&t)?(d(t),e=c(t>>12&15|224),e+=l(t,6)):0==(4292870144&t)&&(e=c(t>>18&7|240),e+=l(t,12),e+=l(t,6)),e+=c(63&t|128)}function b(){if(f>=u)throw Error("Invalid byte index");var t=255&s[f];if(f++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function m(){var t,e;if(f>u)throw Error("Invalid byte index");if(f==u)return!1;if(t=255&s[f],f++,0==(128&t))return t;if(192==(224&t)){if((e=(31&t)<<6|b())>=128)return e;throw Error("Invalid continuation byte")}if(224==(240&t)){if((e=(15&t)<<12|b()<<6|b())>=2048)return d(e),e;throw Error("Invalid continuation byte")}if(240==(248&t)&&(e=(15&t)<<18|b()<<12|b()<<6|b())>=65536&&e<=1114111)return e;throw Error("Invalid UTF-8 detected")}var y={version:"2.0.0",encode:function(t){for(var e=h(t),r=e.length,n=-1,i="";++n65535&&(i+=c((e-=65536)>>>10&1023|55296),e=56320|1023&e),i+=c(e);return i}(r)}};if("function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define(function(){return y});else if(i&&!i.nodeType)if(o)o.exports=y;else{var v={}.hasOwnProperty;for(var g in y)v.call(y,g)&&(i[g]=y[g])}else n.utf8=y}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],393:[function(t,e,r){var n=t("underscore"),i=t("ethjs-unit"),o=t("./utils.js"),a=t("./soliditySha3.js"),s=t("randomhex"),u=function(t){if(!o.isHexStrict(t))throw new Error("The parameter must be a valid HEX string.");var e="",r=0,n=t.length;for("0x"===t.substring(0,2)&&(r=2);r7?r+=t[n].toUpperCase():r+=t[n];return r},toHex:o.toHex,toBN:o.toBN,bytesToHex:o.bytesToHex,hexToBytes:o.hexToBytes,hexToNumberString:o.hexToNumberString,hexToNumber:o.hexToNumber,toDecimal:o.hexToNumber,numberToHex:o.numberToHex,fromDecimal:o.numberToHex,hexToUtf8:o.hexToUtf8,hexToString:o.hexToUtf8,toUtf8:o.hexToUtf8,utf8ToHex:o.utf8ToHex,stringToHex:o.utf8ToHex,fromUtf8:o.utf8ToHex,hexToAscii:u,toAscii:u,asciiToHex:f,fromAscii:f,unitMap:i.unitMap,toWei:function(t,e){if(e=c(e),!o.isBN(t)&&!n.isString(t))throw new Error("Please pass numbers as strings or BigNumber objects to avoid precision errors.");return o.isBN(t)?i.toWei(t,e):i.toWei(t,e).toString(10)},fromWei:function(t,e){if(e=c(e),!o.isBN(t)&&!n.isString(t))throw new Error("Please pass numbers as strings or BigNumber objects to avoid precision errors.");return o.isBN(t)?i.fromWei(t,e):i.fromWei(t,e).toString(10)},padLeft:o.leftPad,leftPad:o.leftPad,padRight:o.rightPad,rightPad:o.rightPad,toTwosComplement:o.toTwosComplement}},{"./soliditySha3.js":394,"./utils.js":395,"ethjs-unit":384,randomhex:389,underscore:391}],394:[function(t,e,r){var n=t("underscore"),i=t("bn.js"),o=t("./utils.js"),a=function(t){var e=void 0===t?"undefined":_typeof(t);if("string"===e)return o.isHexStrict(t)?new i(t.replace(/0x/i,""),16):new i(t,10);if("number"===e)return new i(t);if(o.isBigNumber(t))return new i(t.toString(10));if(o.isBN(t))return t;throw new Error(t+" is not a number")},s=function(t,e,r){var n,s,u,f;if("bytes"===(t=(u=t).startsWith("int[")?"int256"+u.slice(3):"int"===u?"int256":u.startsWith("uint[")?"uint256"+u.slice(4):"uint"===u?"uint256":u.startsWith("fixed[")?"fixed128x128"+u.slice(5):"fixed"===u?"fixed128x128":u.startsWith("ufixed[")?"ufixed128x128"+u.slice(6):"ufixed"===u?"ufixed128x128":u)){if(e.replace(/^0x/i,"").length%2!=0)throw new Error("Invalid bytes characters "+e.length);return e}if("string"===t)return o.utf8ToHex(e);if("bool"===t)return e?"01":"00";if(t.startsWith("address")){if(n=r?64:40,!o.isAddress(e))throw new Error(e+" is not a valid address, or the checksum is invalid.");return o.leftPad(e.toLowerCase(),n)}if(n=(f=/^\D+(\d+).*$/.exec(t))?parseInt(f[1],10):null,t.startsWith("bytes")){if(!n)throw new Error("bytes[] not yet supported in solidity");if(r&&(n=32),n<1||n>32||n256)throw new Error("Invalid uint"+n+" size");if((s=a(e)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+s.bitLength());if(s.lt(new i(0)))throw new Error("Supplied uint "+s.toString()+" is negative");return n?o.leftPad(s.toString("hex"),n/8*2):s}if(t.startsWith("int")){if(n%8||n<8||n>256)throw new Error("Invalid int"+n+" size");if((s=a(e)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+s.bitLength());return s.lt(new i(0))?s.toTwos(n).toString("hex"):n?o.leftPad(s.toString("hex"),n/8*2):s}throw new Error("Unsupported or invalid type: "+t)},u=function(t){if(n.isArray(t))throw new Error("Autodetection of array types is not supported.");var e,r,a,u="";if(n.isObject(t)&&(t.hasOwnProperty("v")||t.hasOwnProperty("t")||t.hasOwnProperty("value")||t.hasOwnProperty("type"))?(e=t.hasOwnProperty("t")?t.t:t.type,u=t.hasOwnProperty("v")?t.v:t.value):(e=o.toHex(t,!0),u=o.toHex(t),e.startsWith("int")||e.startsWith("uint")||(e="bytes")),!e.startsWith("int")&&!e.startsWith("uint")||"string"!=typeof u||/^(-)?0x/i.test(u)||(u=new i(u)),n.isArray(u)){if(a=/^\D+\d*\[(\d+)\]$/.exec(e),(r=a?parseInt(a[1],10):null)&&u.length!==r)throw new Error(e+" is not matching the given array "+JSON.stringify(u));r=u.length}return n.isArray(u)?u.map(function(t){return s(e,t,r).toString("hex").replace("0x","")}).join(""):s(e,u,r).toString("hex").replace("0x","")};e.exports=function(){var t=Array.prototype.slice.call(arguments),e=n.map(t,u);return o.sha3("0x"+e.join(""))}},{"./utils.js":395,"bn.js":382,underscore:391}],395:[function(t,e,r){var n=t("underscore"),i=t("bn.js"),o=t("number-to-bn"),a=t("utf8"),s=t("eth-lib/lib/hash"),u=function(t){return t instanceof i||t&&t.constructor&&"BN"===t.constructor.name},f=function(t){return t&&t.constructor&&"BigNumber"===t.constructor.name},c=function(t){try{return o.apply(null,arguments)}catch(e){throw new Error(e+' Given value: "'+t+'"')}},h=function(t){return!!/^(0x)?[0-9a-f]{40}$/i.test(t)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(t)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(t))||d(t))},d=function(t){t=t.replace(/^0x/i,"");for(var e=y(t.toLowerCase()).replace(/^0x/i,""),r=0;r<40;r++)if(parseInt(e[r],16)>7&&t[r].toUpperCase()!==t[r]||parseInt(e[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},l=function(t){var e="";t=(t=(t=(t=(t=a.encode(t)).replace(/^(?:\u0000)*/,"")).split("").reverse().join("")).replace(/^(?:\u0000)*/,"")).split("").reverse().join("");for(var r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x"+e.join("")},isHex:function(t){return(n.isString(t)||n.isNumber(t))&&/^(-0x|0x)?[0-9a-f]*$/i.test(t)},isHexStrict:m,leftPad:function(t,e,r){var n=/^0x/i.test(t)||"number"==typeof t,i=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(i).join(r||"0")+t},rightPad:function(t,e,r){var n=/^0x/i.test(t)||"number"==typeof t,i=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(i).join(r||"0")},toTwosComplement:function(t){return"0x"+c(t).toTwos(256).toString(16,64)},sha3:y}},{"bn.js":382,"eth-lib/lib/hash":383,"number-to-bn":386,underscore:391,utf8:392}],396:[function(t,e,r){e.exports={name:"web3",namespace:"ethereum",version:"1.0.0-beta.34",description:"Ethereum JavaScript API",repository:"https://github.com/ethereum/web3.js/tree/master/packages/web3",license:"LGPL-3.0",main:"src/index.js",types:"index.d.ts",bugs:{url:"https://github.com/ethereum/web3.js/issues"},keywords:["Ethereum","JavaScript","API"],author:"ethereum.org",authors:[{name:"Fabian Vogelsteller",email:"fabian@ethereum.org",homepage:"http://frozeman.de"},{name:"Marek Kotewicz",email:"marek@parity.io",url:"https://github.com/debris"},{name:"Marian Oancea",url:"https://github.com/cubedro"},{name:"Gav Wood",email:"g@parity.io",homepage:"http://gavwood.com"},{name:"Jeffery Wilcke",email:"jeffrey.wilcke@ethereum.org",url:"https://github.com/obscuren"}],dependencies:{"web3-bzz":"1.0.0-beta.34","web3-core":"1.0.0-beta.34","web3-eth":"1.0.0-beta.34","web3-eth-personal":"1.0.0-beta.34","web3-net":"1.0.0-beta.34","web3-shh":"1.0.0-beta.34","web3-utils":"1.0.0-beta.34"}}},{}],BN:[function(t,e,r){arguments[4][240][0].apply(r,arguments)},{buffer:17,dup:240}],Web3:[function(t,e,r){var n=t("../package.json").version,i=t("web3-core"),o=t("web3-eth"),a=t("web3-net"),s=t("web3-eth-personal"),u=t("web3-shh"),f=t("web3-bzz"),c=t("web3-utils"),h=function(){var t=this;i.packageInit(this,arguments),this.version=n,this.utils=c,this.eth=new o(this),this.shh=new u(this),this.bzz=new f(this);var e=this.setProvider;this.setProvider=function(r,n){return e.apply(t,arguments),this.eth.setProvider(r,n),this.shh.setProvider(r,n),this.bzz.setProvider(r),!0}};h.version=n,h.utils=c,h.modules={Eth:o,Net:a,Personal:s,Shh:u,Bzz:f},i.addProviders(h),e.exports=h},{"../package.json":396,"web3-bzz":187,"web3-core":209,"web3-eth":372,"web3-eth-personal":369,"web3-net":373,"web3-shh":381,"web3-utils":393}]},{},["Web3"])("Web3")}); \ No newline at end of file +"use strict";var _typeof2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof2(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof2(t)};!function(t){if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Web3=t()}}(function(){var define,module,exports;return function(){return function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var c=r[a]={exports:{}};e[a][0].call(c.exports,function(t){var r=e[a][1][t];return i(r||t)},c,c.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a>6],i=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function h(t,e,r){var n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(0==(128&n))return n;var i=127&n;if(i>4)return t.error("length octect is too long");n=0;for(var o=0;o=31)return n.error("Multi-octet tag encoding unsupported");e||(i|=32);return i|=s.tagClassByName[r||"universal"]<<6}(t,e,r,this.reporter);if(n.length<128)return(o=new i(2))[0]=a,o[1]=n.length,this._createEncoderBuffer([o,n]);for(var u=1,f=n.length;f>=256;f>>=8)u++;(o=new i(2+u))[0]=a,o[1]=128|u;f=1+u;for(var c=n.length;c>0;f--,c>>=8)o[f]=255&c;return this._createEncoderBuffer([o,n])},f.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=new i(2*t.length),n=0;n=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}var o=0;for(n=0;n=128;a>>=7)o++}var s=new i(o),u=s.length-1;for(n=t.length-1;n>=0;n--){a=t[n];for(s[u--]=127&a;(a>>=7)>0;)s[u--]=128|127&a}return this._createEncoderBuffer(s)},f.prototype._encodeTime=function(t,e){var r,n=new Date(t);return"gentime"===e?r=[c(n.getFullYear()),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[c(n.getFullYear()%100),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},f.prototype._encodeNull=function(){return this._createEncoderBuffer("")},f.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!i.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=new i(r)}if(i.isBuffer(t)){var n=t.length;0===t.length&&n++;var o=new i(n);return t.copy(o),0===t.length&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);n=1;for(var a=t;a>=256;a>>=8)n++;for(a=(o=new Array(n)).length-1;a>=0;a--)o[a]=255&t,t>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new i(o))},f.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},f.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},f.prototype._skipDefault=function(t,e,r){var n,i=this._baseState;if(null===i.default)return!1;var o=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,e,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n0?u-4:u;var c=0;for(e=0;e>16&255,s[c++]=n>>8&255,s[c++]=255&n;2===a?(n=i[t.charCodeAt(e)]<<2|i[t.charCodeAt(e+1)]>>4,s[c++]=255&n):1===a&&(n=i[t.charCodeAt(e)]<<10|i[t.charCodeAt(e+1)]<<4|i[t.charCodeAt(e+2)]>>2,s[c++]=n>>8&255,s[c++]=255&n);return s},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o="",a=[],s=0,u=r-i;su?u:s+16383));1===i?(e=t[r-1],o+=n[e>>2],o+=n[e<<4&63],o+="=="):2===i&&(e=(t[r-2]<<8)+t[r-1],o+=n[e>>10],o+=n[e>>4&63],o+=n[e<<2&63],o+="=");return a.push(o),a.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function c(t,e,r){for(var i,o,a=[],s=e;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],16:[function(t,e,r){var n;function i(t){this.rand=t}if(e.exports=function(t){return n||(n=new i(null)),n.generate(t)},e.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r>>24]^c[p>>>16&255]^h[b>>>8&255]^d[255&m]^e[y++],a=f[p>>>24]^c[b>>>16&255]^h[m>>>8&255]^d[255&l]^e[y++],s=f[b>>>24]^c[m>>>16&255]^h[l>>>8&255]^d[255&p]^e[y++],u=f[m>>>24]^c[l>>>16&255]^h[p>>>8&255]^d[255&b]^e[y++],l=o,p=a,b=s,m=u;return o=(n[l>>>24]<<24|n[p>>>16&255]<<16|n[b>>>8&255]<<8|n[255&m])^e[y++],a=(n[p>>>24]<<24|n[b>>>16&255]<<16|n[m>>>8&255]<<8|n[255&l])^e[y++],s=(n[b>>>24]<<24|n[m>>>16&255]<<16|n[l>>>8&255]<<8|n[255&p])^e[y++],u=(n[m>>>24]<<24|n[l>>>16&255]<<16|n[p>>>8&255]<<8|n[255&b])^e[y++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var f=s^s<<1^s<<2^s<<3^s<<4;f=f>>>8^255&f^99,r[a]=f,n[f]=a;var c=t[a],h=t[c],d=t[h],l=257*t[f]^16843008*f;i[0][a]=l<<24|l>>>8,i[1][a]=l<<16|l>>>16,i[2][a]=l<<8|l>>>24,i[3][a]=l,l=16843009*d^65537*h^257*c^16843008*a,o[0][f]=l<<24|l>>>8,o[1][f]=l<<16|l>>>16,o[2][f]=l<<8|l>>>24,o[3][f]=l,0===a?a=s=1:(a=c^t[t[t[d^c]]],s^=t[t[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function f(t){this._key=i(t),this._reset()}f.blockSize=16,f.keySize=32,f.prototype.blockSize=f.blockSize,f.prototype.keySize=f.keySize,f.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o>>24,a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a],a^=s[o/e|0]<<24):e>6&&o%e==4&&(a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a]),i[o]=i[o-e]^a}for(var f=[],c=0;c>>24]]^u.INV_SUB_MIX[1][u.SBOX[d>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[d>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&d]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=f},f.prototype.encryptBlockRaw=function(t){return a(t=i(t),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},f.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},f.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=a(t,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},f.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},e.exports.AES=f},{"safe-buffer":147}],19:[function(t,e,r){var n=t("./aes"),i=t("safe-buffer").Buffer,o=t("cipher-base"),a=t("inherits"),s=t("./ghash"),u=t("buffer-xor"),f=t("./incr32");function c(t,e,r,a){o.call(this);var u=i.alloc(4,0);this._cipher=new n.AES(e);var c=this._cipher.encryptBlock(u);this._ghash=new s(c),r=function(t,e,r){if(12===e.length)return t._finID=i.concat([e,i.from([0,0,0,1])]),i.concat([e,i.from([0,0,0,2])]);var n=new s(r),o=e.length,a=o%16;n.update(e),a&&(a=16-a,n.update(i.alloc(a,0))),n.update(i.alloc(8,0));var u=8*o,c=i.alloc(8);c.writeUIntBE(u,0,8),n.update(c),t._finID=n.state;var h=i.from(t._finID);return f(h),h}(this,r,c),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}a(c,o),c.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=i.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},c.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=0;i16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},h.prototype.flush=function(){if(this.cache.length)return this.cache},r.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=f(e,!1,r.key,r.iv);return d(t,n.key,n.iv)},r.createDecipheriv=d},{"./aes":18,"./authCipher":19,"./modes":31,"./streamCipher":34,"cipher-base":48,evp_bytestokey:84,inherits:101,"safe-buffer":147}],22:[function(t,e,r){var n=t("./modes"),i=t("./authCipher"),o=t("safe-buffer").Buffer,a=t("./streamCipher"),s=t("cipher-base"),u=t("./aes"),f=t("evp_bytestokey");function c(t,e,r){s.call(this),this._cache=new d,this._cipher=new u.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}t("inherits")(c,s),c.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return o.concat(n)};var h=o.alloc(16,16);function d(){this.cache=o.allocUnsafe(0)}function l(t,e,r){var s=n[t.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=o.from(e)),e.length!==s.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new a(s.module,e,r):"auth"===s.type?new i(s.module,e,r):new c(s.module,e,r)}c.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(h))throw this._cipher.scrub(),new Error("data not multiple of block length")},c.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},d.prototype.add=function(t){this.cache=o.concat([this.cache,t])},d.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},d.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function a(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}a.prototype.ghash=function(t){for(var e=-1;++e0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},a.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},a.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,t,0,e])),this.state},e.exports=a},{"safe-buffer":147}],24:[function(t,e,r){e.exports=function(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},{}],25:[function(t,e,r){var n=t("buffer-xor");r.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},r.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},{"buffer-xor":46}],26:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("buffer-xor");function o(t,e,r){var o=e.length,a=i(e,t._cache);return t._cache=t._cache.slice(o),t._prev=n.concat([t._prev,r?e:a]),a}r.encrypt=function(t,e,r){for(var i,a=n.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=n.allocUnsafe(0)),!(t._cache.length<=e.length)){a=n.concat([a,o(t,e,r)]);break}i=t._cache.length,a=n.concat([a,o(t,e.slice(0,i),r)]),e=e.slice(i)}return a}},{"buffer-xor":46,"safe-buffer":147}],27:[function(t,e,r){var n=t("safe-buffer").Buffer;function i(t,e,r){for(var n,i,a=-1,s=0;++a<8;)n=e&1<<7-a?128:0,s+=(128&(i=t._cipher.encryptBlock(t._prev)[0]^n))>>a%8,t._prev=o(t._prev,r?n:i);return s}function o(t,e){var r=t.length,i=-1,o=n.allocUnsafe(t.length);for(t=n.concat([t,n.from([e])]);++i>7;return o}r.encrypt=function(t,e,r){for(var o=e.length,a=n.allocUnsafe(o),s=-1;++s=0||!r.umod(t.prime1)||!r.umod(t.prime2);)r=new n(i(e));return r}e.exports=o,o.getr=a}).call(this,t("buffer").Buffer)},{"bn.js":"BN",buffer:47,randombytes:131}],39:[function(t,e,r){e.exports=t("./browser/algorithms.json")},{"./browser/algorithms.json":40}],40:[function(t,e,r){e.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],41:[function(t,e,r){e.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],42:[function(t,e,r){(function(r){var n=t("create-hash"),i=t("stream"),o=t("inherits"),a=t("./sign"),s=t("./verify"),u=t("./algorithms.json");function f(t){i.Writable.call(this);var e=u[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function c(t){i.Writable.call(this);var e=u[t];if(!e)throw new Error("Unknown message digest");this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function h(t){return new f(t)}function d(t){return new c(t)}Object.keys(u).forEach(function(t){u[t].id=new r(u[t].id,"hex"),u[t.toLowerCase()]=u[t]}),o(f,i.Writable),f.prototype._write=function(t,e,r){this._hash.update(t),r()},f.prototype.update=function(t,e){return"string"==typeof t&&(t=new r(t,e)),this._hash.update(t),this},f.prototype.sign=function(t,e){this.end();var r=this._hash.digest(),n=a(r,t,this._hashType,this._signType,this._tag);return e?n.toString(e):n},o(c,i.Writable),c.prototype._write=function(t,e,r){this._hash.update(t),r()},c.prototype.update=function(t,e){return"string"==typeof t&&(t=new r(t,e)),this._hash.update(t),this},c.prototype.verify=function(t,e,n){"string"==typeof e&&(e=new r(e,n)),this.end();var i=this._hash.digest();return s(e,i,t,this._signType,this._tag)},e.exports={Sign:h,Verify:d,createSign:h,createVerify:d}}).call(this,t("buffer").Buffer)},{"./algorithms.json":40,"./sign":43,"./verify":44,buffer:47,"create-hash":51,inherits:101,stream:156}],43:[function(t,e,r){(function(r){var n=t("create-hmac"),i=t("browserify-rsa"),o=t("elliptic").ec,a=t("bn.js"),s=t("parse-asn1"),u=t("./curves.json");function f(t,e,i,o){if((t=new r(t.toArray())).length0&&r.ishrn(n),r}function h(t,e,i){var o,a;do{for(o=new r(0);8*o.length=e)throw new Error("invalid sig")}e.exports=function(t,e,u,f,c){var h=o(u);if("ec"===h.type){if("ecdsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");return function(t,e,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var o=new i(n),s=r.data.subjectPrivateKey.data;return o.verify(e,t,s)}(t,e,h)}if("dsa"===h.type){if("dsa"!==f)throw new Error("wrong public key type");return function(t,e,r){var i=r.data.p,a=r.data.q,u=r.data.g,f=r.data.pub_key,c=o.signature.decode(t,"der"),h=c.s,d=c.r;s(h,a),s(d,a);var l=n.mont(i),p=h.invm(a);return 0===u.toRed(l).redPow(new n(e).mul(p).mod(a)).fromRed().mul(f.toRed(l).redPow(d.mul(p).mod(a)).fromRed()).mod(i).mod(a).cmp(d)}(t,e,h)}if("rsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");e=r.concat([c,e]);for(var d=h.modulus.byteLength(),l=[1],p=0;e.length+l.length+2o)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(t)}return u(t,e,r)}function u(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return N(t)?function(t,e,r){if(e<0||t.byteLength=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function l(t,e){if(s.isBuffer(t))return t.length;if(L(t)||N(t))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return R(t).length;default:if(n)return P(t).length;e=(""+e).toLowerCase(),n=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),F(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var h=!0,d=0;di&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a239?4:f>223?3:f>191?2:1;if(i+h<=r)switch(h){case 1:f<128&&(c=f);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&f)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&f)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(t){var e=t.length;if(e<=_)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return w(this,e,r);case"ascii":return M(this,e,r);case"latin1":case"binary":return x(this,e,r);case"base64":return g(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},s.prototype.compare=function(t,e,r,n,i){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(o,a),f=this.slice(n,i),c=t.slice(e,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o,a,s,u,f,c,h,d,l,p=!1;;)switch(n){case"hex":return y(this,t,e,r);case"utf8":case"utf-8":return d=e,l=r,O(P(t,(h=this).length-d),h,d,l);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return v(this,t,e,r);case"base64":return u=this,f=e,c=r,O(R(t),u,f,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=e,s=r,O(function(t,e){for(var r,n,i,o=[],a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,(o=this).length-a),o,a,s);default:if(p)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function M(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function A(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function j(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function I(t,e,r,n,o){return e=+e,r>>>=0,o||j(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,o){return e=+e,r>>>=0,o||j(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||E(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||E(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||E(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||E(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||E(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||E(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||E(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||E(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||E(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||E(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||A(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n)||A(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);A(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);A(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function R(t){return n.toByteArray(function(t){if((t=t.trim().replace(T,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function O(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function N(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function L(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function F(t){return t!=t}},{"base64-js":15,ieee754:99}],48:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("stream").Transform,o=t("string_decoder").StringDecoder;function a(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}t("inherits")(a,i),a.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},a.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},a.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},a.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},e.exports=a},{inherits:101,"safe-buffer":147,stream:156,string_decoder:157}],49:[function(t,e,r){(function(t){function e(t){return Object.prototype.toString.call(t)}r.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===e(t)},r.isBoolean=function(t){return"boolean"==typeof t},r.isNull=function(t){return null===t},r.isNullOrUndefined=function(t){return null==t},r.isNumber=function(t){return"number"==typeof t},r.isString=function(t){return"string"==typeof t},r.isSymbol=function(t){return"symbol"===(void 0===t?"undefined":_typeof(t))},r.isUndefined=function(t){return void 0===t},r.isRegExp=function(t){return"[object RegExp]"===e(t)},r.isObject=function(t){return"object"===(void 0===t?"undefined":_typeof(t))&&null!==t},r.isDate=function(t){return"[object Date]"===e(t)},r.isError=function(t){return"[object Error]"===e(t)||t instanceof Error},r.isFunction=function(t){return"function"==typeof t},r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"===(void 0===t?"undefined":_typeof(t))||void 0===t},r.isBuffer=t.isBuffer}).call(this,{isBuffer:t("../../is-buffer/index.js")})},{"../../is-buffer/index.js":102}],50:[function(t,e,r){(function(r){var n=t("elliptic"),i=t("bn.js");e.exports=function(t){return new a(t)};var o={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function a(t){this.curveType=o[t],this.curveType||(this.curveType={name:t}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function s(t,e,n){Array.isArray(t)||(t=t.toArray());var i=new r(t);if(n&&i.length>>2),a=0,s=0;a>5]|=128<>>9<<4)]=e;for(var r=1732584193,n=-271733879,i=-1732584194,o=271733878,h=0;h>>32-s,r);var a,s}function a(t,e,r,n,i,a,s){return o(e&r|~e&n,t,e,i,a,s)}function s(t,e,r,n,i,a,s){return o(e&n|r&~n,t,e,i,a,s)}function u(t,e,r,n,i,a,s){return o(e^r^n,t,e,i,a,s)}function f(t,e,r,n,i,a,s){return o(r^(e|~n),t,e,i,a,s)}function c(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}e.exports=function(t){return n(t,i)}},{"./make-hash":52}],54:[function(t,e,r){var n=t("inherits"),i=t("./legacy"),o=t("cipher-base"),a=t("safe-buffer").Buffer,s=t("create-hash/md5"),u=t("ripemd160"),f=t("sha.js"),c=a.alloc(128);function h(t,e){o.call(this,"digest"),"string"==typeof e&&(e=a.from(e));var r="sha512"===t||"sha384"===t?128:64;(this._alg=t,this._key=e,e.length>r)?e=("rmd160"===t?new u:f(t)).update(e).digest():e.lengths?e=t(e):e.length0;n--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},i.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},i.prototype._pad=function(t,e){if(0===e)return!1;for(;e>>1];r=a.r28shl(r,s),i=a.r28shl(i,s),a.pc2(r,i,t.keys,o)}},u.prototype._update=function(t,e,r,n){var i=this._desState,o=a.readUInt32BE(t,e),s=a.readUInt32BE(t,e+4);a.ip(o,s,i.tmp,0),o=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,o,s,i.tmp,0):this._decrypt(i,o,s,i.tmp,0),o=i.tmp[0],s=i.tmp[1],a.writeUInt32BE(r,o,n),a.writeUInt32BE(r,s,n+4)},u.prototype._pad=function(t,e){for(var r=t.length-e,n=e;n>>0,o=d}a.rip(s,o,n,i)},u.prototype._decrypt=function(t,e,r,n,i){for(var o=r,s=e,u=t.keys.length-2;u>=0;u-=2){var f=t.keys[u],c=t.keys[u+1];a.expand(o,t.tmp,0),f^=t.tmp[0],c^=t.tmp[1];var h=a.substitute(f,c),d=o;o=(s^a.permute(h))>>>0,s=d}a.rip(o,s,n,i)}},{"../des":57,inherits:101,"minimalistic-assert":107}],61:[function(t,e,r){var n=t("minimalistic-assert"),i=t("inherits"),o=t("../des"),a=o.Cipher,s=o.DES;function u(t){a.call(this,t);var e=new function(t,e){n.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),i=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}(this.type,this.options.key);this._edeState=e}i(u,a),e.exports=u,u.create=function(t){return new u(t)},u.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},{"../des":57,inherits:101,"minimalistic-assert":107}],62:[function(t,e,r){r.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},r.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},r.ip=function(t,e,r,n){for(var i=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=t>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1}r[n+0]=i>>>0,r[n+1]=o>>>0},r.rip=function(t,e,r,n){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=e>>>s+a&1,i<<=1,i|=t>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=e>>>s+a&1,o<<=1,o|=t>>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},r.pc1=function(t,e,r,n){for(var i=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},r.r28shl=function(t,e){return t<>>28-e};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(t,e,r,i){for(var o=0,a=0,s=n.length>>>1,u=0;u>>n[u]&1;for(u=s;u>>n[u]&1;r[i+0]=o>>>0,r[i+1]=a>>>0},r.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=t>>>o&63;for(o=11;o>=3;o-=4)i|=t>>>o&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(t,e){for(var r=0,n=0;n<4;n++){r<<=4,r|=i[64*n+(t>>>18-6*n&63)]}for(n=0;n<4;n++){r<<=4,r|=i[256+64*n+(e>>>18-6*n&63)]}return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(t){for(var e=0,r=0;r>>o[r]&1;return e>>>0},r.padSplit=function(t,e,r){for(var n=t.toString(2);n.lengtht;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(u),e.cmp(u)){if(!e.cmp(f))for(;r.mod(c).cmp(h);)r.iadd(l)}else for(;r.mod(o).cmp(d);)r.iadd(l);if(b(p=r.shrn(1))&&b(r)&&m(p)&&m(r)&&a.test(p)&&a.test(r))return r}}},{"bn.js":"BN","miller-rabin":106,randombytes:131}],66:[function(t,e,r){e.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],67:[function(t,e,r){var n=r;n.version=t("../package.json").version,n.utils=t("./elliptic/utils"),n.rand=t("brorand"),n.curve=t("./elliptic/curve"),n.curves=t("./elliptic/curves"),n.ec=t("./elliptic/ec"),n.eddsa=t("./elliptic/eddsa")},{"../package.json":82,"./elliptic/curve":70,"./elliptic/curves":73,"./elliptic/ec":74,"./elliptic/eddsa":77,"./elliptic/utils":81,brorand:16}],68:[function(t,e,r){var n=t("bn.js"),i=t("../../elliptic").utils,o=i.getNAF,a=i.getJSF,s=i.assert;function u(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function f(t,e){this.curve=t,this.type=e,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){s(t.precomputed);var r=t._getDoubles(),n=o(e,1),i=(1<=u;e--)f=(f<<1)+n[e];a.push(f)}for(var c=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(u=0;u=0;f--){for(e=0;f>=0&&0===a[f];f--)e++;if(f>=0&&e++,u=u.dblp(e),f<0)break;var c=a[f];s(0!==c),u="affine"===t.type?c>0?u.mixedAdd(i[c-1>>1]):u.mixedAdd(i[-c-1>>1].neg()):c>0?u.add(i[c-1>>1]):u.add(i[-c-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){for(var s=this._wnafT1,u=this._wnafT2,f=this._wnafT3,c=0,h=0;h=1;h-=2){var l=h-1,p=h;if(1===s[l]&&1===s[p]){var b=[e[l],null,null,e[p]];0===e[l].y.cmp(e[p].y)?(b[1]=e[l].add(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg())):0===e[l].y.cmp(e[p].y.redNeg())?(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].add(e[p].neg())):(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],y=a(r[l],r[p]);c=Math.max(y[0].length,c),f[l]=new Array(c),f[p]=new Array(c);for(var v=0;v=0;h--){for(var x=0;h>=0;){var k=!0;for(v=0;v=0&&x++,_=_.dblp(x),h<0)break;for(v=0;v0?S=u[v][E-1>>1]:E<0&&(S=u[v][-E-1>>1].neg()),_="affine"===S.type?_.mixedAdd(S):_.add(S))}}for(h=0;h=Math.ceil((t.bitLength()+1)/e.step)},f.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i":""},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},c.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),a=o.redSub(r),s=n.redSub(e),u=i.redMul(a),f=o.redMul(s),c=i.redMul(s),h=a.redMul(o);return this.curve.point(u,f,h,c)},c.prototype._projDbl=function(){var t,e,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(f=this.curve._mulA(i)).redAdd(o);if(this.zOne)t=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),e=a.redMul(f.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);t=n.redSub(i).redISub(o).redMul(u),e=a.redMul(f.redSub(o)),r=a.redMul(u)}}else{var f=i.redAdd(o);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),u=f.redSub(s).redSub(s);t=this.curve._mulC(n.redISub(f)).redMul(u),e=this.curve._mulC(f).redMul(i.redISub(o)),r=f.redMul(u)}return this.curve.point(t,e,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(e),f=o.redMul(a),c=s.redMul(u),h=o.redMul(u),d=a.redMul(s);return this.curve.point(f,c,d,h)},c.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),f=i.redAdd(s),c=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),h=n.redMul(u).redMul(c);return this.curve.twisted?(e=n.redMul(f).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(f)):(e=n.redMul(f).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(f)),this.curve.point(h,e,r)},c.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},c.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},c.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},c.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}return!1},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},{"../../elliptic":67,"../curve":70,"bn.js":"BN",inherits:101}],70:[function(t,e,r){var n=r;n.base=t("./base"),n.short=t("./short"),n.mont=t("./mont"),n.edwards=t("./edwards")},{"./base":68,"./edwards":69,"./mont":71,"./short":72}],71:[function(t,e,r){var n=t("../curve"),i=t("bn.js"),o=t("inherits"),a=n.base,s=t("../../elliptic").utils;function u(t){a.call(this,"mont",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function f(t,e,r){a.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(e,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(u,a),e.exports=u,u.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},o(f,a.BasePoint),u.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},u.prototype.point=function(t,e){return new f(this,t,e)},u.prototype.pointFromJSON=function(t){return f.fromJSON(this,t)},f.prototype.precompute=function(){},f.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},f.fromJSON=function(t,e){return new f(t,e[0],e[1]||t.one)},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},f.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},f.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),a=i.redMul(n),s=e.z.redMul(o.redAdd(a).redSqr()),u=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},f.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},f.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},f.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":67,"../curve":70,"bn.js":"BN",inherits:101}],72:[function(t,e,r){var n=t("../curve"),i=t("../../elliptic"),o=t("bn.js"),a=t("inherits"),s=n.base,u=i.utils.assert;function f(t){s.call(this,"short",t),this.a=new o(t.a,16).toRed(this.red),this.b=new o(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(t,e,r,n){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new o(e,16),this.y=new o(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(t,e,r,n){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new o(0)):(this.x=new o(e,16),this.y=new o(r,16),this.z=new o(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(f,s),e.exports=f,f.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new o(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new o(t.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?r=i[0]:(r=i[1],u(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map(function(t){return{a:new o(t.a,16),b:new o(t.b,16)}}):this._getEndoBasis(r)}}},f.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:o.mont(t),r=new o(2).toRed(e).redInvm(),n=r.redNeg(),i=new o(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},f.prototype._getEndoBasis=function(t){for(var e,r,n,i,a,s,u,f,c,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=t,l=this.n.clone(),p=new o(1),b=new o(0),m=new o(0),y=new o(1),v=0;0!==d.cmpn(0);){var g=l.div(d);f=l.sub(g.mul(d)),c=m.sub(g.mul(p));var w=y.sub(g.mul(b));if(!n&&f.cmp(h)<0)e=u.neg(),r=p,n=f.neg(),i=c;else if(n&&2==++v)break;u=f,l=d,d=f,m=p,p=c,y=b,b=w}a=f.neg(),s=c;var _=n.sqr().add(i.sqr());return a.sqr().add(s.sqr()).cmp(_)>=0&&(a=e,s=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:i},{a:a,b:s}]},f.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),f=o.mul(n.b);return{k1:t.sub(a).sub(s),k2:u.add(f).neg()}},f.prototype.pointFromX=function(t,e){(t=new o(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},f.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},f.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(t){return t=new o(t,16),this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},c.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(h,s.BasePoint),f.prototype.jpoint=function(t,e,r){return new h(this,t,e,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),c=f.redMul(s),h=n.redMul(f),d=u.redSqr().redIAdd(c).redISub(h).redISub(h),l=u.redMul(h.redISub(d)).redISub(o.redMul(c)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(d,l,p)},h.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),c=r.redMul(u),h=s.redSqr().redIAdd(f).redISub(c).redISub(c),d=s.redMul(c.redISub(h)).redISub(i.redMul(f)),l=this.z.redMul(a);return this.curve.jpoint(h,d,l)},h.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}return!1},h.prototype.inspect=function(){return this.isInfinity()?"":""},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":67,"../curve":70,"bn.js":"BN",inherits:101}],73:[function(t,e,r){var n,i=r,o=t("hash.js"),a=t("../elliptic"),s=a.utils.assert;function u(t){"short"===t.type?this.curve=new a.curve.short(t):"edwards"===t.type?this.curve=new a.curve.edwards(t):this.curve=new a.curve.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function f(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,f("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),f("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),f("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),f("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),f("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),f("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),f("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=t("./precomputed/secp256k1")}catch(t){n=void 0}f("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},{"../elliptic":67,"./precomputed/secp256k1":80,"hash.js":86}],74:[function(t,e,r){var n=t("bn.js"),i=t("hmac-drbg"),o=t("../../elliptic"),a=o.utils.assert,s=t("./key"),u=t("./signature");function f(t){if(!(this instanceof f))return new f(t);"string"==typeof t&&(a(o.curves.hasOwnProperty(t),"Unknown curve "+t),t=o.curves[t]),t instanceof o.curves.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}e.exports=f,f.prototype.keyPair=function(t){return new s(this,t)},f.prototype.keyFromPrivate=function(t,e){return s.fromPrivate(this,t,e)},f.prototype.keyFromPublic=function(t,e){return s.fromPublic(this,t,e)},f.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||o.rand(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),a=this.n.sub(new n(2));;){var s=new n(e.generate(r));if(!(s.cmp(a)>0))return s.iaddn(1),this.keyFromPrivate(s)}},f.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},f.prototype.sign=function(t,e,r,o){"object"===(void 0===r?"undefined":_typeof(r))&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var a=this.n.byteLength(),s=e.getPrivate().toArray("be",a),f=t.toArray("be",a),c=new i({hash:this.hash,entropy:s,nonce:f,pers:o.pers,persEnc:o.persEnc||"utf8"}),h=this.n.sub(new n(1)),d=0;;d++){var l=o.k?o.k(d):new n(c.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(h)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var y=l.invm(this.n).mul(m.mul(e.getPrivate()).iadd(t));if(0!==(y=y.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),v^=1),new u({r:m,s:y,recoveryParam:v})}}}}}},f.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new u(e,"hex")).r,a=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,f=a.invm(this.n),c=f.mul(t).umod(this.n),h=f.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),h)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),h)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},f.prototype.recoverPubKey=function(t,e,r,i){a((3&r)===r,"The recovery param is more than two bits"),e=new u(e,i);var o=this.n,s=new n(t),f=e.r,c=e.s,h=1&r,d=r>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");f=d?this.curve.pointFromX(f.add(this.curve.n),h):this.curve.pointFromX(f,h);var l=e.r.invm(o),p=o.sub(s).mul(l).umod(o),b=c.mul(l).umod(o);return this.g.mulAdd(p,f,b)},f.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new u(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":67,"./key":75,"./signature":76,"bn.js":"BN","hmac-drbg":98}],75:[function(t,e,r){var n=t("bn.js"),i=t("../../elliptic").utils.assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}e.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return""}},{"../../elliptic":67,"bn.js":"BN"}],76:[function(t,e,r){var n=t("bn.js"),i=t("../../elliptic").utils,o=i.assert;function a(t,e){if(t instanceof a)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function s(t,e){var r=t[e.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,a=e.place;o>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}e.exports=a,a.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new function(){this.place=0};if(48!==t[r.place++])return!1;if(s(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=s(t,r),a=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var u=s(t,r);if(t.length!==u+r.place)return!1;var f=t.slice(r.place,u+r.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new n(a),this.s=new n(f),this.recoveryParam=null,!0},a.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,e.length),(n=n.concat(e)).push(2),f(n,r.length);var o=n.concat(r),a=[48];return f(a,o.length),a=a.concat(o),i.encode(a,t)}},{"../../elliptic":67,"bn.js":"BN"}],77:[function(t,e,r){var n=t("hash.js"),i=t("../../elliptic"),o=i.utils,a=o.assert,s=o.parseBytes,u=t("./key"),f=t("./signature");function c(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof c))return new c(t);t=i.curves[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}e.exports=c,c.prototype.sign=function(t,e){t=s(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},c.prototype.verify=function(t,e,r){t=s(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},c.prototype.hashInt=function(){for(var t=this.hash(),e=0;e=0;){var o;if(i.isOdd()){var a=i.andln(n-1);o=a>(n>>1)-1?(n>>1)-a:a,i.isubn(o)}else o=0;r.push(o);for(var s=0!==i.cmpn(0)&&0===i.andln(n-1)?e+1:1,u=1;u0||e.cmpn(-i)>0;){var o,a,s,u=t.andln(3)+n&3,f=e.andln(3)+i&3;3===u&&(u=-1),3===f&&(f=-1),o=0==(1&u)?0:3!=(s=t.andln(7)+n&7)&&5!==s||2!==f?u:-u,r[0].push(o),a=0==(1&f)?0:3!=(s=e.andln(7)+i&7)&&5!==s||2!==u?f:-f,r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},{"bn.js":"BN","minimalistic-assert":107,"minimalistic-crypto-utils":108}],82:[function(t,e,r){e.exports={_args:[[{raw:"elliptic@^6.0.0",scope:null,escapedName:"elliptic",name:"elliptic",rawSpec:"^6.0.0",spec:">=6.0.0 <7.0.0",type:"range"},"/Users/frozeman/Sites/_ethereum/web3/node_modules/browserify-sign"]],_from:"elliptic@>=6.0.0 <7.0.0",_id:"elliptic@6.4.0",_inCache:!0,_location:"/elliptic",_nodeVersion:"7.0.0",_npmOperationalInternal:{host:"packages-18-east.internal.npmjs.com",tmp:"tmp/elliptic-6.4.0.tgz_1487798866428_0.30510620190761983"},_npmUser:{name:"indutny",email:"fedor@indutny.com"},_npmVersion:"3.10.8",_phantomChildren:{},_requested:{raw:"elliptic@^6.0.0",scope:null,escapedName:"elliptic",name:"elliptic",rawSpec:"^6.0.0",spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh","/secp256k1"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",_shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/Users/frozeman/Sites/_ethereum/web3/node_modules/browserify-sign",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz"},files:["lib"],gitHead:"6b0d2b76caae91471649c8e21f0b1d3ba0f96090",homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.0"}},{}],83:[function(t,e,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function o(t){return"object"===(void 0===t?"undefined":_typeof(t))&&null!==t}function a(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,r,n,s,u,f;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}if(a(r=this._events[t]))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(o(r))for(s=Array.prototype.slice.call(arguments,1),n=(f=r.slice()).length,u=0;u0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){if(!i(e))throw TypeError("listener must be a function");var r=!1;function n(){this.removeListener(t,n),r||(r=!0,e.apply(this,arguments))}return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var r,n,a,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(a=(r=this._events[t]).length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(s=a;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(i(r=this._events[t]))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],84:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("md5.js");e.exports=function(t,e,r,o){if(n.isBuffer(t)||(t=n.from(t,"binary")),e&&(n.isBuffer(e)||(e=n.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,s=n.alloc(a),u=n.alloc(o||0),f=n.alloc(0);a>0||o>0;){var c=new i;c.update(f),c.update(t),e&&c.update(e),f=c.digest();var h=0;if(a>0){var d=s.length-a;h=Math.min(a,f.length),f.copy(s,d,0,h),a-=h}if(h0){var l=u.length-o,p=Math.min(o,f.length-h);f.copy(u,l,h,h+p),o-=p}}return f.fill(0),{key:s,iv:u}}},{"md5.js":104,"safe-buffer":147}],85:[function(t,e,r){(function(r){var n=t("stream").Transform;function i(t){n.call(this),this._block=new r(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t("inherits")(i,n),i.prototype._transform=function(t,e,n){var i=null;try{"buffer"!==e&&(t=new r(t,e)),this.update(t)}catch(t){i=t}n(i)},i.prototype._flush=function(t){var e=null;try{this.push(this._digest())}catch(t){e=t}t(e)},i.prototype.update=function(t,e){if(!r.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");r.isBuffer(t)||(t=new r(t,e||"binary"));for(var n=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},i.prototype._update=function(t){throw new Error("_update is not implemented")},i.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();return void 0!==t&&(e=e.toString(t)),e},i.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=i}).call(this,t("buffer").Buffer)},{buffer:47,inherits:101,stream:156}],86:[function(t,e,r){var n=r;n.utils=t("./hash/utils"),n.common=t("./hash/common"),n.sha=t("./hash/sha"),n.ripemd=t("./hash/ripemd"),n.hmac=t("./hash/hmac"),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},{"./hash/common":87,"./hash/hmac":88,"./hash/ripemd":89,"./hash/sha":90,"./hash/utils":97}],87:[function(t,e,r){var n=t("./utils"),i=t("minimalistic-assert");function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}r.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;othis.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e>>3},r.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},{"../utils":97}],97:[function(t,e,r){var n=t("minimalistic-assert"),i=t("inherits");function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function s(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}r.inherits=i,r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n>8,a=255&i;o?r.push(o,a):r.push(a)}else for(n=0;n>>0}return a},r.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},r.rotr32=function(t,e){return t>>>e|t<<32-e},r.rotl32=function(t,e){return t<>>32-e},r.sum32=function(t,e){return t+e>>>0},r.sum32_3=function(t,e,r){return t+e+r>>>0},r.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},r.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},r.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,a=(o>>0,t[e+1]=o},r.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},r.sum64_lo=function(t,e,r,n){return e+n>>>0},r.sum64_4_hi=function(t,e,r,n,i,o,a,s){var u=0,f=e;return u+=(f=f+n>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(t,e,r,n,i,o,a,s){return e+n+o+s>>>0},r.sum64_5_hi=function(t,e,r,n,i,o,a,s,u,f){var c=0,h=e;return c+=(h=h+n>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(t,e,r,n,i,o,a,s,u,f){return e+n+o+s+f>>>0},r.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},r.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},r.shr64_hi=function(t,e,r){return t>>>r},r.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},{inherits:101,"minimalistic-assert":107}],98:[function(t,e,r){var n=t("hash.js"),i=t("minimalistic-crypto-utils"),o=t("minimalistic-assert");function a(t){if(!(this instanceof a))return new a(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}e.exports=a,a.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},a.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length>1,c=-7,h=r?i-1:0,d=r?-1:1,l=t[e+h];for(h+=d,o=l&(1<<-c)-1,l>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=d,c-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(l?-1:1);a+=Math.pow(2,n),o-=f}return(l?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,u,f=8*o-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+l]=255&s,l+=p,s/=256,i-=8);for(a=a<0;t[r+l]=255&a,l+=p,a/=256,f-=8);t[r+l-p]|=128*b}},{}],100:[function(t,e,r){var n=[].indexOf;e.exports=function(t,e){if(n)return t.indexOf(e);for(var r=0;r>>32-e}function u(t,e,r,n,i,o,a){return s(t+(e&r|~e&n)+i+o|0,a)+e|0}function f(t,e,r,n,i,o,a){return s(t+(e&n|r&~n)+i+o|0,a)+e|0}function c(t,e,r,n,i,o,a){return s(t+(e^r^n)+i+o|0,a)+e|0}function h(t,e,r,n,i,o,a){return s(t+(r^(e|~n))+i+o|0,a)+e|0}n(a,i),a.prototype._update=function(){for(var t=o,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,a=this._d;n=h(n=h(n=h(n=h(n=c(n=c(n=c(n=c(n=f(n=f(n=f(n=f(n=u(n=u(n=u(n=u(n,i=u(i,a=u(a,r=u(r,n,i,a,t[0],3614090360,7),n,i,t[1],3905402710,12),r,n,t[2],606105819,17),a,r,t[3],3250441966,22),i=u(i,a=u(a,r=u(r,n,i,a,t[4],4118548399,7),n,i,t[5],1200080426,12),r,n,t[6],2821735955,17),a,r,t[7],4249261313,22),i=u(i,a=u(a,r=u(r,n,i,a,t[8],1770035416,7),n,i,t[9],2336552879,12),r,n,t[10],4294925233,17),a,r,t[11],2304563134,22),i=u(i,a=u(a,r=u(r,n,i,a,t[12],1804603682,7),n,i,t[13],4254626195,12),r,n,t[14],2792965006,17),a,r,t[15],1236535329,22),i=f(i,a=f(a,r=f(r,n,i,a,t[1],4129170786,5),n,i,t[6],3225465664,9),r,n,t[11],643717713,14),a,r,t[0],3921069994,20),i=f(i,a=f(a,r=f(r,n,i,a,t[5],3593408605,5),n,i,t[10],38016083,9),r,n,t[15],3634488961,14),a,r,t[4],3889429448,20),i=f(i,a=f(a,r=f(r,n,i,a,t[9],568446438,5),n,i,t[14],3275163606,9),r,n,t[3],4107603335,14),a,r,t[8],1163531501,20),i=f(i,a=f(a,r=f(r,n,i,a,t[13],2850285829,5),n,i,t[2],4243563512,9),r,n,t[7],1735328473,14),a,r,t[12],2368359562,20),i=c(i,a=c(a,r=c(r,n,i,a,t[5],4294588738,4),n,i,t[8],2272392833,11),r,n,t[11],1839030562,16),a,r,t[14],4259657740,23),i=c(i,a=c(a,r=c(r,n,i,a,t[1],2763975236,4),n,i,t[4],1272893353,11),r,n,t[7],4139469664,16),a,r,t[10],3200236656,23),i=c(i,a=c(a,r=c(r,n,i,a,t[13],681279174,4),n,i,t[0],3936430074,11),r,n,t[3],3572445317,16),a,r,t[6],76029189,23),i=c(i,a=c(a,r=c(r,n,i,a,t[9],3654602809,4),n,i,t[12],3873151461,11),r,n,t[15],530742520,16),a,r,t[2],3299628645,23),i=h(i,a=h(a,r=h(r,n,i,a,t[0],4096336452,6),n,i,t[7],1126891415,10),r,n,t[14],2878612391,15),a,r,t[5],4237533241,21),i=h(i,a=h(a,r=h(r,n,i,a,t[12],1700485571,6),n,i,t[3],2399980690,10),r,n,t[10],4293915773,15),a,r,t[1],2240044497,21),i=h(i,a=h(a,r=h(r,n,i,a,t[8],1873313359,6),n,i,t[15],4264355552,10),r,n,t[6],2734768916,15),a,r,t[13],1309151649,21),i=h(i,a=h(a,r=h(r,n,i,a,t[4],4149444226,6),n,i,t[11],3174756917,10),r,n,t[2],718787259,15),a,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+a|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=new r(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},e.exports=a}).call(this,t("buffer").Buffer)},{buffer:47,"hash-base":105,inherits:101}],105:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("stream").Transform;function o(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t("inherits")(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},{inherits:101,"safe-buffer":147,stream:156}],106:[function(t,e,r){var n=t("bn.js"),i=t("brorand");function o(t){this.rand=t||new i.Rand}e.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(t)>=0);return i},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var i=t.bitLength(),o=n.mont(t),a=new n(1).toRed(o);e||(e=Math.max(1,i/48|0));for(var s=t.subn(1),u=0;!s.testn(u);u++);for(var f=t.shrn(u),c=s.toRed(o);e>0;e--){var h=this._randrange(new n(2),s);r&&r(h);var d=h.toRed(o).redPow(f);if(0!==d.cmp(a)&&0!==d.cmp(c)){for(var l=1;l0;e--){var c=this._randrange(new n(2),a),h=t.gcd(c);if(0!==h.cmpn(1))return h;var d=c.toRed(i).redPow(u);if(0!==d.cmp(o)&&0!==d.cmp(f)){for(var l=1;l>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(t,e){return"hex"===e?o(t):t}},{}],109:[function(t,e,r){e.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],110:[function(t,e,r){var n=t("asn1.js");r.certificate=t("./certificate");var i=n.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=i;var o=n.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=o;var a=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=a;var s=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),u=n.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=u;var f=n.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=f;var c=n.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=c,r.DSAparam=n.define("DSAparam",function(){this.int()});var h=n.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(d),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=h;var d=n.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=n.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":111,"asn1.js":1}],111:[function(t,e,r){var n=t("asn1.js"),i=n.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),o=n.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),u=n.define("RelativeDistinguishedName",function(){this.setof(o)}),f=n.define("RDNSequence",function(){this.seqof(u)}),c=n.define("Name",function(){this.choice({rdnSequence:this.use(f)})}),h=n.define("Validity",function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))}),d=n.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),l=n.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(c),this.key("validity").use(h),this.key("subject").use(c),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(d).optional())}),p=n.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())});e.exports=p},{"asn1.js":1}],112:[function(t,e,r){(function(r){var n=/Proc-Type: 4,ENCRYPTED\n\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\n\r?\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?/m,i=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n/m,o=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?-----END \1-----$/m,a=t("evp_bytestokey"),s=t("browserify-aes");e.exports=function(t,e){var u,f=t.toString(),c=f.match(n);if(c){var h="aes"+c[1],d=new r(c[2],"hex"),l=new r(c[3].replace(/\r?\n/g,""),"base64"),p=a(e,d.slice(0,8),parseInt(c[1],10)).key,b=[],m=s.createDecipheriv(h,p,d);b.push(m.update(l)),b.push(m.final()),u=r.concat(b)}else{var y=f.match(o);u=new r(y[2].replace(/\r?\n/g,""),"base64")}return{tag:f.match(i)[1],data:u}}}).call(this,t("buffer").Buffer)},{"browserify-aes":20,buffer:47,evp_bytestokey:84}],113:[function(t,e,r){(function(r){var n=t("./asn1"),i=t("./aesid.json"),o=t("./fixProc"),a=t("browserify-aes"),s=t("pbkdf2");function u(t){var e;"object"!==(void 0===t?"undefined":_typeof(t))||r.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=new r(t));var u,f,c,h,d,l,p,b,m,y,v,g,w,_=o(t,e),M=_.tag,x=_.data;switch(M){case"CERTIFICATE":f=n.certificate.decode(x,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(f||(f=n.PublicKey.decode(x,"der")),u=f.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(f.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return f.subjectPrivateKey=f.subjectPublicKey,{type:"ec",data:f};case"1.2.840.10040.4.1":return f.algorithm.params.pub_key=n.DSAparam.decode(f.subjectPublicKey.data,"der"),{type:"dsa",data:f.algorithm.params};default:throw new Error("unknown key id "+u)}throw new Error("unknown key type "+M);case"ENCRYPTED PRIVATE KEY":x=n.EncryptedPrivateKey.decode(x,"der"),h=e,d=(c=x).algorithm.decrypt.kde.kdeparams.salt,l=parseInt(c.algorithm.decrypt.kde.kdeparams.iters.toString(),10),p=i[c.algorithm.decrypt.cipher.algo.join(".")],b=c.algorithm.decrypt.cipher.iv,m=c.subjectPrivateKey,y=parseInt(p.split("-")[1],10)/8,v=s.pbkdf2Sync(h,d,l,y),g=a.createDecipheriv(p,v,b),(w=[]).push(g.update(m)),w.push(g.final()),x=r.concat(w);case"PRIVATE KEY":switch(u=(f=n.PrivateKey.decode(x,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(f.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:f.algorithm.curve,privateKey:n.ECPrivateKey.decode(f.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return f.algorithm.params.priv_key=n.DSAparam.decode(f.subjectPrivateKey,"der"),{type:"dsa",params:f.algorithm.params};default:throw new Error("unknown key id "+u)}throw new Error("unknown key type "+M);case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(x,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(x,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(x,"der")};case"EC PRIVATE KEY":return{curve:(x=n.ECPrivateKey.decode(x,"der")).parameters.value,privateKey:x.privateKey};default:throw new Error("unknown key type "+M)}}e.exports=u,u.signature=n.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":109,"./asn1":110,"./fixProc":112,"browserify-aes":20,buffer:47,pbkdf2:114}],114:[function(t,e,r){r.pbkdf2=t("./lib/async"),r.pbkdf2Sync=t("./lib/sync")},{"./lib/async":115,"./lib/sync":118}],115:[function(t,e,r){(function(r,n){var i,o=t("./precondition"),a=t("./default-encoding"),s=t("./sync"),u=t("safe-buffer").Buffer,f=n.crypto&&n.crypto.subtle,c={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function d(t,e,r,n,i){return f.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then(function(t){return f.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)}).then(function(t){return u.from(t)})}e.exports=function(t,e,l,p,b,m){if(u.isBuffer(t)||(t=u.from(t,a)),u.isBuffer(e)||(e=u.from(e,a)),o(l,p),"function"==typeof b&&(m=b,b=void 0),"function"!=typeof m)throw new Error("No callback provided to pbkdf2");var y,v,g=c[(b=b||"sha1").toLowerCase()];if(!g||"function"!=typeof n.Promise)return r.nextTick(function(){var r;try{r=s(t,e,l,p,b)}catch(t){return m(t)}m(null,r)});y=function(t){if(n.process&&!n.process.browser)return Promise.resolve(!1);if(!f||!f.importKey||!f.deriveBits)return Promise.resolve(!1);if(void 0!==h[t])return h[t];var e=d(i=i||u.alloc(8),i,10,128,t).then(function(){return!0}).catch(function(){return!1});return h[t]=e,e}(g).then(function(r){return r?d(t,e,l,p,g):s(t,e,l,p,b)}),v=m,y.then(function(t){r.nextTick(function(){v(null,t)})},function(t){r.nextTick(function(){v(t)})})}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":116,"./precondition":117,"./sync":118,_process:120,"safe-buffer":147}],116:[function(t,e,r){(function(t){var r;t.browser?r="utf-8":r=parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";e.exports=r}).call(this,t("_process"))},{_process:120}],117:[function(t,e,r){var n=Math.pow(2,30)-1;e.exports=function(t,e){if("number"!=typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!=typeof e)throw new TypeError("Key length not a number");if(e<0||e>n||e!=e)throw new TypeError("Bad key length")}},{}],118:[function(t,e,r){var n=t("create-hash/md5"),i=t("ripemd160"),o=t("sha.js"),a=t("./precondition"),s=t("./default-encoding"),u=t("safe-buffer").Buffer,f=u.alloc(128),c={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function h(t,e,r){var a=function(t){return"rmd160"===t||"ripemd160"===t?i:"md5"===t?n:function(e){return o(t).update(e).digest()}}(t),s="sha512"===t||"sha384"===t?128:64;e.length>s?e=a(e):e.length1)for(var r=1;rp||new a(e).cmp(l.modulus)>=0)throw new Error("decryption error");d=c?f(new a(e),l):s(e,l);var b=new r(p-d.length);if(b.fill(0),d=r.concat([b,d],p),4===h)return function(t,e){t.modulus;var n=t.modulus.byteLength(),a=(e.length,u("sha1").update(new r("")).digest()),s=a.length;if(0!==e[0])throw new Error("decryption error");var f=e.slice(1,s+1),c=e.slice(s+1),h=o(f,i(c,s)),d=o(c,i(h,n-s-1));if(function(t,e){t=new r(t),e=new r(e);var n=0,i=t.length;t.length!==e.length&&(n++,i=Math.min(t.length,e.length));var o=-1;for(;++o=e.length){o++;break}var a=e.slice(2,i-1);e.slice(i-1,i);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return e.slice(i)}(0,d,c);if(3===h)return d;throw new Error("unknown padding")}}).call(this,t("buffer").Buffer)},{"./mgf":122,"./withPublic":125,"./xor":126,"bn.js":"BN","browserify-rsa":38,buffer:47,"create-hash":51,"parse-asn1":113}],124:[function(t,e,r){(function(r){var n=t("parse-asn1"),i=t("randombytes"),o=t("create-hash"),a=t("./mgf"),s=t("./xor"),u=t("bn.js"),f=t("./withPublic"),c=t("browserify-rsa");e.exports=function(t,e,h){var d;d=t.padding?t.padding:h?1:4;var l,p=n(t);if(4===d)l=function(t,e){var n=t.modulus.byteLength(),f=e.length,c=o("sha1").update(new r("")).digest(),h=c.length,d=2*h;if(f>n-d-2)throw new Error("message too long");var l=new r(n-f-d-2);l.fill(0);var p=n-h-1,b=i(h),m=s(r.concat([c,l,new r([1]),e],p),a(b,p)),y=s(b,a(m,h));return new u(r.concat([new r([0]),y,m],n))}(p,e);else if(1===d)l=function(t,e,n){var o,a=e.length,s=t.modulus.byteLength();if(a>s-11)throw new Error("message too long");n?(o=new r(s-a-3)).fill(255):o=function(t,e){var n,o=new r(t),a=0,s=i(2*t),u=0;for(;a=0)throw new Error("data too long for modulus")}return h?c(l,p):f(l,p)}}).call(this,t("buffer").Buffer)},{"./mgf":122,"./withPublic":125,"./xor":126,"bn.js":"BN","browserify-rsa":38,buffer:47,"create-hash":51,"parse-asn1":113,randombytes:131}],125:[function(t,e,r){(function(r){var n=t("bn.js");e.exports=function(t,e){return new r(t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed().toArray())}}).call(this,t("buffer").Buffer)},{"bn.js":"BN",buffer:47}],126:[function(t,e,r){e.exports=function(t,e){for(var r=t.length,n=-1;++n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},M=c-h,x=Math.floor,k=String.fromCharCode;function S(t){throw new RangeError(_[t])}function E(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function A(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+E((t=t.replace(w,".")).split("."),e).join(".")}function j(t){for(var e,r,n=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=k((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=k(t)}).join("")}function B(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function T(t,e,r){var n=0;for(t=r?x(t/p):t>>1,t+=x(t/e);t>M*d>>1;n+=c)t=x(t/M);return x(n+(M+1)*t/(t+l))}function C(t){var e,r,n,i,o,a,s,u,l,p,v,g=[],w=t.length,_=0,M=m,k=b;for((r=t.lastIndexOf(y))<0&&(r=0),n=0;n=128&&S("not-basic"),g.push(t.charCodeAt(n));for(i=r>0?r+1:0;i=w&&S("invalid-input"),((u=(v=t.charCodeAt(i++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:c)>=c||u>x((f-_)/a))&&S("overflow"),_+=u*a,!(u<(l=s<=k?h:s>=k+d?d:s-k));s+=c)a>x(f/(p=c-l))&&S("overflow"),a*=p;k=T(_-o,e=g.length+1,0==o),x(_/e)>f-M&&S("overflow"),M+=x(_/e),_%=e,g.splice(_++,0,M)}return I(g)}function P(t){var e,r,n,i,o,a,s,u,l,p,v,g,w,_,M,E=[];for(g=(t=j(t)).length,e=m,r=0,o=b,a=0;a=e&&vx((f-r)/(w=n+1))&&S("overflow"),r+=(s-e)*w,e=s,a=0;af&&S("overflow"),v==e){for(u=r,l=c;!(u<(p=l<=o?h:l>=o+d?d:l-o));l+=c)M=u-p,_=c-p,E.push(k(B(p+M%_,0))),u=x(M/_);E.push(k(B(u,0))),o=T(r,w,n==i),r=0,++n}++r,++e}return E.join("")}if(s={version:"1.4.1",ucs2:{decode:j,encode:I},decode:C,encode:P,toASCII:function(t){return A(t,function(t){return g.test(t)?"xn--"+P(t):t})},toUnicode:function(t){return A(t,function(t){return v.test(t)?C(t.slice(4).toLowerCase()):t})}},"function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define("punycode",function(){return s});else if(i&&o)if(e.exports==i)o.exports=s;else for(u in s)s.hasOwnProperty(u)&&(i[u]=s[u]);else n.punycode=s}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],128:[function(t,e,r){e.exports=function(t,e,r,i){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var a=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var u,f,c=t.length;s>0&&c>s&&(c=s);for(var h=0;h=0?(d=m.substr(0,y),l=m.substr(y+1)):(d=m,l=""),p=decodeURIComponent(d),b=decodeURIComponent(l),u=o,f=p,Object.prototype.hasOwnProperty.call(u,f)?n(o[p])?o[p].push(b):o[p]=[o[p],b]:o[p]=b}return o};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],129:[function(t,e,r){var n=function(t){switch(void 0===t?"undefined":_typeof(t)){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};e.exports=function(t,e,r,s){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"===(void 0===t?"undefined":_typeof(t))?o(a(t),function(a){var s=encodeURIComponent(n(a))+r;return i(t[a])?o(t[a],function(t){return s+encodeURIComponent(n(t))}).join(e):s+encodeURIComponent(n(t[a]))}).join(e):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n65536)throw new Error("requested too many random bytes");var a=new n.Uint8Array(t);t>0&&o.getRandomValues(a);var s=i.from(a.buffer);if("function"==typeof e)return r.nextTick(function(){e(null,s)});return s}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:120,"safe-buffer":147}],132:[function(t,e,r){(function(e,n){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=t("safe-buffer"),a=t("randombytes"),s=o.Buffer,u=o.kMaxLength,f=n.crypto||n.msCrypto,c=Math.pow(2,32)-1;function h(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>c||t<0)throw new TypeError("offset must be a uint32");if(t>u||t>e)throw new RangeError("offset out of range")}function d(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>c||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>u)throw new RangeError("buffer too small")}function l(t,r,n,i){if(e.browser){var o=t.buffer,s=new Uint8Array(o,r,n);return f.getRandomValues(s),i?void e.nextTick(function(){i(null,t)}):t}if(!i)return a(n).copy(t,r),t;a(n,function(e,n){if(e)return i(e);n.copy(t,r),i(null,t)})}f&&f.getRandomValues||!e.browser?(r.randomFill=function(t,e,r,i){if(!(s.isBuffer(t)||t instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)i=e,e=0,r=t.length;else if("function"==typeof r)i=r,r=t.length-e;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return h(e,t.length),d(r,e,t.length),l(t,e,r,i)},r.randomFillSync=function(t,e,r){void 0===e&&(e=0);if(!(s.isBuffer(t)||t instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');h(e,t.length),void 0===r&&(r=t.length-e);return d(r,e,t.length),l(t,e,r)}):(r.randomFill=i,r.randomFillSync=i)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:120,randombytes:131,"safe-buffer":147}],133:[function(t,e,r){e.exports=t("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":134}],134:[function(t,e,r){var n=t("process-nextick-args").nextTick,i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=h;var o=t("core-util-is");o.inherits=t("inherits");var a=t("./_stream_readable"),s=t("./_stream_writable");o.inherits(h,a);for(var u=i(s.prototype),f=0;f0?("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===f.prototype||(a=e,e=f.from(a)),n?u.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,u,e,!0):u.ended?t.emit("error",new Error("stream.push() after EOF")):(u.reading=!1,u.decoder&&!r?(e=u.decoder.write(e),u.objectMode||0!==e.length?_(t,u,e,!1):E(t,u)):_(t,u,e,!1))):n||(u.reading=!1));return!(s=u).ended&&(s.needReadable||s.lengthe.highWaterMark&&(e.highWaterMark=((r=t)>=M?r=M:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0));var r}function k(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(l("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i(S,t):S(t))}function S(t){l("emit readable"),t.emit("readable"),B(t)}function E(t,e){e.readingMore||(e.readingMore=!0,i(A,t,e))}function A(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;to.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=f.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function C(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i(P,e,t))}function P(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function R(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return l("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?C(this):k(this),null;if(0===(t=x(t,e))&&e.ended)return 0===e.length&&C(this),null;var n,i=e.needReadable;return l("need readable",i),(0===e.length||e.length-t0?T(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&C(this)),null!==n&&this.emit("data",n),n},g.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},g.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,l("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?c:w;function f(e,r){l("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,l("cleanup"),t.removeListener("close",v),t.removeListener("finish",g),t.removeListener("drain",d),t.removeListener("error",y),t.removeListener("unpipe",f),n.removeListener("end",c),n.removeListener("end",w),n.removeListener("data",m),p=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||d())}function c(){l("onend"),t.end()}o.endEmitted?i(u):n.once("end",u),t.on("unpipe",f);var h,d=(h=n,function(){var t=h._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(h,"data")&&(t.flowing=!0,B(h))});t.on("drain",d);var p=!1;var b=!1;function m(e){l("ondata"),b=!1,!1!==t.write(e)||b||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==R(o.pipes,t))&&!p&&(l("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,b=!0),n.pause())}function y(e){l("onerror",e),w(),t.removeListener("error",y),0===s(t,"error")&&t.emit("error",e)}function v(){t.removeListener("finish",g),w()}function g(){l("onfinish"),t.removeListener("close",v),w()}function w(){l("unpipe"),n.unpipe(t)}return n.on("data",m),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",y),t.once("close",v),t.once("finish",g),t.emit("pipe",n),o.flowing||(l("pipe resume"),n.resume()),t},g.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o-1?setImmediate:i;y.WritableState=m;var u=t("core-util-is");u.inherits=t("inherits");var f={deprecate:t("util-deprecate")},c=t("./internal/streams/stream"),h=t("safe-buffer").Buffer,d=n.Uint8Array||function(){};var l,p=t("./internal/streams/destroy");function b(){}function m(e,r){a=a||t("./_stream_duplex"),e=e||{};var n=r instanceof a;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var u=e.highWaterMark,f=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=u||0===u?u:n&&(f||0===f)?f:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===e.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,o=r.writecb;if(l=r,l.writing=!1,l.writecb=null,l.length-=l.writelen,l.writelen=0,e)u=t,f=r,c=n,h=e,d=o,--f.pendingcb,c?(i(d,h),i(x,u,f),u._writableState.errorEmitted=!0,u.emit("error",h)):(d(h),u._writableState.errorEmitted=!0,u.emit("error",h),x(u,f));else{var a=_(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||w(t,r),n?s(g,t,r,a,o):g(t,r,a,o)}var u,f,c,h,d;var l}(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function y(e){if(a=a||t("./_stream_duplex"),!(l.call(y,this)||this instanceof a))return new y(e);this._writableState=new m(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),c.call(this)}function v(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function g(t,e,r,n){var i,o;r||(i=t,0===(o=e).length&&o.needDrain&&(o.needDrain=!1,i.emit("drain"))),e.pendingcb--,n(),x(t,e)}function w(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),a=e.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,v(t,e,!0,e.length,i,"",a.finish),e.pendingcb++,e.lastBufferedRequest=null,a.next?(e.corkedRequestsFree=a.next,a.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,h=r.callback;if(v(t,e,!1,e.objectMode?1:f.length,f,c,h),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function _(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function M(t,e){t._final(function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),x(t,e)})}function x(t,e){var r,n,o=_(e);return o&&(r=t,(n=e).prefinished||n.finalCalled||("function"==typeof r._final?(n.pendingcb++,n.finalCalled=!0,i(M,r,n)):(n.prefinished=!0,r.emit("prefinish"))),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),o}u.inherits(y,c),m.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(m.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(t){return!!l.call(this,t)||this===y&&(t&&t._writableState instanceof m)}})):l=function(t){return t instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(t,e,r){var n,o,a,s,u,f,c,l,p,m,y,g=this._writableState,w=!1,_=!g.objectMode&&(n=t,h.isBuffer(n)||n instanceof d);return _&&!h.isBuffer(t)&&(o=t,t=h.from(o)),"function"==typeof e&&(r=e,e=null),_?e="buffer":e||(e=g.defaultEncoding),"function"!=typeof r&&(r=b),g.ended?(p=this,m=r,y=new Error("write after end"),p.emit("error",y),i(m,y)):(_||(a=this,s=g,f=r,c=!0,l=!1,null===(u=t)?l=new TypeError("May not write null values to stream"):"string"==typeof u||void 0===u||s.objectMode||(l=new TypeError("Invalid non-string/buffer chunk")),l&&(a.emit("error",l),i(f,l),c=!1),c))&&(g.pendingcb++,w=function(t,e,r,n,i,o){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=h.from(e,r));return e}(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},y.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,x(t,e),r&&(e.finished?i(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),y.prototype.destroy=p.destroy,y.prototype._undestroy=p.undestroy,y.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_stream_duplex":134,"./internal/streams/destroy":140,"./internal/streams/stream":141,_process:120,"core-util-is":49,inherits:101,"process-nextick-args":119,"safe-buffer":147,"util-deprecate":160}],139:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("util");e.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i,o=n.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=o,i=s,e.copy(r,i),s+=a.data.length,a=a.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},{"safe-buffer":147,util:17}],140:[function(t,e,r){var n=t("process-nextick-args").nextTick;function i(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||n(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(n(i,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":119}],141:[function(t,e,r){e.exports=t("events").EventEmitter},{events:83}],142:[function(t,e,r){e.exports=t("./readable").PassThrough},{"./readable":143}],143:[function(t,e,r){(r=e.exports=t("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":134,"./lib/_stream_passthrough.js":135,"./lib/_stream_readable.js":136,"./lib/_stream_transform.js":137,"./lib/_stream_writable.js":138}],144:[function(t,e,r){e.exports=t("./readable").Transform},{"./readable":143}],145:[function(t,e,r){e.exports=t("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":138}],146:[function(t,e,r){(function(r){var n=t("inherits"),i=t("hash-base");function o(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function a(t,e){return t<>>32-e}function s(t,e,r,n,i,o,s,u){return a(t+(e^r^n)+o+s|0,u)+i|0}function u(t,e,r,n,i,o,s,u){return a(t+(e&r|~e&n)+o+s|0,u)+i|0}function f(t,e,r,n,i,o,s,u){return a(t+((e|~r)^n)+o+s|0,u)+i|0}function c(t,e,r,n,i,o,s,u){return a(t+(e&n|r&~n)+o+s|0,u)+i|0}function h(t,e,r,n,i,o,s,u){return a(t+(e^(r|~n))+o+s|0,u)+i|0}n(o,i),o.prototype._update=function(){for(var t=new Array(16),e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d,d=this._e;d=s(d,r=s(r,n,i,o,d,t[0],0,11),n,i=a(i,10),o,t[1],0,14),n=s(n=a(n,10),i=s(i,o=s(o,d,r,n,i,t[2],0,15),d,r=a(r,10),n,t[3],0,12),o,d=a(d,10),r,t[4],0,5),o=s(o=a(o,10),d=s(d,r=s(r,n,i,o,d,t[5],0,8),n,i=a(i,10),o,t[6],0,7),r,n=a(n,10),i,t[7],0,9),r=s(r=a(r,10),n=s(n,i=s(i,o,d,r,n,t[8],0,11),o,d=a(d,10),r,t[9],0,13),i,o=a(o,10),d,t[10],0,14),i=s(i=a(i,10),o=s(o,d=s(d,r,n,i,o,t[11],0,15),r,n=a(n,10),i,t[12],0,6),d,r=a(r,10),n,t[13],0,7),d=u(d=a(d,10),r=s(r,n=s(n,i,o,d,r,t[14],0,9),i,o=a(o,10),d,t[15],0,8),n,i=a(i,10),o,t[7],1518500249,7),n=u(n=a(n,10),i=u(i,o=u(o,d,r,n,i,t[4],1518500249,6),d,r=a(r,10),n,t[13],1518500249,8),o,d=a(d,10),r,t[1],1518500249,13),o=u(o=a(o,10),d=u(d,r=u(r,n,i,o,d,t[10],1518500249,11),n,i=a(i,10),o,t[6],1518500249,9),r,n=a(n,10),i,t[15],1518500249,7),r=u(r=a(r,10),n=u(n,i=u(i,o,d,r,n,t[3],1518500249,15),o,d=a(d,10),r,t[12],1518500249,7),i,o=a(o,10),d,t[0],1518500249,12),i=u(i=a(i,10),o=u(o,d=u(d,r,n,i,o,t[9],1518500249,15),r,n=a(n,10),i,t[5],1518500249,9),d,r=a(r,10),n,t[2],1518500249,11),d=u(d=a(d,10),r=u(r,n=u(n,i,o,d,r,t[14],1518500249,7),i,o=a(o,10),d,t[11],1518500249,13),n,i=a(i,10),o,t[8],1518500249,12),n=f(n=a(n,10),i=f(i,o=f(o,d,r,n,i,t[3],1859775393,11),d,r=a(r,10),n,t[10],1859775393,13),o,d=a(d,10),r,t[14],1859775393,6),o=f(o=a(o,10),d=f(d,r=f(r,n,i,o,d,t[4],1859775393,7),n,i=a(i,10),o,t[9],1859775393,14),r,n=a(n,10),i,t[15],1859775393,9),r=f(r=a(r,10),n=f(n,i=f(i,o,d,r,n,t[8],1859775393,13),o,d=a(d,10),r,t[1],1859775393,15),i,o=a(o,10),d,t[2],1859775393,14),i=f(i=a(i,10),o=f(o,d=f(d,r,n,i,o,t[7],1859775393,8),r,n=a(n,10),i,t[0],1859775393,13),d,r=a(r,10),n,t[6],1859775393,6),d=f(d=a(d,10),r=f(r,n=f(n,i,o,d,r,t[13],1859775393,5),i,o=a(o,10),d,t[11],1859775393,12),n,i=a(i,10),o,t[5],1859775393,7),n=c(n=a(n,10),i=c(i,o=f(o,d,r,n,i,t[12],1859775393,5),d,r=a(r,10),n,t[1],2400959708,11),o,d=a(d,10),r,t[9],2400959708,12),o=c(o=a(o,10),d=c(d,r=c(r,n,i,o,d,t[11],2400959708,14),n,i=a(i,10),o,t[10],2400959708,15),r,n=a(n,10),i,t[0],2400959708,14),r=c(r=a(r,10),n=c(n,i=c(i,o,d,r,n,t[8],2400959708,15),o,d=a(d,10),r,t[12],2400959708,9),i,o=a(o,10),d,t[4],2400959708,8),i=c(i=a(i,10),o=c(o,d=c(d,r,n,i,o,t[13],2400959708,9),r,n=a(n,10),i,t[3],2400959708,14),d,r=a(r,10),n,t[7],2400959708,5),d=c(d=a(d,10),r=c(r,n=c(n,i,o,d,r,t[15],2400959708,6),i,o=a(o,10),d,t[14],2400959708,8),n,i=a(i,10),o,t[5],2400959708,6),n=h(n=a(n,10),i=c(i,o=c(o,d,r,n,i,t[6],2400959708,5),d,r=a(r,10),n,t[2],2400959708,12),o,d=a(d,10),r,t[4],2840853838,9),o=h(o=a(o,10),d=h(d,r=h(r,n,i,o,d,t[0],2840853838,15),n,i=a(i,10),o,t[5],2840853838,5),r,n=a(n,10),i,t[9],2840853838,11),r=h(r=a(r,10),n=h(n,i=h(i,o,d,r,n,t[7],2840853838,6),o,d=a(d,10),r,t[12],2840853838,8),i,o=a(o,10),d,t[2],2840853838,13),i=h(i=a(i,10),o=h(o,d=h(d,r,n,i,o,t[10],2840853838,12),r,n=a(n,10),i,t[14],2840853838,5),d,r=a(r,10),n,t[1],2840853838,12),d=h(d=a(d,10),r=h(r,n=h(n,i,o,d,r,t[3],2840853838,13),i,o=a(o,10),d,t[8],2840853838,14),n,i=a(i,10),o,t[11],2840853838,11),n=h(n=a(n,10),i=h(i,o=h(o,d,r,n,i,t[6],2840853838,8),d,r=a(r,10),n,t[15],2840853838,5),o,d=a(d,10),r,t[13],2840853838,6),o=a(o,10);var l=this._a,p=this._b,b=this._c,m=this._d,y=this._e;y=h(y,l=h(l,p,b,m,y,t[5],1352829926,8),p,b=a(b,10),m,t[14],1352829926,9),p=h(p=a(p,10),b=h(b,m=h(m,y,l,p,b,t[7],1352829926,9),y,l=a(l,10),p,t[0],1352829926,11),m,y=a(y,10),l,t[9],1352829926,13),m=h(m=a(m,10),y=h(y,l=h(l,p,b,m,y,t[2],1352829926,15),p,b=a(b,10),m,t[11],1352829926,15),l,p=a(p,10),b,t[4],1352829926,5),l=h(l=a(l,10),p=h(p,b=h(b,m,y,l,p,t[13],1352829926,7),m,y=a(y,10),l,t[6],1352829926,7),b,m=a(m,10),y,t[15],1352829926,8),b=h(b=a(b,10),m=h(m,y=h(y,l,p,b,m,t[8],1352829926,11),l,p=a(p,10),b,t[1],1352829926,14),y,l=a(l,10),p,t[10],1352829926,14),y=c(y=a(y,10),l=h(l,p=h(p,b,m,y,l,t[3],1352829926,12),b,m=a(m,10),y,t[12],1352829926,6),p,b=a(b,10),m,t[6],1548603684,9),p=c(p=a(p,10),b=c(b,m=c(m,y,l,p,b,t[11],1548603684,13),y,l=a(l,10),p,t[3],1548603684,15),m,y=a(y,10),l,t[7],1548603684,7),m=c(m=a(m,10),y=c(y,l=c(l,p,b,m,y,t[0],1548603684,12),p,b=a(b,10),m,t[13],1548603684,8),l,p=a(p,10),b,t[5],1548603684,9),l=c(l=a(l,10),p=c(p,b=c(b,m,y,l,p,t[10],1548603684,11),m,y=a(y,10),l,t[14],1548603684,7),b,m=a(m,10),y,t[15],1548603684,7),b=c(b=a(b,10),m=c(m,y=c(y,l,p,b,m,t[8],1548603684,12),l,p=a(p,10),b,t[12],1548603684,7),y,l=a(l,10),p,t[4],1548603684,6),y=c(y=a(y,10),l=c(l,p=c(p,b,m,y,l,t[9],1548603684,15),b,m=a(m,10),y,t[1],1548603684,13),p,b=a(b,10),m,t[2],1548603684,11),p=f(p=a(p,10),b=f(b,m=f(m,y,l,p,b,t[15],1836072691,9),y,l=a(l,10),p,t[5],1836072691,7),m,y=a(y,10),l,t[1],1836072691,15),m=f(m=a(m,10),y=f(y,l=f(l,p,b,m,y,t[3],1836072691,11),p,b=a(b,10),m,t[7],1836072691,8),l,p=a(p,10),b,t[14],1836072691,6),l=f(l=a(l,10),p=f(p,b=f(b,m,y,l,p,t[6],1836072691,6),m,y=a(y,10),l,t[9],1836072691,14),b,m=a(m,10),y,t[11],1836072691,12),b=f(b=a(b,10),m=f(m,y=f(y,l,p,b,m,t[8],1836072691,13),l,p=a(p,10),b,t[12],1836072691,5),y,l=a(l,10),p,t[2],1836072691,14),y=f(y=a(y,10),l=f(l,p=f(p,b,m,y,l,t[10],1836072691,13),b,m=a(m,10),y,t[0],1836072691,13),p,b=a(b,10),m,t[4],1836072691,7),p=u(p=a(p,10),b=u(b,m=f(m,y,l,p,b,t[13],1836072691,5),y,l=a(l,10),p,t[8],2053994217,15),m,y=a(y,10),l,t[6],2053994217,5),m=u(m=a(m,10),y=u(y,l=u(l,p,b,m,y,t[4],2053994217,8),p,b=a(b,10),m,t[1],2053994217,11),l,p=a(p,10),b,t[3],2053994217,14),l=u(l=a(l,10),p=u(p,b=u(b,m,y,l,p,t[11],2053994217,14),m,y=a(y,10),l,t[15],2053994217,6),b,m=a(m,10),y,t[0],2053994217,14),b=u(b=a(b,10),m=u(m,y=u(y,l,p,b,m,t[5],2053994217,6),l,p=a(p,10),b,t[12],2053994217,9),y,l=a(l,10),p,t[2],2053994217,12),y=u(y=a(y,10),l=u(l,p=u(p,b,m,y,l,t[13],2053994217,9),b,m=a(m,10),y,t[9],2053994217,12),p,b=a(b,10),m,t[7],2053994217,5),p=s(p=a(p,10),b=u(b,m=u(m,y,l,p,b,t[10],2053994217,15),y,l=a(l,10),p,t[14],2053994217,8),m,y=a(y,10),l,t[12],0,8),m=s(m=a(m,10),y=s(y,l=s(l,p,b,m,y,t[15],0,5),p,b=a(b,10),m,t[10],0,12),l,p=a(p,10),b,t[4],0,9),l=s(l=a(l,10),p=s(p,b=s(b,m,y,l,p,t[1],0,12),m,y=a(y,10),l,t[5],0,5),b,m=a(m,10),y,t[8],0,14),b=s(b=a(b,10),m=s(m,y=s(y,l,p,b,m,t[7],0,6),l,p=a(p,10),b,t[6],0,8),y,l=a(l,10),p,t[2],0,13),y=s(y=a(y,10),l=s(l,p=s(p,b,m,y,l,t[13],0,6),b,m=a(m,10),y,t[14],0,5),p,b=a(b,10),m,t[0],0,15),p=s(p=a(p,10),b=s(b,m=s(m,y,l,p,b,t[3],0,13),y,l=a(l,10),p,t[9],0,11),m,y=a(y,10),l,t[11],0,11),m=a(m,10);var v=this._b+i+m|0;this._b=this._c+o+y|0,this._c=this._d+d+l|0,this._d=this._e+r+p|0,this._e=this._a+n+b|0,this._a=v},o.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=new r(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},e.exports=o}).call(this,t("buffer").Buffer)},{buffer:47,"hash-base":85,inherits:101}],147:[function(t,e,r){var n=t("buffer"),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,r),r.Buffer=a),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:47}],148:[function(t,e,r){var n=t("safe-buffer").Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},{"safe-buffer":147}],149:[function(t,e,r){(r=e.exports=function(t){t=t.toLowerCase();var e=r[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e}).sha=t("./sha"),r.sha1=t("./sha1"),r.sha224=t("./sha224"),r.sha256=t("./sha256"),r.sha384=t("./sha384"),r.sha512=t("./sha512")},{"./sha":150,"./sha1":151,"./sha224":152,"./sha256":153,"./sha384":154,"./sha512":155}],150:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r,n,i,o,s,u=this._w,f=0|this._a,c=0|this._b,h=0|this._c,d=0|this._d,l=0|this._e,p=0;p<16;++p)u[p]=t.readInt32BE(4*p);for(;p<80;++p)u[p]=u[p-3]^u[p-8]^u[p-14]^u[p-16];for(var b=0;b<80;++b){var m=~~(b/20),y=0|((s=f)<<5|s>>>27)+(n=c,i=h,o=d,0===(r=m)?n&i|~n&o:2===r?n&i|n&o|i&o:n^i^o)+l+u[b]+a[m];l=d,d=h,h=(e=c)<<30|e>>>2,c=f,f=y}this._a=f+this._a|0,this._b=c+this._b|0,this._c=h+this._c|0,this._d=d+this._d|0,this._e=l+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=u},{"./hash":148,inherits:101,"safe-buffer":147}],151:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r,n,i,o,s,u,f=this._w,c=0|this._a,h=0|this._b,d=0|this._c,l=0|this._d,p=0|this._e,b=0;b<16;++b)f[b]=t.readInt32BE(4*b);for(;b<80;++b)f[b]=(e=f[b-3]^f[b-8]^f[b-14]^f[b-16])<<1|e>>>31;for(var m=0;m<80;++m){var y=~~(m/20),v=0|((u=c)<<5|u>>>27)+(i=h,o=d,s=l,0===(n=y)?i&o|~i&s:2===n?i&o|i&s|o&s:i^o^s)+p+f[m]+a[y];p=l,l=d,d=(r=h)<<30|r>>>2,h=c,c=v}this._a=c+this._a|0,this._b=h+this._b|0,this._c=d+this._c|0,this._d=l+this._d|0,this._e=p+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=u},{"./hash":148,inherits:101,"safe-buffer":147}],152:[function(t,e,r){var n=t("inherits"),i=t("./sha256"),o=t("./hash"),a=t("safe-buffer").Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var t=a.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},e.exports=u},{"./hash":148,"./sha256":153,inherits:101,"safe-buffer":147}],153:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e,r,n,i,o,s,u,f=this._w,c=0|this._a,h=0|this._b,d=0|this._c,l=0|this._d,p=0|this._e,b=0|this._f,m=0|this._g,y=0|this._h,v=0;v<16;++v)f[v]=t.readInt32BE(4*v);for(;v<64;++v)f[v]=0|(((r=f[v-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+f[v-7]+(((e=f[v-15])>>>7|e<<25)^(e>>>18|e<<14)^e>>>3)+f[v-16];for(var g=0;g<64;++g){var w=y+(((u=p)>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+((s=m)^p&(b^s))+a[g]+f[g]|0,_=0|(((o=c)>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+((n=c)&(i=h)|d&(n|i));y=m,m=b,b=p,p=l+w|0,l=d,d=h,h=c,c=w+_|0}this._a=c+this._a|0,this._b=h+this._b|0,this._c=d+this._c|0,this._d=l+this._d|0,this._e=p+this._e|0,this._f=b+this._f|0,this._g=m+this._g|0,this._h=y+this._h|0},u.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},e.exports=u},{"./hash":148,inherits:101,"safe-buffer":147}],154:[function(t,e,r){var n=t("inherits"),i=t("./sha512"),o=t("./hash"),a=t("safe-buffer").Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var t=a.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},e.exports=u},{"./hash":148,"./sha512":155,inherits:101,"safe-buffer":147}],155:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function f(t,e,r){return r^t&(e^r)}function c(t,e,r){return t&e|r&(t|e)}function h(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function d(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function l(t,e){return t>>>0>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e,r,n,i,o,s,u,p,b=this._w,m=0|this._ah,y=0|this._bh,v=0|this._ch,g=0|this._dh,w=0|this._eh,_=0|this._fh,M=0|this._gh,x=0|this._hh,k=0|this._al,S=0|this._bl,E=0|this._cl,A=0|this._dl,j=0|this._el,I=0|this._fl,B=0|this._gl,T=0|this._hl,C=0;C<32;C+=2)b[C]=t.readInt32BE(4*C),b[C+1]=t.readInt32BE(4*C+4);for(;C<160;C+=2){var P=b[C-30],R=b[C-30+1],O=((u=P)>>>1|(p=R)<<31)^(u>>>8|p<<24)^u>>>7,N=((o=R)>>>1|(s=P)<<31)^(o>>>8|s<<24)^(o>>>7|s<<25);P=b[C-4],R=b[C-4+1];var L=((n=P)>>>19|(i=R)<<13)^(i>>>29|n<<3)^n>>>6,F=((e=R)>>>19|(r=P)<<13)^(r>>>29|e<<3)^(e>>>6|r<<26),q=b[C-14],D=b[C-14+1],U=b[C-32],z=b[C-32+1],K=N+D|0,H=O+q+l(K,N)|0;H=(H=H+L+l(K=K+F|0,F)|0)+U+l(K=K+z|0,z)|0,b[C]=H,b[C+1]=K}for(var V=0;V<160;V+=2){H=b[V],K=b[V+1];var W=c(m,y,v),X=c(k,S,E),G=h(m,k),J=h(k,m),Z=d(w,j),$=d(j,w),Y=a[V],Q=a[V+1],tt=f(w,_,M),et=f(j,I,B),rt=T+$|0,nt=x+Z+l(rt,T)|0;nt=(nt=(nt=nt+tt+l(rt=rt+et|0,et)|0)+Y+l(rt=rt+Q|0,Q)|0)+H+l(rt=rt+K|0,K)|0;var it=J+X|0,ot=G+W+l(it,J)|0;x=M,T=B,M=_,B=I,_=w,I=j,w=g+nt+l(j=A+rt|0,A)|0,g=v,A=E,v=y,E=S,y=m,S=k,m=nt+ot+l(k=rt+it|0,rt)|0}this._al=this._al+k|0,this._bl=this._bl+S|0,this._cl=this._cl+E|0,this._dl=this._dl+A|0,this._el=this._el+j|0,this._fl=this._fl+I|0,this._gl=this._gl+B|0,this._hl=this._hl+T|0,this._ah=this._ah+m+l(this._al,k)|0,this._bh=this._bh+y+l(this._bl,S)|0,this._ch=this._ch+v+l(this._cl,E)|0,this._dh=this._dh+g+l(this._dl,A)|0,this._eh=this._eh+w+l(this._el,j)|0,this._fh=this._fh+_+l(this._fl,I)|0,this._gh=this._gh+M+l(this._gl,B)|0,this._hh=this._hh+x+l(this._hl,T)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},e.exports=u},{"./hash":148,inherits:101,"safe-buffer":147}],156:[function(t,e,r){e.exports=i;var n=t("events").EventEmitter;function i(){n.call(this)}t("inherits")(i,n),i.Readable=t("readable-stream/readable.js"),i.Writable=t("readable-stream/writable.js"),i.Duplex=t("readable-stream/duplex.js"),i.Transform=t("readable-stream/transform.js"),i.PassThrough=t("readable-stream/passthrough.js"),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,t.end())}function u(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function f(t){if(c(),0===n.listenerCount(this,"error"))throw t}function c(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("error",f),t.on("error",f),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}},{events:83,inherits:101,"readable-stream/duplex.js":133,"readable-stream/passthrough.js":142,"readable-stream/readable.js":143,"readable-stream/transform.js":144,"readable-stream/writable.js":145}],157:[function(t,e,r){var n=t("safe-buffer").Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=f,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=c,this.end=h,e=3;break;default:return this.write=d,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:-1}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�".repeat(r);if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�".repeat(r+1);if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�".repeat(r+2)}}(this,t,e);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function f(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function c(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function l(t){return t&&t.length?this.write(t):""}r.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":147}],158:[function(t,e,r){var n=t("punycode"),i=t("./util");function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}r.parse=g,r.resolve=function(t,e){return g(t,!1,!0).resolve(e)},r.resolveObject=function(t,e){return t?g(t,!1,!0).resolveObject(e):e},r.format=function(t){i.isString(t)&&(t=g(t));return t instanceof o?t.format():o.prototype.format.call(t)},r.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,f=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(f),h=["%","/","?",";","#"].concat(c),d=["/","?","#"],l=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=t("querystring");function g(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+(void 0===t?"undefined":_typeof(t)));var o=t.indexOf("?"),s=-1!==o&&o127?P+="x":P+=C[R];if(!P.match(l)){var N=B.slice(0,A),L=B.slice(A+1),F=C.match(p);F&&(N.push(F[1]),L.unshift(F[2])),L.length&&(g="/"+L.join(".")+g),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=n.toASCII(this.hostname));var q=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+q,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==g[0]&&(g="/"+g))}if(!b[M])for(A=0,T=c.length;A0)&&r.host.split("@"))&&(r.auth=I.shift(),r.host=r.hostname=I.shift());return r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!x.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var S=x.slice(-1)[0],E=(r.host||t.host||x.length>1)&&("."===S||".."===S)||""===S,A=0,j=x.length;j>=0;j--)"."===(S=x[j])?x.splice(j,1):".."===S?(x.splice(j,1),A++):A&&(x.splice(j,1),A--);if(!_&&!M)for(;A--;A)x.unshift("..");!_||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),E&&"/"!==x.join("/").substr(-1)&&x.push("");var I,B=""===x[0]||x[0]&&"/"===x[0].charAt(0);k&&(r.hostname=r.host=B?"":x.length?x.shift():"",(I=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=I.shift(),r.host=r.hostname=I.shift()));return(_=_||r.host&&x.length)&&!B&&x.unshift(""),x.length?r.pathname=x.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":159,punycode:127,querystring:130}],159:[function(t,e,r){e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"===(void 0===t?"undefined":_typeof(t))&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],160:[function(t,e,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(t){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],161:[function(require,module,exports){var indexOf=require("indexof"),Object_keys=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var r in t)e.push(r);return e},forEach=function(t,e){if(t.forEach)return t.forEach(e);for(var r=0;r>6|192);else{if(i>55295&&i<56320){if(++n==t.length)return null;var o=t.charCodeAt(n);if(o<56320||o>57343)return null;r+=e((i=65536+((1023&i)<<10)+(1023&o))>>18|240),r+=e(i>>12&63|128)}else r+=e(i>>12|224);r+=e(i>>6&63|128)}r+=e(63&i|128)}}return r},toString:function(t){for(var e="",r=0,o=i(t);r127){if(a>191&&a<224){if(r>=o)return null;a=(31&a)<<6|63&n(t,r)}else if(a>223&&a<240){if(r+1>=o)return null;a=(15&a)<<12|(63&n(t,r))<<6|63&n(t,++r)}else{if(!(a>239&&a<248))return null;if(r+2>=o)return null;a=(7&a)<<18|(63&n(t,r))<<12|(63&n(t,++r))<<6|63&n(t,++r)}++r}if(a<=65535)e+=String.fromCharCode(a);else{if(!(a<=1114111))return null;a-=65536,e+=String.fromCharCode(a>>10|55296),e+=String.fromCharCode(1023&a|56320)}}return e},fromNumber:function(t){var e=t.toString(16);return e.length%2==0?"0x"+e:"0x0"+e},toNumber:function(t){return parseInt(t.slice(2),16)},fromNat:function(t){return"0x0"===t?"0x":t.length%2==0?t:"0x0"+t.slice(2)},toNat:function(t){return"0"===t[2]?"0x"+t.slice(3):t},fromArray:a,toArray:o,fromUint8Array:function(t){return a([].slice.call(t,0))},toUint8Array:function(t){return new Uint8Array(o(t))}}},{"./array.js":163}],165:[function(t,e,r){var n="0123456789abcdef".split(""),i=[1,256,65536,16777216],o=[0,8,16,24],a=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],s=function(t){var e,r,n,i,o,s,u,f,c,h,d,l,p,b,m,y,v,g,w,_,M,x,k,S,E,A,j,I,B,T,C,P,R,O,N,L,F,q,D,U,z,K,H,V,W,X,G,J,Z,$,Y,Q,tt,et,rt,nt,it,ot,at,st,ut,ft,ct;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],f=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],h=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],e=(l=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(f<<1|c>>>31),r=o^(c<<1|f>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(h<<1|d>>>31),r=u^(d<<1|h>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=f^(l<<1|p>>>31),r=c^(p<<1|l>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=h^(i<<1|o>>>31),r=d^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,b=t[0],m=t[1],X=t[11]<<4|t[10]>>>28,G=t[10]<<4|t[11]>>>28,I=t[20]<<3|t[21]>>>29,B=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,K=t[40]<<18|t[41]>>>14,H=t[41]<<18|t[40]>>>14,O=t[2]<<1|t[3]>>>31,N=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,Z=t[23]<<10|t[22]>>>22,T=t[33]<<13|t[32]>>>19,C=t[32]<<13|t[33]>>>19,ft=t[42]<<2|t[43]>>>30,ct=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,F=t[15]<<6|t[14]>>>26,g=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,P=t[45]<<29|t[44]>>>3,R=t[44]<<29|t[45]>>>3,S=t[6]<<28|t[7]>>>4,E=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,q=t[26]<<25|t[27]>>>7,D=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,V=t[8]<<27|t[9]>>>5,W=t[9]<<27|t[8]>>>5,A=t[18]<<20|t[19]>>>12,j=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,U=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,x=t[48]<<14|t[49]>>>18,k=t[49]<<14|t[48]>>>18,t[0]=b^~y&g,t[1]=m^~v&w,t[10]=S^~A&I,t[11]=E^~j&B,t[20]=O^~L&q,t[21]=N^~F&D,t[30]=V^~X&J,t[31]=W^~G&Z,t[40]=et^~nt&ot,t[41]=rt^~it&at,t[2]=y^~g&_,t[3]=v^~w&M,t[12]=A^~I&T,t[13]=j^~B&C,t[22]=L^~q&U,t[23]=F^~D&z,t[32]=X^~J&$,t[33]=G^~Z&Y,t[42]=nt^~ot&st,t[43]=it^~at&ut,t[4]=g^~_&x,t[5]=w^~M&k,t[14]=I^~T&P,t[15]=B^~C&R,t[24]=q^~U&K,t[25]=D^~z&H,t[34]=J^~$&Q,t[35]=Z^~Y&tt,t[44]=ot^~st&ft,t[45]=at^~ut&ct,t[6]=_^~x&b,t[7]=M^~k&m,t[16]=T^~P&S,t[17]=C^~R&E,t[26]=U^~K&O,t[27]=z^~H&N,t[36]=$^~Q&V,t[37]=Y^~tt&W,t[46]=st^~ft&et,t[47]=ut^~ct&rt,t[8]=x^~b&y,t[9]=k^~m&v,t[18]=P^~S&A,t[19]=R^~E&j,t[28]=K^~O&L,t[29]=H^~N&F,t[38]=Q^~V&X,t[39]=tt^~W&G,t[48]=ft^~et&nt,t[49]=ct^~rt&it,t[0]^=a[n],t[1]^=a[n+1]},u=function(t){return function(e){var r,a,u;if("0x"===e.slice(0,2)){r=[];for(var f=2,c=e.length;f>2]|=e[l]<>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(u[m>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=f){for(t.start=m-f,t.block=u[c],m=0;m>2]|=i[3&m],t.lastByteIndex===f)for(u[0]=u[c],m=1;m>4&15]+n[15&p]+n[p>>12&15]+n[p>>8&15]+n[p>>20&15]+n[p>>16&15]+n[p>>28&15]+n[p>>24&15];y%c==0&&(s(d),m=0)}return"0x"+b}({blocks:[],reset:!0,block:0,start:0,blockCount:1600-((a=t)<<1)>>5,outputBlocks:a>>5,s:(u=[0,0,0,0,0,0,0,0,0,0],[].concat(u,u,u,u,u))},r)}};e.exports={keccak256:u(256),keccak512:u(512),keccak256s:u(256),keccak512s:u(512)}},{}],166:[function(t,e,r){var n=t("is-function");e.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");arguments.length<3&&(r=this);"[object Array]"===i.call(t)?function(t,e,r){for(var n=0,i=t.length;n0){var a=i.join(r,o);n.push(g(t)(e[o])(a))}return Promise.all(n).then(function(){return r})})}}},_=function(t){return function(e){return u(t+"/bzzr:/",{body:"string"==typeof e?L(e):e,method:"POST"})}},M=function(t){return function(e){return function(r){return function(n){return function i(o){var a="/"===r[0]?r:"/"+r,s=t+"/bzz:/"+e+a,f={method:"PUT",headers:{"Content-Type":n.type},body:n.data};return u(s,f).then(function(t){if(-1!==t.indexOf("error"))throw t;return t}).catch(function(t){return o>0&&i(o-1)})}(3)}}}},x=function(t){return function(e){return S(t)({"":e})}},k=function(t){return function(r){return e.readFile(r).then(function(e){return x(t)({type:a.lookup(r),data:e})})}},S=function(t){return function(e){return _(t)("{}").then(function(r){return Object.keys(e).reduce(function(r,n){return r.then((i=n,function(r){return M(t)(r)(i)(e[i])}));var i},Promise.resolve(r))})}},E=function(t){return function(r){return e.readFile(r).then(_(t))}},A=function(t){return function(n){return function(i){return r.directoryTree(i).then(function(t){return Promise.all(t.map(function(t){return e.readFile(t)})).then(function(e){var r=t.map(function(t){return t.slice(i.length)}),n=t.map(function(t){return a.lookup(t)||"text/plain"});return l(r)(e.map(function(t,e){return{type:n[e],data:t}}))})}).then(function(t){return(e=n?{"":t[n]}:{},function(t){var r={};for(var n in e)r[n]=e[n];for(var i in t)r[i]=t[i];return r})(t);var e}).then(S(t))}}},j=function(t){return function(e){if("data"===e.pick)return d.data().then(_(t));if("file"===e.pick)return d.file().then(x(t));if("directory"===e.pick)return d.directory().then(S(t));if(e.path)switch(e.kind){case"data":return E(t)(e.path);case"file":return k(t)(e.path);case"directory":return A(t)(e.defaultFile)(e.path)}else{if(e.length||"string"==typeof e)return _(t)(e);if(e instanceof Object)return S(t)(e)}return Promise.reject(new Error("Bad arguments"))}},I=function(t){return function(e){return function(r){return R(t)(e).then(function(n){return n?r?w(t)(e)(r):v(t)(e):r?g(t)(e)(r):b(t)(e)})}}},B=function(t,e){var i=n.platform().replace("win32","windows")+"-"+("x64"===n.arch()?"amd64":"386"),o=(e||s)[i],a=f+o.archive+".tar.gz",u=o.archiveMD5,c=o.binaryMD5;return r.safeDownloadArchived(a)(u)(c)(t)},T=function(t){return new Promise(function(e,r){var n=o.spawn,i=function(t){return function(e){return-1!==(""+e).indexOf(t)}},a=t.account,s=t.password,u=t.dataDir,f=t.ensApi,c=t.privateKey,h=0,d=n(t.binPath,["--bzzaccount",a||c,"--datadir",u,"--ens-api",f]),l=function(t){0===h&&i("Passphrase")(t)?setTimeout(function(){h=1,d.stdin.write(s+"\n")},500):i("Swarm http proxy started")(t)&&(h=2,clearTimeout(p),e(d))};d.stdout.on("data",l),d.stderr.on("data",l);var p=setTimeout(function(){return r(new Error("Couldn't start swarm process."))},2e4)})},C=function(t){return new Promise(function(e,r){t.stderr.removeAllListeners("data"),t.stdout.removeAllListeners("data"),t.stdin.removeAllListeners("error"),t.removeAllListeners("error"),t.removeAllListeners("exit"),t.kill("SIGINT");var n=setTimeout(function(){return t.kill("SIGKILL")},8e3);t.once("close",function(){clearTimeout(n),e()})})},P=function(t){return _(t)("test").then(function(t){return"c9a99c7d326dcc6316f32fe2625b311f6dc49a175e6877681ded93137d3569e7"===t}).catch(function(){return!1})},R=function(t){return function(e){return b(t)(e).then(function(t){try{return!!JSON.parse(N(t)).entries}catch(t){return!1}})}},O=function(t){return function(e,r,n,i,o){var a;return void 0!==e&&(a=t(e)),void 0!==r&&(a=t(r)),void 0!==n&&(a=t(n)),void 0!==i&&(a=t(i)),void 0!==o&&(a=t(o)),a}},N=function(t){return c.toString(c.fromUint8Array(t))},L=function(t){return c.toUint8Array(c.fromString(t))},F=function(t){return{download:function(e,r){return I(t)(e)(r)},downloadData:O(b(t)),downloadDataToDisk:O(g(t)),downloadDirectory:O(v(t)),downloadDirectoryToDisk:O(w(t)),downloadEntries:O(m(t)),downloadRoutes:O(y(t)),isAvailable:function(){return P(t)},upload:function(e){return j(t)(e)},uploadData:O(_(t)),uploadFile:O(x(t)),uploadFileFromDisk:O(x(t)),uploadDataFromDisk:O(E(t)),uploadDirectory:O(S(t)),uploadDirectoryFromDisk:O(A(t)),uploadToManifest:O(M(t)),pick:d,hash:h,fromString:L,toString:N}};return{at:F,local:function(t){return function(e){return P("http://localhost:8500").then(function(r){return r?e(F("http://localhost:8500")).then(function(){}):B(t.binPath,t.archives).onData(function(e){return(t.onProgress||function(){})(e.length)}).then(function(){return T(t)}).then(function(t){return e(F("http://localhost:8500")).then(function(){return t})}).then(C)})}},download:I,downloadBinary:B,downloadData:b,downloadDataToDisk:g,downloadDirectory:v,downloadDirectoryToDisk:w,downloadEntries:m,downloadRoutes:y,isAvailable:P,startProcess:T,stopProcess:C,upload:j,uploadData:_,uploadDataFromDisk:E,uploadFile:x,uploadFileFromDisk:k,uploadDirectory:S,uploadDirectoryFromDisk:A,uploadToManifest:M,pick:d,hash:h,fromString:L,toString:N}}},{}],177:[function(t,e,r){(r=e.exports=function(t){return t.replace(/^\s*|\s*$/g,"")}).left=function(t){return t.replace(/^\s*/,"")},r.right=function(t){return t.replace(/\s*$/,"")}},{}],178:[function(t,e,r){(function(){var t=this,n=t._,i=Array.prototype,o=Object.prototype,a=Function.prototype,s=i.push,u=i.slice,f=o.toString,c=o.hasOwnProperty,h=Array.isArray,d=Object.keys,l=a.bind,p=Object.create,b=function(){},m=function t(e){return e instanceof t?e:this instanceof t?void(this._wrapped=e):new t(e)};void 0!==r?(void 0!==e&&e.exports&&(r=e.exports=m),r._=m):t._=m,m.VERSION="1.8.3";var y=function(t,e,r){if(void 0===e)return t;switch(null==r?3:r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)};case 4:return function(r,n,i,o){return t.call(e,r,n,i,o)}}return function(){return t.apply(e,arguments)}},v=function(t,e,r){return null==t?m.identity:m.isFunction(t)?y(t,e,r):m.isObject(t)?m.matcher(t):m.property(t)};m.iteratee=function(t,e){return v(t,e,1/0)};var g=function(t,e){return function(r){var n=arguments.length;if(n<2||null==r)return r;for(var i=1;i=0&&e<=M};function S(t){return function(e,r,n,i){r=y(r,i,4);var o=!k(e)&&m.keys(e),a=(o||e).length,s=t>0?0:a-1;return arguments.length<3&&(n=e[o?o[s]:s],s+=t),function(e,r,n,i,o,a){for(;o>=0&&o=0},m.invoke=function(t,e){var r=u.call(arguments,2),n=m.isFunction(e);return m.map(t,function(t){var i=n?e:t[e];return null==i?i:i.apply(t,r)})},m.pluck=function(t,e){return m.map(t,m.property(e))},m.where=function(t,e){return m.filter(t,m.matcher(e))},m.findWhere=function(t,e){return m.find(t,m.matcher(e))},m.max=function(t,e,r){var n,i,o=-1/0,a=-1/0;if(null==e&&null!=t)for(var s=0,u=(t=k(t)?t:m.values(t)).length;so&&(o=n);else e=v(e,r),m.each(t,function(t,r,n){((i=e(t,r,n))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)});return o},m.min=function(t,e,r){var n,i,o=1/0,a=1/0;if(null==e&&null!=t)for(var s=0,u=(t=k(t)?t:m.values(t)).length;sn||void 0===r)return 1;if(r0?0:i-1;o>=0&&o0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(r&&o&&s)return n[o=r(n,i)]===i?o:-1;if(i!=i)return(o=e(u.call(n,a,s),m.isNaN))>=0?o+a:-1;for(o=t>0?a:s-1;o>=0&&oe?(a&&(clearTimeout(a),a=null),s=f,o=t.apply(n,i),a||(n=i=null)):a||!1===r.trailing||(a=setTimeout(u,c)),o}},m.debounce=function(t,e,r){var n,i,o,a,s,u=function u(){var f=m.now()-a;f=0?n=setTimeout(u,e-f):(n=null,r||(s=t.apply(o,i),n||(o=i=null)))};return function(){o=this,i=arguments,a=m.now();var f=r&&!n;return n||(n=setTimeout(u,e)),f&&(s=t.apply(o,i),o=i=null),s}},m.wrap=function(t,e){return m.partial(e,t)},m.negate=function(t){return function(){return!t.apply(this,arguments)}},m.compose=function(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}},m.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},m.before=function(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}},m.once=m.partial(m.before,2);var T=!{toString:null}.propertyIsEnumerable("toString"),C=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function P(t,e){var r=C.length,n=t.constructor,i=m.isFunction(n)&&n.prototype||o,a="constructor";for(m.has(t,a)&&!m.contains(e,a)&&e.push(a);r--;)(a=C[r])in t&&t[a]!==i[a]&&!m.contains(e,a)&&e.push(a)}m.keys=function(t){if(!m.isObject(t))return[];if(d)return d(t);var e=[];for(var r in t)m.has(t,r)&&e.push(r);return T&&P(t,e),e},m.allKeys=function(t){if(!m.isObject(t))return[];var e=[];for(var r in t)e.push(r);return T&&P(t,e),e},m.values=function(t){for(var e=m.keys(t),r=e.length,n=Array(r),i=0;i":">",'"':""","'":"'","`":"`"},O=m.invert(R),N=function(t){var e=function(e){return t[e]},r="(?:"+m.keys(t).join("|")+")",n=RegExp(r),i=RegExp(r,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(i,e):t}};m.escape=N(R),m.unescape=N(O),m.result=function(t,e,r){var n=null==t?void 0:t[e];return void 0===n&&(n=r),m.isFunction(n)?n.call(t):n};var L=0;m.uniqueId=function(t){var e=++L+"";return t?t+e:e},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var F=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,U=function(t){return"\\"+q[t]};m.template=function(t,e,r){!e&&r&&(e=r),e=m.defaults({},e,m.templateSettings);var n=RegExp([(e.escape||F).source,(e.interpolate||F).source,(e.evaluate||F).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(n,function(e,r,n,a,s){return o+=t.slice(i,s).replace(D,U),i=s+e.length,r?o+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?o+="'+\n((__t=("+n+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(e.variable||"obj","_",o)}catch(t){throw t.source=o,t}var s=function(t){return a.call(this,t,m)},u=e.variable||"obj";return s.source="function("+u+"){\n"+o+"}",s},m.chain=function(t){var e=m(t);return e._chain=!0,e};var z=function(t,e){return t._chain?m(e).chain():e};m.mixin=function(t){m.each(m.functions(t),function(e){var r=m[e]=t[e];m.prototype[e]=function(){var t=[this._wrapped];return s.apply(t,arguments),z(this,r.apply(m,t))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=i[t];m.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!==t&&"splice"!==t||0!==r.length||delete r[0],z(this,r)}}),m.each(["concat","join","slice"],function(t){var e=i[t];m.prototype[t]=function(){return z(this,e.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}).call(this)},{}],179:[function(t,e,r){e.exports=function(t,e){if(e){e=(e=e.trim().replace(/^(\?|#|&)/,""))?"?"+e:e;var r=t.split(/[\?\#]/),n=r[0];e&&/\:\/\/[^\/]*$/.test(n)&&(n+="/");var i=t.match(/(\#.*)$/);t=n+e,i&&(t+=i[0])}return t}},{}],180:[function(t,e,r){var n=t("xhr-request");e.exports=function(t,e){return new Promise(function(r,i){n(t,e,function(t,e){t?i(t):r(e)})})}},{"xhr-request":181}],181:[function(t,e,r){var n=t("query-string"),i=t("url-set-query"),o=t("object-assign"),a=t("./lib/ensure-header.js"),s=t("./lib/request.js"),u="application/json",f=function(){};e.exports=function(t,e,r){if(!t||"string"!=typeof t)throw new TypeError("must specify a URL");"function"==typeof e&&(r=e,e={});if(r&&"function"!=typeof r)throw new TypeError("expected cb to be undefined or a function");r=r||f;var c=(e=e||{}).json?"json":"text",h=(e=o({responseType:c},e)).headers||{},d=(e.method||"GET").toUpperCase(),l=e.query;l&&("string"!=typeof l&&(l=n.stringify(l)),t=i(t,l));"json"===e.responseType&&a(h,"Accept",u);e.json&&"GET"!==d&&"HEAD"!==d&&(a(h,"Content-Type",u),e.body=JSON.stringify(e.body));return e.method=d,e.url=t,e.headers=h,delete e.query,delete e.json,s(e,r)}},{"./lib/ensure-header.js":182,"./lib/request.js":184,"object-assign":169,"query-string":171,"url-set-query":179}],182:[function(t,e,r){e.exports=function(t,e,r){var n=e.toLowerCase();t[e]||t[n]||(t[e]=r)}},{}],183:[function(t,e,r){e.exports=function(t,e){return e?{statusCode:e.statusCode,headers:e.headers,method:t.method,url:t.url,rawRequest:e.rawRequest?e.rawRequest:e}:null}},{}],184:[function(t,e,r){var n=t("xhr"),i=t("./normalize-response"),o=function(){};e.exports=function(t,e){delete t.uri;var r=!1;"json"===t.responseType&&(t.responseType="text",r=!0);var a=n(t,function(n,a,s){if(r&&!n)try{var u=a.rawRequest.responseText;s=JSON.parse(u)}catch(t){n=t}a=i(t,a),e(n,n?null:s,a),e=o}),s=a.onabort;return a.onabort=function(){var t=s.apply(a,Array.prototype.slice.call(arguments));return e(new Error("XHR Aborted")),e=o,t},a}},{"./normalize-response":183,xhr:185}],185:[function(t,e,r){var n=t("global/window"),i=t("is-function"),o=t("parse-headers"),a=t("xtend");function s(t,e,r){var n=t;return i(e)?(r=e,"string"==typeof t&&(n={uri:t})):n=a(e,{uri:t}),n.callback=r,n}function u(t,e,r){return f(e=s(t,e,r))}function f(t){if(void 0===t.callback)throw new Error("callback argument missing");var e=!1,r=function(r,n,i){e||(e=!0,t.callback(r,n,i))};function n(t){return clearTimeout(c),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,r(t,y)}function i(){if(!s){var e;clearTimeout(c),e=t.useXDR&&void 0===f.status?200:1223===f.status?204:f.status;var n=y,i=null;return 0!==e?(n={body:function(){var t=void 0;if(t=f.response?f.response:f.responseText||function(t){try{if("document"===t.responseType)return t.responseXML;var e=t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;if(""===t.responseType&&!e)return t.responseXML}catch(t){}return null}(f),m)try{t=JSON.parse(t)}catch(t){}return t}(),statusCode:e,method:d,headers:{},url:h,rawRequest:f},f.getAllResponseHeaders&&(n.headers=o(f.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),r(i,n,n.body)}}var a,s,f=t.xhr||null;f||(f=t.cors||t.useXDR?new u.XDomainRequest:new u.XMLHttpRequest);var c,h=f.url=t.uri||t.url,d=f.method=t.method||"GET",l=t.body||t.data,p=f.headers=t.headers||{},b=!!t.sync,m=!1,y={body:void 0,headers:{},statusCode:0,method:d,url:h,rawRequest:f};if("json"in t&&!1!==t.json&&(m=!0,p.accept||p.Accept||(p.Accept="application/json"),"GET"!==d&&"HEAD"!==d&&(p["content-type"]||p["Content-Type"]||(p["Content-Type"]="application/json"),l=JSON.stringify(!0===t.json?l:t.json))),f.onreadystatechange=function(){4===f.readyState&&setTimeout(i,0)},f.onload=i,f.onerror=n,f.onprogress=function(){},f.onabort=function(){s=!0},f.ontimeout=n,f.open(d,h,!b,t.username,t.password),b||(f.withCredentials=!!t.withCredentials),!b&&t.timeout>0&&(c=setTimeout(function(){if(!s){s=!0,f.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",n(t)}},t.timeout)),f.setRequestHeader)for(a in p)p.hasOwnProperty(a)&&f.setRequestHeader(a,p[a]);else if(t.headers&&!function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(f.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(f),f.send(l||null),f}e.exports=u,u.XMLHttpRequest=n.XMLHttpRequest||function(){},u.XDomainRequest="withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:n.XDomainRequest,function(t,e){for(var r=0;r1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},f.prototype.getCall=function(t){return n.isFunction(this.call)?this.call(t):this.call},f.prototype.extractCallback=function(t){if(n.isFunction(t[t.length-1]))return t.pop()},f.prototype.validateArgs=function(t){if(t.length!==this.params)throw i.InvalidNumberOfParams(t.length,this.params,this.name)},f.prototype.formatInput=function(t){var e=this;return this.inputFormatter?this.inputFormatter.map(function(r,n){return r?r.call(e,t[n]):t[n]}):t},f.prototype.formatOutput=function(t){var e=this;return n.isArray(t)?t.map(function(t){return e.outputFormatter&&t?e.outputFormatter(t):t}):this.outputFormatter&&t?this.outputFormatter(t):t},f.prototype.toPayload=function(t){var e=this.getCall(t),r=this.extractCallback(t),n=this.formatInput(t);this.validateArgs(n);var i={method:e,params:n,callback:r};return this.transformPayload&&(i=this.transformPayload(i)),i},f.prototype._confirmTransaction=function(t,e,r){var i=this,c=!1,h=!0,d=0,l=0,p=null,b=n.isObject(r.params[0])&&r.params[0].gas?r.params[0].gas:null,m=n.isObject(r.params[0])&&r.params[0].data&&r.params[0].from&&!r.params[0].to,y=[new f({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:o.outputTransactionReceiptFormatter}),new f({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[o.inputAddressFormatter,o.inputDefaultBlockNumberFormatter]}),new u({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:o.outputBlockFormatter}}})],v={};n.each(y,function(t){t.attachToObject(v),t.requestManager=i.requestManager});var g=function(r,n,o,u,f){if(!o)return f||(f={unsubscribe:function(){clearInterval(p)}}),(r?s.resolve(r):v.getTransactionReceipt(e)).catch(function(e){f.unsubscribe(),c=!0,a._fireError({message:"Failed to check for transaction receipt:",data:e},t.eventEmitter,t.reject)}).then(function(e){if(!e||!e.blockHash)throw new Error("Receipt missing or blockHash null");return i.extraFormatters&&i.extraFormatters.receiptFormatter&&(e=i.extraFormatters.receiptFormatter(e)),t.eventEmitter.listeners("confirmation").length>0&&(void 0!==r&&0===l||t.eventEmitter.emit("confirmation",l,e),h=!1,25===++l&&(f.unsubscribe(),t.eventEmitter.removeAllListeners())),e}).then(function(e){if(m&&!c){if(!e.contractAddress)return h&&(f.unsubscribe(),c=!0),void a._fireError(new Error("The transaction receipt didn't contain a contract address."),t.eventEmitter,t.reject);v.getCode(e.contractAddress,function(r,n){n&&(n.length>2?(t.eventEmitter.emit("receipt",e),i.extraFormatters&&i.extraFormatters.contractDeployFormatter?t.resolve(i.extraFormatters.contractDeployFormatter(e)):t.resolve(e),h&&t.eventEmitter.removeAllListeners()):a._fireError(new Error("The contract code couldn't be stored, please check your gas limit."),t.eventEmitter,t.reject),h&&f.unsubscribe(),c=!0)})}return e}).then(function(e){m||c||(e.outOfGas||b&&b===e.gasUsed||!0!==e.status&&"0x1"!==e.status&&void 0!==e.status?(e&&(e=JSON.stringify(e,null,2)),!1===e.status||"0x0"===e.status?a._fireError(new Error("Transaction has been reverted by the EVM:\n"+e),t.eventEmitter,t.reject):a._fireError(new Error("Transaction ran out of gas. Please provide more gas:\n"+e),t.eventEmitter,t.reject)):(t.eventEmitter.emit("receipt",e),t.resolve(e),h&&t.eventEmitter.removeAllListeners()),h&&f.unsubscribe(),c=!0)}).catch(function(){d++,n?d-1>=750&&(f.unsubscribe(),c=!0,a._fireError(new Error("Transaction was not mined within750 seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),t.eventEmitter,t.reject)):d-1>=50&&(f.unsubscribe(),c=!0,a._fireError(new Error("Transaction was not mined within 50 blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),t.eventEmitter,t.reject))});f.unsubscribe(),c=!0,a._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:o},t.eventEmitter,t.reject)},w=function(t){n.isFunction(this.requestManager.provider.on)?v.subscribe("newBlockHeaders",g.bind(null,t,!1)):p=setInterval(g.bind(null,t,!0),1e3)}.bind(this);v.getTransactionReceipt(e).then(function(e){e&&e.blockHash?(t.eventEmitter.listeners("confirmation").length>0&&w(e),g(e,!1)):c||w()}).catch(function(){c||w()})};var c=function(t,e){return n.isNumber(t)?e.wallet[t]:n.isObject(t)&&t.address&&t.privateKey?t:e.wallet[t.toLowerCase()]};f.prototype.buildCall=function(){var t=this,e="eth_sendTransaction"===t.call||"eth_sendRawTransaction"===t.call,r=function(){var r=s(!e),i=t.toPayload(Array.prototype.slice.call(arguments)),o=function(n,o){try{o=t.formatOutput(o)}catch(t){n=t}if(o instanceof Error&&(n=o),n)return n.error&&(n=n.error),a._fireError(n,r.eventEmitter,r.reject,i.callback);i.callback&&i.callback(null,o),e?(r.eventEmitter.emit("transactionHash",o),t._confirmTransaction(r,o,i)):n||r.resolve(o)},u=function(e){var r=n.extend({},i,{method:"eth_sendRawTransaction",params:[e.rawTransaction]});t.requestManager.send(r,o)},h=function(t,e){var i;if(e&&e.accounts&&e.accounts.wallet&&e.accounts.wallet.length)if("eth_sendTransaction"===t.method){var a=t.params[0];if((i=c(n.isObject(a)?a.from:null,e.accounts))&&i.privateKey)return e.accounts.signTransaction(n.omit(a,"from"),i.privateKey).then(u)}else if("eth_sign"===t.method){var s=t.params[1];if((i=c(t.params[0],e.accounts))&&i.privateKey){var f=e.accounts.sign(s,i.privateKey);return t.callback&&t.callback(null,f.signature),void r.resolve(f.signature)}}return e.requestManager.send(t,o)};e&&n.isObject(i.params[0])&&!i.params[0].gasPrice?new f({name:"getGasPrice",call:"eth_gasPrice",params:0}).createFunction(t.requestManager)(function(e,r){r&&(i.params[0].gasPrice=r),h(i,t)}):h(i,t);return r.eventEmitter};return r.method=t,r.request=this.request.bind(this),r},f.prototype.request=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));return t.format=this.formatOutput.bind(this),t},e.exports=f},{underscore:192,"web3-core-helpers":191,"web3-core-promievent":198,"web3-core-subscriptions":206,"web3-utils":393}],194:[function(t,e,r){e.exports=t("./register")().Promise},{"./register":196}],195:[function(t,e,r){var n="@@any-promise/REGISTRATION",i=null;e.exports=function(t,e){return function(r,o){r=r||null;var a=!1!==(o=o||{}).global;if(null===i&&a&&(i=t[n]||null),null!==i&&null!==r&&i.implementation!==r)throw new Error('any-promise already defined as "'+i.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return null===i&&(i=null!==r&&void 0!==o.Promise?{Promise:o.Promise,implementation:r}:e(r),a&&(t[n]=i)),i}}},{}],196:[function(t,e,r){e.exports=t("./loader")(window,function(){if(void 0===window.Promise)throw new Error("any-promise browser requires a polyfill or explicit registration e.g: require('any-promise/register/bluebird')");return{Promise:window.Promise,implementation:"window.Promise"}})},{"./loader":195}],197:[function(t,e,r){var n="function"!=typeof Object.create&&"~";function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(){}o.prototype._events=void 0,o.prototype.listeners=function(t,e){var r=n?n+t:t,i=this._events&&this._events[r];if(e)return!!i;if(!i)return[];if(i.fn)return[i.fn];for(var o=0,a=i.length,s=new Array(a);o1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},i.prototype.buildCall=function(){var t=this;return function(){t.subscriptions[arguments[0]]||console.warn("Subscription "+JSON.stringify(arguments[0])+" doesn't exist. Subscribing anyway.");var e=new n({subscription:t.subscriptions[arguments[0]],requestManager:t.requestManager,type:t.type});return e.subscribe.apply(e,arguments)}},e.exports={subscriptions:i,subscription:n}},{"./subscription.js":207}],207:[function(t,e,r){var n=t("underscore"),i=t("web3-core-helpers").errors,o=t("eventemitter3");function a(t){o.call(this),this.id=null,this.callback=null,this.arguments=null,this._reconnectIntervalId=null,this.options={subscription:t.subscription,type:t.type,requestManager:t.requestManager}}a.prototype=Object.create(o.prototype),a.prototype.constructor=a,a.prototype._extractCallback=function(t){if(n.isFunction(t[t.length-1]))return t.pop()},a.prototype._validateArgs=function(t){var e=this.options.subscription;if(e||(e={}),e.params||(e.params=0),t.length!==e.params)throw i.InvalidNumberOfParams(t.length,e.params+1,t[0])},a.prototype._formatInput=function(t){var e=this.options.subscription;return e&&e.inputFormatter?e.inputFormatter.map(function(e,r){return e?e(t[r]):t[r]}):t},a.prototype._formatOutput=function(t){var e=this.options.subscription;return e&&e.outputFormatter&&t?e.outputFormatter(t):t},a.prototype._toPayload=function(t){var e=[];if(this.callback=this._extractCallback(t),this.subscriptionMethod||(this.subscriptionMethod=t.shift(),this.options.subscription.subscriptionName&&(this.subscriptionMethod=this.options.subscription.subscriptionName)),this.arguments||(this.arguments=this._formatInput(t),this._validateArgs(this.arguments),t=[]),e.push(this.subscriptionMethod),e=e.concat(this.arguments),t.length)throw new Error("Only a callback is allowed as parameter on an already instantiated subscription.");return{method:this.options.type+"_subscribe",params:e}},a.prototype.unsubscribe=function(t){this.options.requestManager.removeSubscription(this.id,t),this.id=null,this.removeAllListeners(),clearInterval(this._reconnectIntervalId)},a.prototype.subscribe=function(){var t=this,e=Array.prototype.slice.call(arguments),r=this._toPayload(e);if(!r)return this;if(!this.options.requestManager.provider){var i=new Error("No provider set.");return this.callback(i,null,this),this.emit("error",i),this}if(!this.options.requestManager.provider.on){var o=new Error("The current provider doesn't support subscriptions: "+this.options.requestManager.provider.constructor.name);return this.callback(o,null,this),this.emit("error",o),this}return this.id&&this.unsubscribe(),this.options.params=r.params[1],"logs"===r.params[0]&&n.isObject(r.params[1])&&r.params[1].hasOwnProperty("fromBlock")&&isFinite(r.params[1].fromBlock)&&this.options.requestManager.send({method:"eth_getLogs",params:[r.params[1]]},function(e,r){e?(t.callback(e,null,t),t.emit("error",e)):r.forEach(function(e){var r=t._formatOutput(e);t.callback(null,r,t),t.emit("data",r)})}),"object"===_typeof(r.params[1])&&delete r.params[1].fromBlock,this.options.requestManager.send(r,function(e,i){!e&&i?(t.id=i,t.options.requestManager.addSubscription(t.id,r.params[0],t.options.type,function(e,r){e?(t.options.requestManager.removeSubscription(t.id),t.options.requestManager.provider.once&&(t._reconnectIntervalId=setInterval(function(){t.options.requestManager.provider.reconnect&&t.options.requestManager.provider.reconnect()},500),t.options.requestManager.provider.once("connect",function(){clearInterval(t._reconnectIntervalId),t.subscribe(t.callback)})),t.emit("error",e),n.isFunction(t.callback)&&t.callback(e,null,t)):(n.isArray(r)||(r=[r]),r.forEach(function(e){var r=t._formatOutput(e);if(n.isFunction(t.options.subscription.subscriptionHandler))return t.options.subscription.subscriptionHandler.call(t,r);t.emit("data",r),n.isFunction(t.callback)&&t.callback(null,r,t)}))})):n.isFunction(t.callback)?(t.callback(e,null,t),t.emit("error",e)):t.emit("error",e)}),this},e.exports=a},{eventemitter3:204,underscore:205,"web3-core-helpers":191}],208:[function(t,e,r){var n=t("web3-core-helpers").formatters,i=t("web3-core-method"),o=t("web3-utils");e.exports=function(t){var e=function(e){var r;return e.property?(t[e.property]||(t[e.property]={}),r=t[e.property]):r=t,e.methods&&e.methods.forEach(function(e){e instanceof i||(e=new i(e)),e.attachToObject(r),e.setRequestManager(t._requestManager)}),t};return e.formatters=n,e.utils=o,e.Method=i,e}},{"web3-core-helpers":191,"web3-core-method":193,"web3-utils":393}],209:[function(t,e,r){var n=t("web3-core-requestmanager"),i=t("./extend.js");e.exports={packageInit:function(t,e){if(e=Array.prototype.slice.call(e),!t)throw new Error('You need to instantiate using the "new" keyword.');Object.defineProperty(t,"currentProvider",{get:function(){return t._provider},set:function(e){return t.setProvider(e)},enumerable:!0,configurable:!0}),e[0]&&e[0]._requestManager?t._requestManager=new n.Manager(e[0].currentProvider):(t._requestManager=new n.Manager,t._requestManager.setProvider(e[0],e[1])),t.givenProvider=n.Manager.givenProvider,t.providers=n.Manager.providers,t._provider=t._requestManager.provider,t.setProvider||(t.setProvider=function(e,r){return t._requestManager.setProvider(e,r),t._provider=t._requestManager.provider,!0}),t.BatchRequest=n.BatchManager.bind(null,t._requestManager),t.extend=i(t)},addProviders:function(t){t.givenProvider=n.Manager.givenProvider,t.providers=n.Manager.providers}}},{"./extend.js":208,"web3-core-requestmanager":202}],210:[function(t,e,r){!function(e,r){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===(void 0===e?"undefined":_typeof(e))?e.exports=o:r.BN=o,o.BN=o,o.wordSize=26;try{a=t("buffer").Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===(void 0===t?"undefined":_typeof(t))&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"===(void 0===t?"undefined":_typeof(t)))return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,f=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var f=1;f>>26,h=67108863&u,d=Math.min(f,e.length-1),l=Math.max(0,f-t.length+1);l<=d;l++){var p=f-l|0;c+=(a=(i=0|t.words[p])*(o=0|e.words[l])+h)/67108864|0,h=67108863&a}r.words[f]=0|h,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=c[t],l=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?b+r:f[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,f=new t(o),c=this.clone();if(u){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),f[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,l=0|a[1],p=8191&l,b=l>>>13,m=0|a[2],y=8191&m,v=m>>>13,g=0|a[3],w=8191&g,_=g>>>13,M=0|a[4],x=8191&M,k=M>>>13,S=0|a[5],E=8191&S,A=S>>>13,j=0|a[6],I=8191&j,B=j>>>13,T=0|a[7],C=8191&T,P=T>>>13,R=0|a[8],O=8191&R,N=R>>>13,L=0|a[9],F=8191&L,q=L>>>13,D=0|s[0],U=8191&D,z=D>>>13,K=0|s[1],H=8191&K,V=K>>>13,W=0|s[2],X=8191&W,G=W>>>13,J=0|s[3],Z=8191&J,$=J>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ft=st>>>13,ct=0|s[8],ht=8191&ct,dt=ct>>>13,lt=0|s[9],pt=8191<,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(f+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,z))+Math.imul(d,U)|0))<<13)|0;f=((o=Math.imul(d,z))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,z))+Math.imul(b,U)|0,o=Math.imul(b,z);var yt=(f+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,V)|0)+Math.imul(d,H)|0))<<13)|0;f=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,z))+Math.imul(v,U)|0,o=Math.imul(v,z),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,V)|0;var vt=(f+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(d,X)|0))<<13)|0;f=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,z))+Math.imul(_,U)|0,o=Math.imul(_,z),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,G)|0;var gt=(f+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,$)|0)+Math.imul(d,Z)|0))<<13)|0;f=((o=o+Math.imul(d,$)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,z))+Math.imul(k,U)|0,o=Math.imul(k,z),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,$)|0;var wt=(f+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,Q)|0))<<13)|0;f=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,z))+Math.imul(A,U)|0,o=Math.imul(A,z),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var _t=(f+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;f=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,z))+Math.imul(B,U)|0,o=Math.imul(B,z),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var Mt=(f+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(d,ot)|0))<<13)|0;f=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,z))+Math.imul(P,U)|0,o=Math.imul(P,z),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0;var xt=(f+(n=n+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(d,ut)|0))<<13)|0;f=((o=o+Math.imul(d,ft)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,z))+Math.imul(N,U)|0,o=Math.imul(N,z),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,$)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0;var kt=(f+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;f=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,z))+Math.imul(q,U)|0,o=Math.imul(q,z),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,G)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ft)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,dt)|0;var St=(f+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(d,pt)|0))<<13)|0;f=((o=o+Math.imul(d,bt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(F,H),i=(i=Math.imul(F,V))+Math.imul(q,H)|0,o=Math.imul(q,V),n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,$)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ft)|0,n=n+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,dt)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,dt)|0;var Et=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(F,X),i=(i=Math.imul(F,G))+Math.imul(q,X)|0,o=Math.imul(q,G),n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ft)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,dt)|0;var At=(f+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,bt)|0)+Math.imul(v,pt)|0))<<13)|0;f=((o=o+Math.imul(v,bt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(F,Z),i=(i=Math.imul(F,$))+Math.imul(q,Z)|0,o=Math.imul(q,$),n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ft)|0,n=n+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,dt)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,dt)|0;var jt=(f+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;f=((o=o+Math.imul(_,bt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,tt))+Math.imul(q,Q)|0,o=Math.imul(q,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ft)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ft)|0,n=n+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,dt)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,dt)|0;var It=(f+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(k,pt)|0))<<13)|0;f=((o=o+Math.imul(k,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(F,rt),i=(i=Math.imul(F,nt))+Math.imul(q,rt)|0,o=Math.imul(q,nt),n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ft)|0,n=n+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(B,ht)|0,o=o+Math.imul(B,dt)|0;var Bt=(f+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,bt)|0)+Math.imul(A,pt)|0))<<13)|0;f=((o=o+Math.imul(A,bt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(F,ot),i=(i=Math.imul(F,at))+Math.imul(q,ot)|0,o=Math.imul(q,at),n=n+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ft)|0,n=n+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,dt)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,dt)|0;var Tt=(f+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,bt)|0)+Math.imul(B,pt)|0))<<13)|0;f=((o=o+Math.imul(B,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(F,ut),i=(i=Math.imul(F,ft))+Math.imul(q,ut)|0,o=Math.imul(q,ft),n=n+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,dt)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,dt)|0;var Ct=(f+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,bt)|0)+Math.imul(P,pt)|0))<<13)|0;f=((o=o+Math.imul(P,bt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(F,ht),i=(i=Math.imul(F,dt))+Math.imul(q,ht)|0,o=Math.imul(q,dt);var Pt=(f+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,bt)|0)+Math.imul(N,pt)|0))<<13)|0;f=((o=o+Math.imul(N,bt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Rt=(f+(n=Math.imul(F,pt))|0)+((8191&(i=(i=Math.imul(F,bt))+Math.imul(q,pt)|0))<<13)|0;return f=((o=Math.imul(q,bt))+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,u[0]=mt,u[1]=yt,u[2]=vt,u[3]=gt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=xt,u[8]=kt,u[9]=St,u[10]=Et,u[11]=At,u[12]=jt,u[13]=It,u[14]=Bt,u[15]=Tt,u[16]=Ct,u[17]=Pt,u[18]=Rt,0!==f&&(u[19]=f,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(l=d),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?l(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,f=0;f=0&&(0!==c||f>=i);f--){var h=0|this.words[f];this.words[f]=c<<26-o|h>>>o,c=h&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var f=0;f=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),f=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++f;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(h)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0==(e.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(e.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(v,y),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new g;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=a;0!==l.cmp(s);){for(var b=l,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m=0;n--){for(var f=e.words[n],c=u-1;c>=0;c--){var h=f>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new x(t)},i(x,M),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{}],211:[function(t,e,r){arguments[4][178][0].apply(r,arguments)},{dup:178}],212:[function(t,e,r){var n=t("underscore"),i=t("web3-utils"),o=t("bn.js"),a=t("./param"),s=function(t){return n.isNumber(t)&&(t=Math.trunc(t)),new a(i.toTwosComplement(t).replace("0x",""))};e.exports={formatInputInt:s,formatInputBytes:function(t){if(!i.isHexStrict(t))throw new Error('Given parameter is not bytes: "'+t+'"');var e=t.replace(/^0x/i,"");if(e.length%2!=0)throw new Error('Given parameter bytes has an invalid length: "'+t+'"');if(e.length>64)throw new Error('Given parameter bytes is too long: "'+t+'"');var r=Math.floor((e.length+63)/64);return e=i.padRight(e,64*r),new a(e)},formatInputDynamicBytes:function(t){if(!i.isHexStrict(t))throw new Error('Given parameter is not bytes: "'+t+'"');var e=t.replace(/^0x/i,"");if(e.length%2!=0)throw new Error('Given parameter bytes has an invalid length: "'+t+'"');var r=e.length/2,n=Math.floor((e.length+63)/64);return e=i.padRight(e,64*n),new a(s(r).value+e)},formatInputString:function(t){if(!n.isString(t))throw new Error("Given parameter is not a valid string: "+t);var e=i.utf8ToHex(t).replace(/^0x/i,""),r=e.length/2,o=Math.floor((e.length+63)/64);return e=i.padRight(e,64*o),new a(s(r).value+e)},formatInputBool:function(t){return new a("000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0"))},formatOutputInt:function(t){var e=t.staticPart();if(!e&&!t.rawValue)throw new Error("Couldn't decode "+name+" from ABI: 0x"+t.rawValue);return"1"===new o(e.substr(0,1),16).toString(2).substr(0,1)?new o(e,16).fromTwos(256).toString(10):new o(e,16).toString(10)},formatOutputUInt:function(t,e){var r=t.staticPart();if(!r&&!t.rawValue)throw new Error("Couldn't decode "+e+" from ABI: 0x"+t.rawValue);return new o(r,16).toString(10)},formatOutputBool:function(t,e){var r=t.staticPart();if(!r&&!t.rawValue)throw new Error("Couldn't decode "+e+" from ABI: 0x"+t.rawValue);return"0000000000000000000000000000000000000000000000000000000000000001"===r},formatOutputBytes:function(t,e){var r=e.match(/^bytes([0-9]*)/),n=parseInt(r[1]);if(t.staticPart().slice(0,2*n).length!==2*n)throw new Error("Couldn't decode "+e+" from ABI: 0x"+t.rawValue+" The size doesn't match.");return"0x"+t.staticPart().slice(0,2*n)},formatOutputDynamicBytes:function(t,e){var r=t.dynamicPart().slice(0,64);if(!r)throw new Error("Couldn't decode "+e+" from ABI: 0x"+t.rawValue);var n=2*new o(r,16).toNumber();return"0x"+t.dynamicPart().substr(64,n)},formatOutputString:function(t){var e=t.dynamicPart().slice(0,64);if(!e)throw new Error("ERROR: The returned value is not a convertible string:"+e);var r=2*new o(e,16).toNumber();return r?i.hexToUtf8("0x"+t.dynamicPart().substr(64,r).replace(/^0x/i,"")):""},formatOutputAddress:function(t,e){var r=t.staticPart();if(!r)throw new Error("Couldn't decode "+e+" from ABI: 0x"+t.rawValue);return i.toChecksumAddress("0x"+r.slice(r.length-40,r.length))},toTwosComplement:i.toTwosComplement}},{"./param":214,"bn.js":210,underscore:211,"web3-utils":393}],213:[function(t,e,r){var n=t("underscore"),i=t("web3-utils"),o=t("./formatters"),a=t("./types/address"),s=t("./types/bool"),u=t("./types/int"),f=t("./types/uint"),c=t("./types/dynamicbytes"),h=t("./types/string"),d=t("./types/bytes"),l=function(t,e){return t.isDynamicType(e)||t.isDynamicArray(e)};function p(){}var b=function(t){this._types=t};b.prototype._requireType=function(t){var e=this._types.filter(function(e){return e.isType(t)})[0];if(!e)throw Error("Invalid solidity type: "+t);return e},b.prototype._getOffsets=function(t,e){for(var r=e.map(function(e,r){return e.staticPartLength(t[r])}),n=1;n=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===(void 0===t?"undefined":_typeof(t))&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"===(void 0===t?"undefined":_typeof(t)))return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,f=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var f=1;f>>26,h=67108863&u,d=Math.min(f,e.length-1),l=Math.max(0,f-t.length+1);l<=d;l++){var p=f-l|0;c+=(a=(i=0|t.words[p])*(o=0|e.words[l])+h)/67108864|0,h=67108863&a}r.words[f]=0|h,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=c[t],l=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?b+r:f[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,f=new t(o),c=this.clone();if(u){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),f[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,l=0|a[1],p=8191&l,b=l>>>13,m=0|a[2],y=8191&m,v=m>>>13,g=0|a[3],w=8191&g,_=g>>>13,M=0|a[4],x=8191&M,k=M>>>13,S=0|a[5],E=8191&S,A=S>>>13,j=0|a[6],I=8191&j,B=j>>>13,T=0|a[7],C=8191&T,P=T>>>13,R=0|a[8],O=8191&R,N=R>>>13,L=0|a[9],F=8191&L,q=L>>>13,D=0|s[0],U=8191&D,z=D>>>13,K=0|s[1],H=8191&K,V=K>>>13,W=0|s[2],X=8191&W,G=W>>>13,J=0|s[3],Z=8191&J,$=J>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ft=st>>>13,ct=0|s[8],ht=8191&ct,dt=ct>>>13,lt=0|s[9],pt=8191<,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(f+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,z))+Math.imul(d,U)|0))<<13)|0;f=((o=Math.imul(d,z))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,z))+Math.imul(b,U)|0,o=Math.imul(b,z);var yt=(f+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,V)|0)+Math.imul(d,H)|0))<<13)|0;f=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,z))+Math.imul(v,U)|0,o=Math.imul(v,z),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,V)|0;var vt=(f+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(d,X)|0))<<13)|0;f=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,z))+Math.imul(_,U)|0,o=Math.imul(_,z),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,G)|0;var gt=(f+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,$)|0)+Math.imul(d,Z)|0))<<13)|0;f=((o=o+Math.imul(d,$)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,z))+Math.imul(k,U)|0,o=Math.imul(k,z),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,$)|0;var wt=(f+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,Q)|0))<<13)|0;f=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,z))+Math.imul(A,U)|0,o=Math.imul(A,z),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var _t=(f+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;f=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,z))+Math.imul(B,U)|0,o=Math.imul(B,z),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var Mt=(f+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(d,ot)|0))<<13)|0;f=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,z))+Math.imul(P,U)|0,o=Math.imul(P,z),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0;var xt=(f+(n=n+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(d,ut)|0))<<13)|0;f=((o=o+Math.imul(d,ft)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,z))+Math.imul(N,U)|0,o=Math.imul(N,z),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,$)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0;var kt=(f+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;f=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,z))+Math.imul(q,U)|0,o=Math.imul(q,z),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,G)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ft)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,dt)|0;var St=(f+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(d,pt)|0))<<13)|0;f=((o=o+Math.imul(d,bt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(F,H),i=(i=Math.imul(F,V))+Math.imul(q,H)|0,o=Math.imul(q,V),n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,$)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ft)|0,n=n+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,dt)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,dt)|0;var Et=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(F,X),i=(i=Math.imul(F,G))+Math.imul(q,X)|0,o=Math.imul(q,G),n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ft)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,dt)|0;var At=(f+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,bt)|0)+Math.imul(v,pt)|0))<<13)|0;f=((o=o+Math.imul(v,bt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(F,Z),i=(i=Math.imul(F,$))+Math.imul(q,Z)|0,o=Math.imul(q,$),n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ft)|0,n=n+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,dt)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,dt)|0;var jt=(f+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;f=((o=o+Math.imul(_,bt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,tt))+Math.imul(q,Q)|0,o=Math.imul(q,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ft)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,ft)|0,n=n+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,dt)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,dt)|0;var It=(f+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(k,pt)|0))<<13)|0;f=((o=o+Math.imul(k,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(F,rt),i=(i=Math.imul(F,nt))+Math.imul(q,rt)|0,o=Math.imul(q,nt),n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ft)|0,n=n+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(B,ht)|0,o=o+Math.imul(B,dt)|0;var Bt=(f+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,bt)|0)+Math.imul(A,pt)|0))<<13)|0;f=((o=o+Math.imul(A,bt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(F,ot),i=(i=Math.imul(F,at))+Math.imul(q,ot)|0,o=Math.imul(q,at),n=n+Math.imul(O,ut)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ft)|0,n=n+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,dt)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,dt)|0;var Tt=(f+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,bt)|0)+Math.imul(B,pt)|0))<<13)|0;f=((o=o+Math.imul(B,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(F,ut),i=(i=Math.imul(F,ft))+Math.imul(q,ut)|0,o=Math.imul(q,ft),n=n+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,dt)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,dt)|0;var Ct=(f+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,bt)|0)+Math.imul(P,pt)|0))<<13)|0;f=((o=o+Math.imul(P,bt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(F,ht),i=(i=Math.imul(F,dt))+Math.imul(q,ht)|0,o=Math.imul(q,dt);var Pt=(f+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,bt)|0)+Math.imul(N,pt)|0))<<13)|0;f=((o=o+Math.imul(N,bt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Rt=(f+(n=Math.imul(F,pt))|0)+((8191&(i=(i=Math.imul(F,bt))+Math.imul(q,pt)|0))<<13)|0;return f=((o=Math.imul(q,bt))+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,u[0]=mt,u[1]=yt,u[2]=vt,u[3]=gt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=xt,u[8]=kt,u[9]=St,u[10]=Et,u[11]=At,u[12]=jt,u[13]=It,u[14]=Bt,u[15]=Tt,u[16]=Ct,u[17]=Pt,u[18]=Rt,0!==f&&(u[19]=f,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(l=d),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?l(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,f=0;f=0&&(0!==c||f>=i);f--){var h=0|this.words[f];this.words[f]=c<<26-o|h>>>o,c=h&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var f=0;f=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),f=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++f;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(h)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0==(e.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(e.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(v,y),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new g;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=a;0!==l.cmp(s);){for(var b=l,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m=0;n--){for(var f=e.words[n],c=u-1;c>=0;c--){var h=f>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new x(t)},i(x,M),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:17}],241:[function(t,e,r){arguments[4][16][0].apply(r,arguments)},{crypto:17,dup:16}],242:[function(t,e,r){arguments[4][18][0].apply(r,arguments)},{dup:18,"safe-buffer":350}],243:[function(t,e,r){arguments[4][19][0].apply(r,arguments)},{"./aes":242,"./ghash":247,"./incr32":248,"buffer-xor":269,"cipher-base":270,dup:19,inherits:325,"safe-buffer":350}],244:[function(t,e,r){arguments[4][20][0].apply(r,arguments)},{"./decrypter":245,"./encrypter":246,"./modes/list.json":256,dup:20}],245:[function(t,e,r){arguments[4][21][0].apply(r,arguments)},{"./aes":242,"./authCipher":243,"./modes":255,"./streamCipher":258,"cipher-base":270,dup:21,evp_bytestokey:310,inherits:325,"safe-buffer":350}],246:[function(t,e,r){arguments[4][22][0].apply(r,arguments)},{"./aes":242,"./authCipher":243,"./modes":255,"./streamCipher":258,"cipher-base":270,dup:22,evp_bytestokey:310,inherits:325,"safe-buffer":350}],247:[function(t,e,r){arguments[4][23][0].apply(r,arguments)},{dup:23,"safe-buffer":350}],248:[function(t,e,r){arguments[4][24][0].apply(r,arguments)},{dup:24}],249:[function(t,e,r){arguments[4][25][0].apply(r,arguments)},{"buffer-xor":269,dup:25}],250:[function(t,e,r){arguments[4][26][0].apply(r,arguments)},{"buffer-xor":269,dup:26,"safe-buffer":350}],251:[function(t,e,r){arguments[4][27][0].apply(r,arguments)},{dup:27,"safe-buffer":350}],252:[function(t,e,r){arguments[4][28][0].apply(r,arguments)},{dup:28,"safe-buffer":350}],253:[function(t,e,r){arguments[4][29][0].apply(r,arguments)},{"../incr32":248,"buffer-xor":269,dup:29,"safe-buffer":350}],254:[function(t,e,r){arguments[4][30][0].apply(r,arguments)},{dup:30}],255:[function(t,e,r){arguments[4][31][0].apply(r,arguments)},{"./cbc":249,"./cfb":250,"./cfb1":251,"./cfb8":252,"./ctr":253,"./ecb":254,"./list.json":256,"./ofb":257,dup:31}],256:[function(t,e,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],257:[function(t,e,r){(function(e){var n=t("buffer-xor");r.encrypt=function(t,r){for(;t._cache.length=0||!r.umod(t.prime1)||!r.umod(t.prime2);)r=new n(i(e));return r}e.exports=o,o.getr=a}).call(this,t("buffer").Buffer)},{"bn.js":240,buffer:47,randombytes:347}],263:[function(t,e,r){arguments[4][39][0].apply(r,arguments)},{"./browser/algorithms.json":264,dup:39}],264:[function(t,e,r){arguments[4][40][0].apply(r,arguments)},{dup:40}],265:[function(t,e,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],266:[function(t,e,r){(function(r){var n=t("create-hash"),i=t("stream"),o=t("inherits"),a=t("./sign"),s=t("./verify"),u=t("./algorithms.json");function f(t){i.Writable.call(this);var e=u[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function c(t){i.Writable.call(this);var e=u[t];if(!e)throw new Error("Unknown message digest");this._hash=n(e.hash),this._tag=e.id,this._signType=e.sign}function h(t){return new f(t)}function d(t){return new c(t)}Object.keys(u).forEach(function(t){u[t].id=new r(u[t].id,"hex"),u[t.toLowerCase()]=u[t]}),o(f,i.Writable),f.prototype._write=function(t,e,r){this._hash.update(t),r()},f.prototype.update=function(t,e){return"string"==typeof t&&(t=new r(t,e)),this._hash.update(t),this},f.prototype.sign=function(t,e){this.end();var r=this._hash.digest(),n=a(r,t,this._hashType,this._signType,this._tag);return e?n.toString(e):n},o(c,i.Writable),c.prototype._write=function(t,e,r){this._hash.update(t),r()},c.prototype.update=function(t,e){return"string"==typeof t&&(t=new r(t,e)),this._hash.update(t),this},c.prototype.verify=function(t,e,n){"string"==typeof e&&(e=new r(e,n)),this.end();var i=this._hash.digest();return s(e,i,t,this._signType,this._tag)},e.exports={Sign:h,Verify:d,createSign:h,createVerify:d}}).call(this,t("buffer").Buffer)},{"./algorithms.json":264,"./sign":267,"./verify":268,buffer:47,"create-hash":272,inherits:325,stream:156}],267:[function(t,e,r){(function(r){var n=t("create-hmac"),i=t("browserify-rsa"),o=t("elliptic").ec,a=t("bn.js"),s=t("parse-asn1"),u=t("./curves.json");function f(t,e,i,o){if((t=new r(t.toArray())).length0&&r.ishrn(n),r}function h(t,e,i){var o,a;do{for(o=new r(0);8*o.length=e)throw new Error("invalid sig")}e.exports=function(t,e,u,f,c){var h=o(u);if("ec"===h.type){if("ecdsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");return function(t,e,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var o=new i(n),s=r.data.subjectPrivateKey.data;return o.verify(e,t,s)}(t,e,h)}if("dsa"===h.type){if("dsa"!==f)throw new Error("wrong public key type");return function(t,e,r){var i=r.data.p,a=r.data.q,u=r.data.g,f=r.data.pub_key,c=o.signature.decode(t,"der"),h=c.s,d=c.r;s(h,a),s(d,a);var l=n.mont(i),p=h.invm(a);return 0===u.toRed(l).redPow(new n(e).mul(p).mod(a)).fromRed().mul(f.toRed(l).redPow(d.mul(p).mod(a)).fromRed()).mod(i).mod(a).cmp(d)}(t,e,h)}if("rsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");e=r.concat([c,e]);for(var d=h.modulus.byteLength(),l=[1],p=0;e.length+l.length+2>>2),a=0,s=0;a=6.0.0 <7.0.0",type:"range"},"/Users/frozeman/Sites/_ethereum/web3/packages/web3-eth-accounts/node_modules/browserify-sign"]],_from:"elliptic@>=6.0.0 <7.0.0",_id:"elliptic@6.4.0",_inCache:!0,_location:"/elliptic",_nodeVersion:"7.0.0",_npmOperationalInternal:{host:"packages-18-east.internal.npmjs.com",tmp:"tmp/elliptic-6.4.0.tgz_1487798866428_0.30510620190761983"},_npmUser:{name:"indutny",email:"fedor@indutny.com"},_npmVersion:"3.10.8",_phantomChildren:{},_requested:{raw:"elliptic@^6.0.0",scope:null,escapedName:"elliptic",name:"elliptic",rawSpec:"^6.0.0",spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh","/eth-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",_shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/Users/frozeman/Sites/_ethereum/web3/packages/web3-eth-accounts/node_modules/browserify-sign",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz"},files:["lib"],gitHead:"6b0d2b76caae91471649c8e21f0b1d3ba0f96090",homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.0"}},{}],304:[function(t,e,r){(function(r){var n=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=t("./bytes"),o=t("./nat"),a=t("elliptic"),s=(t("./rlp"),new a.ec("secp256k1")),u=t("./hash"),f=u.keccak256,c=u.keccak256s,h=function(t){for(var e=c(t.slice(2)),r="0x",n=0;n<40;n++)r+=parseInt(e[n+2],16)>7?t[n+2].toUpperCase():t[n+2];return r},d=function(t){var e=new r(t.slice(2),"hex"),n="0x"+s.keyFromPrivate(e).getPublic(!1,"hex").slice(2),i=f(n);return{address:h("0x"+i.slice(-40)),privateKey:t}},l=function(t){var e=n(t,3),r=e[0],o=i.pad(32,e[1]),a=i.pad(32,e[2]);return i.flatten([o,a,r])},p=function(t){return[i.slice(64,i.length(t),t),i.slice(0,32,t),i.slice(32,64,t)]},b=function(t){return function(e,n){var a=s.keyFromPrivate(new r(n.slice(2),"hex")).sign(new r(e.slice(2),"hex"),{canonical:!0});return l([o.fromString(i.fromNumber(t+a.recoveryParam)),i.pad(32,i.fromNat("0x"+a.r.toString(16))),i.pad(32,i.fromNat("0x"+a.s.toString(16)))])}},m=b(27);e.exports={create:function(t){var e=f(i.concat(i.random(32),t||i.random(32))),r=i.concat(i.concat(i.random(32),e),i.random(32)),n=f(r);return d(n)},toChecksum:h,fromPrivate:d,sign:m,makeSigner:b,recover:function(t,e){var n=p(e),o={v:i.toNumber(n[0]),r:n[1].slice(2),s:n[2].slice(2)},a="0x"+s.recoverPubKey(new r(t.slice(2),"hex"),o,o.v<2?o.v:1-o.v%2).encode("hex",!1).slice(2),u=f(a);return h("0x"+u.slice(-40))},encodeSignature:l,decodeSignature:p}}).call(this,t("buffer").Buffer)},{"./bytes":306,"./hash":307,"./nat":308,"./rlp":309,buffer:47,elliptic:288}],305:[function(t,e,r){arguments[4][163][0].apply(r,arguments)},{dup:163}],306:[function(t,e,r){arguments[4][164][0].apply(r,arguments)},{"./array.js":305,dup:164}],307:[function(t,e,r){arguments[4][165][0].apply(r,arguments)},{dup:165}],308:[function(t,e,r){var n=t("bn.js"),i=t("./bytes"),o=function(t){return new n(t.slice(2),16)},a=function(t){var e="0x"+("0x"===t.slice(0,2)?new n(t.slice(2),16):new n(t,10)).toString("hex");return"0x0"===e?"0x":e},s=function(t){return"string"==typeof t?/^0x/.test(t)?t:"0x"+t:"0x"+new n(t).toString("hex")},u=function(t){return o(t).toNumber()},f=function(t){return function(e,r){return"0x"+o(e)[t](o(r)).toString("hex")}},c=f("add"),h=f("mul"),d=f("div"),l=f("sub");e.exports={toString:function(t){return o(t).toString(10)},fromString:a,toNumber:u,fromNumber:s,toEther:function(t){return u(d(t,a("10000000000")))/1e8},fromEther:function(t){return h(s(Math.floor(1e8*t)),a("10000000000"))},toUint256:function(t){return i.pad(32,t)},add:c,mul:h,div:d,sub:l}},{"./bytes":306,"bn.js":240}],309:[function(t,e,r){e.exports={encode:function(t){var e=function(t){return(e=t.toString(16)).length%2==0?e:"0"+e;var e},r=function(t,r){return t<56?e(r+t):e(r+e(t).length/2+55)+e(t)};return"0x"+function t(e){if("string"==typeof e){var n=e.slice(2);return(2!=n.length||n>="80"?r(n.length/2,128):"")+n}var i=e.map(t).join("");return r(i.length/2,192)+i}(t)},decode:function(t){var e=2,r=function(){if(e>=t.length)throw"";var r=t.slice(e,e+2);return r<"80"?(e+=2,"0x"+r):r<"c0"?i():o()},n=function(){var r=parseInt(t.slice(e,e+=2),16)%64;return r<56?r:parseInt(t.slice(e,e+=2*(r-55)),16)},i=function(){var r=n();return"0x"+t.slice(e,e+=2*r)},o=function(){for(var t=2*n()+e,i=[];e=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},i.prototype._update=function(t){throw new Error("_update is not implemented")},i.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();return void 0!==t&&(e=e.toString(t)),e},i.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=i}).call(this,t("buffer").Buffer)},{buffer:47,inherits:325,stream:156}],312:[function(t,e,r){arguments[4][86][0].apply(r,arguments)},{"./hash/common":313,"./hash/hmac":314,"./hash/ripemd":315,"./hash/sha":316,"./hash/utils":323,dup:86}],313:[function(t,e,r){arguments[4][87][0].apply(r,arguments)},{"./utils":323,dup:87,"minimalistic-assert":329}],314:[function(t,e,r){arguments[4][88][0].apply(r,arguments)},{"./utils":323,dup:88,"minimalistic-assert":329}],315:[function(t,e,r){arguments[4][89][0].apply(r,arguments)},{"./common":313,"./utils":323,dup:89}],316:[function(t,e,r){arguments[4][90][0].apply(r,arguments)},{"./sha/1":317,"./sha/224":318,"./sha/256":319,"./sha/384":320,"./sha/512":321,dup:90}],317:[function(t,e,r){arguments[4][91][0].apply(r,arguments)},{"../common":313,"../utils":323,"./common":322,dup:91}],318:[function(t,e,r){arguments[4][92][0].apply(r,arguments)},{"../utils":323,"./256":319,dup:92}],319:[function(t,e,r){arguments[4][93][0].apply(r,arguments)},{"../common":313,"../utils":323,"./common":322,dup:93,"minimalistic-assert":329}],320:[function(t,e,r){arguments[4][94][0].apply(r,arguments)},{"../utils":323,"./512":321,dup:94}],321:[function(t,e,r){arguments[4][95][0].apply(r,arguments)},{"../common":313,"../utils":323,dup:95,"minimalistic-assert":329}],322:[function(t,e,r){arguments[4][96][0].apply(r,arguments)},{"../utils":323,dup:96}],323:[function(t,e,r){arguments[4][97][0].apply(r,arguments)},{dup:97,inherits:325,"minimalistic-assert":329}],324:[function(t,e,r){arguments[4][98][0].apply(r,arguments)},{dup:98,"hash.js":312,"minimalistic-assert":329,"minimalistic-crypto-utils":330}],325:[function(t,e,r){arguments[4][101][0].apply(r,arguments)},{dup:101}],326:[function(t,e,r){(function(r){var n=t("inherits"),i=t("hash-base"),o=new Array(16);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function s(t,e){return t<>>32-e}function u(t,e,r,n,i,o,a){return s(t+(e&r|~e&n)+i+o|0,a)+e|0}function f(t,e,r,n,i,o,a){return s(t+(e&n|r&~n)+i+o|0,a)+e|0}function c(t,e,r,n,i,o,a){return s(t+(e^r^n)+i+o|0,a)+e|0}function h(t,e,r,n,i,o,a){return s(t+(r^(e|~n))+i+o|0,a)+e|0}n(a,i),a.prototype._update=function(){for(var t=o,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,a=this._d;n=h(n=h(n=h(n=h(n=c(n=c(n=c(n=c(n=f(n=f(n=f(n=f(n=u(n=u(n=u(n=u(n,i=u(i,a=u(a,r=u(r,n,i,a,t[0],3614090360,7),n,i,t[1],3905402710,12),r,n,t[2],606105819,17),a,r,t[3],3250441966,22),i=u(i,a=u(a,r=u(r,n,i,a,t[4],4118548399,7),n,i,t[5],1200080426,12),r,n,t[6],2821735955,17),a,r,t[7],4249261313,22),i=u(i,a=u(a,r=u(r,n,i,a,t[8],1770035416,7),n,i,t[9],2336552879,12),r,n,t[10],4294925233,17),a,r,t[11],2304563134,22),i=u(i,a=u(a,r=u(r,n,i,a,t[12],1804603682,7),n,i,t[13],4254626195,12),r,n,t[14],2792965006,17),a,r,t[15],1236535329,22),i=f(i,a=f(a,r=f(r,n,i,a,t[1],4129170786,5),n,i,t[6],3225465664,9),r,n,t[11],643717713,14),a,r,t[0],3921069994,20),i=f(i,a=f(a,r=f(r,n,i,a,t[5],3593408605,5),n,i,t[10],38016083,9),r,n,t[15],3634488961,14),a,r,t[4],3889429448,20),i=f(i,a=f(a,r=f(r,n,i,a,t[9],568446438,5),n,i,t[14],3275163606,9),r,n,t[3],4107603335,14),a,r,t[8],1163531501,20),i=f(i,a=f(a,r=f(r,n,i,a,t[13],2850285829,5),n,i,t[2],4243563512,9),r,n,t[7],1735328473,14),a,r,t[12],2368359562,20),i=c(i,a=c(a,r=c(r,n,i,a,t[5],4294588738,4),n,i,t[8],2272392833,11),r,n,t[11],1839030562,16),a,r,t[14],4259657740,23),i=c(i,a=c(a,r=c(r,n,i,a,t[1],2763975236,4),n,i,t[4],1272893353,11),r,n,t[7],4139469664,16),a,r,t[10],3200236656,23),i=c(i,a=c(a,r=c(r,n,i,a,t[13],681279174,4),n,i,t[0],3936430074,11),r,n,t[3],3572445317,16),a,r,t[6],76029189,23),i=c(i,a=c(a,r=c(r,n,i,a,t[9],3654602809,4),n,i,t[12],3873151461,11),r,n,t[15],530742520,16),a,r,t[2],3299628645,23),i=h(i,a=h(a,r=h(r,n,i,a,t[0],4096336452,6),n,i,t[7],1126891415,10),r,n,t[14],2878612391,15),a,r,t[5],4237533241,21),i=h(i,a=h(a,r=h(r,n,i,a,t[12],1700485571,6),n,i,t[3],2399980690,10),r,n,t[10],4293915773,15),a,r,t[1],2240044497,21),i=h(i,a=h(a,r=h(r,n,i,a,t[8],1873313359,6),n,i,t[15],4264355552,10),r,n,t[6],2734768916,15),a,r,t[13],1309151649,21),i=h(i,a=h(a,r=h(r,n,i,a,t[4],4149444226,6),n,i,t[11],3174756917,10),r,n,t[2],718787259,15),a,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+a|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=new r(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},e.exports=a}).call(this,t("buffer").Buffer)},{buffer:47,"hash-base":327,inherits:325}],327:[function(t,e,r){arguments[4][105][0].apply(r,arguments)},{dup:105,inherits:325,"safe-buffer":350,stream:156}],328:[function(t,e,r){arguments[4][106][0].apply(r,arguments)},{"bn.js":240,brorand:241,dup:106}],329:[function(t,e,r){arguments[4][107][0].apply(r,arguments)},{dup:107}],330:[function(t,e,r){arguments[4][108][0].apply(r,arguments)},{dup:108}],331:[function(t,e,r){arguments[4][109][0].apply(r,arguments)},{dup:109}],332:[function(t,e,r){arguments[4][110][0].apply(r,arguments)},{"./certificate":333,"asn1.js":226,dup:110}],333:[function(t,e,r){arguments[4][111][0].apply(r,arguments)},{"asn1.js":226,dup:111}],334:[function(t,e,r){(function(r){var n=/Proc-Type: 4,ENCRYPTED\n\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\n\r?\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?/m,i=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n/m,o=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?-----END \1-----$/m,a=t("evp_bytestokey"),s=t("browserify-aes");e.exports=function(t,e){var u,f=t.toString(),c=f.match(n);if(c){var h="aes"+c[1],d=new r(c[2],"hex"),l=new r(c[3].replace(/\r?\n/g,""),"base64"),p=a(e,d.slice(0,8),parseInt(c[1],10)).key,b=[],m=s.createDecipheriv(h,p,d);b.push(m.update(l)),b.push(m.final()),u=r.concat(b)}else{var y=f.match(o);u=new r(y[2].replace(/\r?\n/g,""),"base64")}return{tag:f.match(i)[1],data:u}}}).call(this,t("buffer").Buffer)},{"browserify-aes":244,buffer:47,evp_bytestokey:310}],335:[function(t,e,r){(function(r){var n=t("./asn1"),i=t("./aesid.json"),o=t("./fixProc"),a=t("browserify-aes"),s=t("pbkdf2");function u(t){var e;"object"!==(void 0===t?"undefined":_typeof(t))||r.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=new r(t));var u,f,c,h,d,l,p,b,m,y,v,g,w,_=o(t,e),M=_.tag,x=_.data;switch(M){case"CERTIFICATE":f=n.certificate.decode(x,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(f||(f=n.PublicKey.decode(x,"der")),u=f.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(f.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return f.subjectPrivateKey=f.subjectPublicKey,{type:"ec",data:f};case"1.2.840.10040.4.1":return f.algorithm.params.pub_key=n.DSAparam.decode(f.subjectPublicKey.data,"der"),{type:"dsa",data:f.algorithm.params};default:throw new Error("unknown key id "+u)}throw new Error("unknown key type "+M);case"ENCRYPTED PRIVATE KEY":x=n.EncryptedPrivateKey.decode(x,"der"),h=e,d=(c=x).algorithm.decrypt.kde.kdeparams.salt,l=parseInt(c.algorithm.decrypt.kde.kdeparams.iters.toString(),10),p=i[c.algorithm.decrypt.cipher.algo.join(".")],b=c.algorithm.decrypt.cipher.iv,m=c.subjectPrivateKey,y=parseInt(p.split("-")[1],10)/8,v=s.pbkdf2Sync(h,d,l,y),g=a.createDecipheriv(p,v,b),(w=[]).push(g.update(m)),w.push(g.final()),x=r.concat(w);case"PRIVATE KEY":switch(u=(f=n.PrivateKey.decode(x,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(f.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:f.algorithm.curve,privateKey:n.ECPrivateKey.decode(f.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return f.algorithm.params.priv_key=n.DSAparam.decode(f.subjectPrivateKey,"der"),{type:"dsa",params:f.algorithm.params};default:throw new Error("unknown key id "+u)}throw new Error("unknown key type "+M);case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(x,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(x,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(x,"der")};case"EC PRIVATE KEY":return{curve:(x=n.ECPrivateKey.decode(x,"der")).parameters.value,privateKey:x.privateKey};default:throw new Error("unknown key type "+M)}}e.exports=u,u.signature=n.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":331,"./asn1":332,"./fixProc":334,"browserify-aes":244,buffer:47,pbkdf2:336}],336:[function(t,e,r){arguments[4][114][0].apply(r,arguments)},{"./lib/async":337,"./lib/sync":340,dup:114}],337:[function(t,e,r){(function(r,n){var i,o=t("./precondition"),a=t("./default-encoding"),s=t("./sync"),u=t("safe-buffer").Buffer,f=n.crypto&&n.crypto.subtle,c={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function d(t,e,r,n,i){return f.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then(function(t){return f.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)}).then(function(t){return u.from(t)})}e.exports=function(t,e,l,p,b,m){if(u.isBuffer(t)||(t=u.from(t,a)),u.isBuffer(e)||(e=u.from(e,a)),o(l,p),"function"==typeof b&&(m=b,b=void 0),"function"!=typeof m)throw new Error("No callback provided to pbkdf2");var y,v,g=c[(b=b||"sha1").toLowerCase()];if(!g||"function"!=typeof n.Promise)return r.nextTick(function(){var r;try{r=s(t,e,l,p,b)}catch(t){return m(t)}m(null,r)});y=function(t){if(n.process&&!n.process.browser)return Promise.resolve(!1);if(!f||!f.importKey||!f.deriveBits)return Promise.resolve(!1);if(void 0!==h[t])return h[t];var e=d(i=i||u.alloc(8),i,10,128,t).then(function(){return!0}).catch(function(){return!1});return h[t]=e,e}(g).then(function(r){return r?d(t,e,l,p,g):s(t,e,l,p,b)}),v=m,y.then(function(t){r.nextTick(function(){v(null,t)})},function(t){r.nextTick(function(){v(t)})})}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":338,"./precondition":339,"./sync":340,_process:120,"safe-buffer":350}],338:[function(t,e,r){(function(t){var r;t.browser?r="utf-8":r=parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";e.exports=r}).call(this,t("_process"))},{_process:120}],339:[function(t,e,r){arguments[4][117][0].apply(r,arguments)},{dup:117}],340:[function(t,e,r){arguments[4][118][0].apply(r,arguments)},{"./default-encoding":338,"./precondition":339,"create-hash/md5":274,dup:118,ripemd160:349,"safe-buffer":350,"sha.js":354}],341:[function(t,e,r){arguments[4][121][0].apply(r,arguments)},{"./privateDecrypt":343,"./publicEncrypt":344,dup:121}],342:[function(t,e,r){(function(r){var n=t("create-hash");function i(t){var e=new r(4);return e.writeUInt32BE(t,0),e}e.exports=function(t,e){for(var o,a=new r(""),s=0;a.lengthp||new a(e).cmp(l.modulus)>=0)throw new Error("decryption error");d=c?f(new a(e),l):s(e,l);var b=new r(p-d.length);if(b.fill(0),d=r.concat([b,d],p),4===h)return function(t,e){t.modulus;var n=t.modulus.byteLength(),a=(e.length,u("sha1").update(new r("")).digest()),s=a.length;if(0!==e[0])throw new Error("decryption error");var f=e.slice(1,s+1),c=e.slice(s+1),h=o(f,i(c,s)),d=o(c,i(h,n-s-1));if(function(t,e){t=new r(t),e=new r(e);var n=0,i=t.length;t.length!==e.length&&(n++,i=Math.min(t.length,e.length));var o=-1;for(;++o=e.length){o++;break}var a=e.slice(2,i-1);e.slice(i-1,i);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return e.slice(i)}(0,d,c);if(3===h)return d;throw new Error("unknown padding")}}).call(this,t("buffer").Buffer)},{"./mgf":342,"./withPublic":345,"./xor":346,"bn.js":240,"browserify-rsa":262,buffer:47,"create-hash":272,"parse-asn1":335}],344:[function(t,e,r){(function(r){var n=t("parse-asn1"),i=t("randombytes"),o=t("create-hash"),a=t("./mgf"),s=t("./xor"),u=t("bn.js"),f=t("./withPublic"),c=t("browserify-rsa");e.exports=function(t,e,h){var d;d=t.padding?t.padding:h?1:4;var l,p=n(t);if(4===d)l=function(t,e){var n=t.modulus.byteLength(),f=e.length,c=o("sha1").update(new r("")).digest(),h=c.length,d=2*h;if(f>n-d-2)throw new Error("message too long");var l=new r(n-f-d-2);l.fill(0);var p=n-h-1,b=i(h),m=s(r.concat([c,l,new r([1]),e],p),a(b,p)),y=s(b,a(m,h));return new u(r.concat([new r([0]),y,m],n))}(p,e);else if(1===d)l=function(t,e,n){var o,a=e.length,s=t.modulus.byteLength();if(a>s-11)throw new Error("message too long");n?(o=new r(s-a-3)).fill(255):o=function(t,e){var n,o=new r(t),a=0,s=i(2*t),u=0;for(;a=0)throw new Error("data too long for modulus")}return h?c(l,p):f(l,p)}}).call(this,t("buffer").Buffer)},{"./mgf":342,"./withPublic":345,"./xor":346,"bn.js":240,"browserify-rsa":262,buffer:47,"create-hash":272,"parse-asn1":335,randombytes:347}],345:[function(t,e,r){(function(r){var n=t("bn.js");e.exports=function(t,e){return new r(t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed().toArray())}}).call(this,t("buffer").Buffer)},{"bn.js":240,buffer:47}],346:[function(t,e,r){arguments[4][126][0].apply(r,arguments)},{dup:126}],347:[function(t,e,r){(function(r,n){var i=t("safe-buffer").Buffer,o=n.crypto||n.msCrypto;o&&o.getRandomValues?e.exports=function(t,e){if(t>65536)throw new Error("requested too many random bytes");var a=new n.Uint8Array(t);t>0&&o.getRandomValues(a);var s=i.from(a.buffer);if("function"==typeof e)return r.nextTick(function(){e(null,s)});return s}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:120,"safe-buffer":350}],348:[function(t,e,r){(function(e,n){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=t("safe-buffer"),a=t("randombytes"),s=o.Buffer,u=o.kMaxLength,f=n.crypto||n.msCrypto,c=Math.pow(2,32)-1;function h(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>c||t<0)throw new TypeError("offset must be a uint32");if(t>u||t>e)throw new RangeError("offset out of range")}function d(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>c||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>u)throw new RangeError("buffer too small")}function l(t,r,n,i){if(e.browser){var o=t.buffer,s=new Uint8Array(o,r,n);return f.getRandomValues(s),i?void e.nextTick(function(){i(null,t)}):t}if(!i)return a(n).copy(t,r),t;a(n,function(e,n){if(e)return i(e);n.copy(t,r),i(null,t)})}f&&f.getRandomValues||!e.browser?(r.randomFill=function(t,e,r,i){if(!(s.isBuffer(t)||t instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)i=e,e=0,r=t.length;else if("function"==typeof r)i=r,r=t.length-e;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return h(e,t.length),d(r,e,t.length),l(t,e,r,i)},r.randomFillSync=function(t,e,r){void 0===e&&(e=0);if(!(s.isBuffer(t)||t instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');h(e,t.length),void 0===r&&(r=t.length-e);return d(r,e,t.length),l(t,e,r)}):(r.randomFill=i,r.randomFillSync=i)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:120,randombytes:347,"safe-buffer":350}],349:[function(t,e,r){(function(r){var n=t("inherits"),i=t("hash-base");function o(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function a(t,e){return t<>>32-e}function s(t,e,r,n,i,o,s,u){return a(t+(e^r^n)+o+s|0,u)+i|0}function u(t,e,r,n,i,o,s,u){return a(t+(e&r|~e&n)+o+s|0,u)+i|0}function f(t,e,r,n,i,o,s,u){return a(t+((e|~r)^n)+o+s|0,u)+i|0}function c(t,e,r,n,i,o,s,u){return a(t+(e&n|r&~n)+o+s|0,u)+i|0}function h(t,e,r,n,i,o,s,u){return a(t+(e^(r|~n))+o+s|0,u)+i|0}n(o,i),o.prototype._update=function(){for(var t=new Array(16),e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d,d=this._e;d=s(d,r=s(r,n,i,o,d,t[0],0,11),n,i=a(i,10),o,t[1],0,14),n=s(n=a(n,10),i=s(i,o=s(o,d,r,n,i,t[2],0,15),d,r=a(r,10),n,t[3],0,12),o,d=a(d,10),r,t[4],0,5),o=s(o=a(o,10),d=s(d,r=s(r,n,i,o,d,t[5],0,8),n,i=a(i,10),o,t[6],0,7),r,n=a(n,10),i,t[7],0,9),r=s(r=a(r,10),n=s(n,i=s(i,o,d,r,n,t[8],0,11),o,d=a(d,10),r,t[9],0,13),i,o=a(o,10),d,t[10],0,14),i=s(i=a(i,10),o=s(o,d=s(d,r,n,i,o,t[11],0,15),r,n=a(n,10),i,t[12],0,6),d,r=a(r,10),n,t[13],0,7),d=u(d=a(d,10),r=s(r,n=s(n,i,o,d,r,t[14],0,9),i,o=a(o,10),d,t[15],0,8),n,i=a(i,10),o,t[7],1518500249,7),n=u(n=a(n,10),i=u(i,o=u(o,d,r,n,i,t[4],1518500249,6),d,r=a(r,10),n,t[13],1518500249,8),o,d=a(d,10),r,t[1],1518500249,13),o=u(o=a(o,10),d=u(d,r=u(r,n,i,o,d,t[10],1518500249,11),n,i=a(i,10),o,t[6],1518500249,9),r,n=a(n,10),i,t[15],1518500249,7),r=u(r=a(r,10),n=u(n,i=u(i,o,d,r,n,t[3],1518500249,15),o,d=a(d,10),r,t[12],1518500249,7),i,o=a(o,10),d,t[0],1518500249,12),i=u(i=a(i,10),o=u(o,d=u(d,r,n,i,o,t[9],1518500249,15),r,n=a(n,10),i,t[5],1518500249,9),d,r=a(r,10),n,t[2],1518500249,11),d=u(d=a(d,10),r=u(r,n=u(n,i,o,d,r,t[14],1518500249,7),i,o=a(o,10),d,t[11],1518500249,13),n,i=a(i,10),o,t[8],1518500249,12),n=f(n=a(n,10),i=f(i,o=f(o,d,r,n,i,t[3],1859775393,11),d,r=a(r,10),n,t[10],1859775393,13),o,d=a(d,10),r,t[14],1859775393,6),o=f(o=a(o,10),d=f(d,r=f(r,n,i,o,d,t[4],1859775393,7),n,i=a(i,10),o,t[9],1859775393,14),r,n=a(n,10),i,t[15],1859775393,9),r=f(r=a(r,10),n=f(n,i=f(i,o,d,r,n,t[8],1859775393,13),o,d=a(d,10),r,t[1],1859775393,15),i,o=a(o,10),d,t[2],1859775393,14),i=f(i=a(i,10),o=f(o,d=f(d,r,n,i,o,t[7],1859775393,8),r,n=a(n,10),i,t[0],1859775393,13),d,r=a(r,10),n,t[6],1859775393,6),d=f(d=a(d,10),r=f(r,n=f(n,i,o,d,r,t[13],1859775393,5),i,o=a(o,10),d,t[11],1859775393,12),n,i=a(i,10),o,t[5],1859775393,7),n=c(n=a(n,10),i=c(i,o=f(o,d,r,n,i,t[12],1859775393,5),d,r=a(r,10),n,t[1],2400959708,11),o,d=a(d,10),r,t[9],2400959708,12),o=c(o=a(o,10),d=c(d,r=c(r,n,i,o,d,t[11],2400959708,14),n,i=a(i,10),o,t[10],2400959708,15),r,n=a(n,10),i,t[0],2400959708,14),r=c(r=a(r,10),n=c(n,i=c(i,o,d,r,n,t[8],2400959708,15),o,d=a(d,10),r,t[12],2400959708,9),i,o=a(o,10),d,t[4],2400959708,8),i=c(i=a(i,10),o=c(o,d=c(d,r,n,i,o,t[13],2400959708,9),r,n=a(n,10),i,t[3],2400959708,14),d,r=a(r,10),n,t[7],2400959708,5),d=c(d=a(d,10),r=c(r,n=c(n,i,o,d,r,t[15],2400959708,6),i,o=a(o,10),d,t[14],2400959708,8),n,i=a(i,10),o,t[5],2400959708,6),n=h(n=a(n,10),i=c(i,o=c(o,d,r,n,i,t[6],2400959708,5),d,r=a(r,10),n,t[2],2400959708,12),o,d=a(d,10),r,t[4],2840853838,9),o=h(o=a(o,10),d=h(d,r=h(r,n,i,o,d,t[0],2840853838,15),n,i=a(i,10),o,t[5],2840853838,5),r,n=a(n,10),i,t[9],2840853838,11),r=h(r=a(r,10),n=h(n,i=h(i,o,d,r,n,t[7],2840853838,6),o,d=a(d,10),r,t[12],2840853838,8),i,o=a(o,10),d,t[2],2840853838,13),i=h(i=a(i,10),o=h(o,d=h(d,r,n,i,o,t[10],2840853838,12),r,n=a(n,10),i,t[14],2840853838,5),d,r=a(r,10),n,t[1],2840853838,12),d=h(d=a(d,10),r=h(r,n=h(n,i,o,d,r,t[3],2840853838,13),i,o=a(o,10),d,t[8],2840853838,14),n,i=a(i,10),o,t[11],2840853838,11),n=h(n=a(n,10),i=h(i,o=h(o,d,r,n,i,t[6],2840853838,8),d,r=a(r,10),n,t[15],2840853838,5),o,d=a(d,10),r,t[13],2840853838,6),o=a(o,10);var l=this._a,p=this._b,b=this._c,m=this._d,y=this._e;y=h(y,l=h(l,p,b,m,y,t[5],1352829926,8),p,b=a(b,10),m,t[14],1352829926,9),p=h(p=a(p,10),b=h(b,m=h(m,y,l,p,b,t[7],1352829926,9),y,l=a(l,10),p,t[0],1352829926,11),m,y=a(y,10),l,t[9],1352829926,13),m=h(m=a(m,10),y=h(y,l=h(l,p,b,m,y,t[2],1352829926,15),p,b=a(b,10),m,t[11],1352829926,15),l,p=a(p,10),b,t[4],1352829926,5),l=h(l=a(l,10),p=h(p,b=h(b,m,y,l,p,t[13],1352829926,7),m,y=a(y,10),l,t[6],1352829926,7),b,m=a(m,10),y,t[15],1352829926,8),b=h(b=a(b,10),m=h(m,y=h(y,l,p,b,m,t[8],1352829926,11),l,p=a(p,10),b,t[1],1352829926,14),y,l=a(l,10),p,t[10],1352829926,14),y=c(y=a(y,10),l=h(l,p=h(p,b,m,y,l,t[3],1352829926,12),b,m=a(m,10),y,t[12],1352829926,6),p,b=a(b,10),m,t[6],1548603684,9),p=c(p=a(p,10),b=c(b,m=c(m,y,l,p,b,t[11],1548603684,13),y,l=a(l,10),p,t[3],1548603684,15),m,y=a(y,10),l,t[7],1548603684,7),m=c(m=a(m,10),y=c(y,l=c(l,p,b,m,y,t[0],1548603684,12),p,b=a(b,10),m,t[13],1548603684,8),l,p=a(p,10),b,t[5],1548603684,9),l=c(l=a(l,10),p=c(p,b=c(b,m,y,l,p,t[10],1548603684,11),m,y=a(y,10),l,t[14],1548603684,7),b,m=a(m,10),y,t[15],1548603684,7),b=c(b=a(b,10),m=c(m,y=c(y,l,p,b,m,t[8],1548603684,12),l,p=a(p,10),b,t[12],1548603684,7),y,l=a(l,10),p,t[4],1548603684,6),y=c(y=a(y,10),l=c(l,p=c(p,b,m,y,l,t[9],1548603684,15),b,m=a(m,10),y,t[1],1548603684,13),p,b=a(b,10),m,t[2],1548603684,11),p=f(p=a(p,10),b=f(b,m=f(m,y,l,p,b,t[15],1836072691,9),y,l=a(l,10),p,t[5],1836072691,7),m,y=a(y,10),l,t[1],1836072691,15),m=f(m=a(m,10),y=f(y,l=f(l,p,b,m,y,t[3],1836072691,11),p,b=a(b,10),m,t[7],1836072691,8),l,p=a(p,10),b,t[14],1836072691,6),l=f(l=a(l,10),p=f(p,b=f(b,m,y,l,p,t[6],1836072691,6),m,y=a(y,10),l,t[9],1836072691,14),b,m=a(m,10),y,t[11],1836072691,12),b=f(b=a(b,10),m=f(m,y=f(y,l,p,b,m,t[8],1836072691,13),l,p=a(p,10),b,t[12],1836072691,5),y,l=a(l,10),p,t[2],1836072691,14),y=f(y=a(y,10),l=f(l,p=f(p,b,m,y,l,t[10],1836072691,13),b,m=a(m,10),y,t[0],1836072691,13),p,b=a(b,10),m,t[4],1836072691,7),p=u(p=a(p,10),b=u(b,m=f(m,y,l,p,b,t[13],1836072691,5),y,l=a(l,10),p,t[8],2053994217,15),m,y=a(y,10),l,t[6],2053994217,5),m=u(m=a(m,10),y=u(y,l=u(l,p,b,m,y,t[4],2053994217,8),p,b=a(b,10),m,t[1],2053994217,11),l,p=a(p,10),b,t[3],2053994217,14),l=u(l=a(l,10),p=u(p,b=u(b,m,y,l,p,t[11],2053994217,14),m,y=a(y,10),l,t[15],2053994217,6),b,m=a(m,10),y,t[0],2053994217,14),b=u(b=a(b,10),m=u(m,y=u(y,l,p,b,m,t[5],2053994217,6),l,p=a(p,10),b,t[12],2053994217,9),y,l=a(l,10),p,t[2],2053994217,12),y=u(y=a(y,10),l=u(l,p=u(p,b,m,y,l,t[13],2053994217,9),b,m=a(m,10),y,t[9],2053994217,12),p,b=a(b,10),m,t[7],2053994217,5),p=s(p=a(p,10),b=u(b,m=u(m,y,l,p,b,t[10],2053994217,15),y,l=a(l,10),p,t[14],2053994217,8),m,y=a(y,10),l,t[12],0,8),m=s(m=a(m,10),y=s(y,l=s(l,p,b,m,y,t[15],0,5),p,b=a(b,10),m,t[10],0,12),l,p=a(p,10),b,t[4],0,9),l=s(l=a(l,10),p=s(p,b=s(b,m,y,l,p,t[1],0,12),m,y=a(y,10),l,t[5],0,5),b,m=a(m,10),y,t[8],0,14),b=s(b=a(b,10),m=s(m,y=s(y,l,p,b,m,t[7],0,6),l,p=a(p,10),b,t[6],0,8),y,l=a(l,10),p,t[2],0,13),y=s(y=a(y,10),l=s(l,p=s(p,b,m,y,l,t[13],0,6),b,m=a(m,10),y,t[14],0,5),p,b=a(b,10),m,t[0],0,15),p=s(p=a(p,10),b=s(b,m=s(m,y,l,p,b,t[3],0,13),y,l=a(l,10),p,t[9],0,11),m,y=a(y,10),l,t[11],0,11),m=a(m,10);var v=this._b+i+m|0;this._b=this._c+o+y|0,this._c=this._d+d+l|0,this._d=this._e+r+p|0,this._e=this._a+n+b|0,this._a=v},o.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=new r(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},e.exports=o}).call(this,t("buffer").Buffer)},{buffer:47,"hash-base":311,inherits:325}],350:[function(t,e,r){arguments[4][147][0].apply(r,arguments)},{buffer:47,dup:147}],351:[function(t,e,r){e.exports=t("scryptsy")},{scryptsy:352}],352:[function(t,e,r){(function(r){var n=t("pbkdf2").pbkdf2Sync,i=2147483647;function o(t,e,n,i,o){if(r.isBuffer(t)&&r.isBuffer(n))t.copy(n,i,e,e+o);else for(;o--;)n[i++]=t[e++]}e.exports=function(t,e,a,s,u,f,c){if(0===a||0!=(a&a-1))throw Error("N must be > 0 and a power of 2");if(a>i/128/s)throw Error("Parameter N is too large");if(s>i/128/u)throw Error("Parameter r is too large");var h,d=new r(256*s),l=new r(128*s*a),p=new Int32Array(16),b=new Int32Array(16),m=new r(64),y=n(t,e,1,128*u*s,"sha256");if(c){var v=u*a*2,g=0;h=function(){++g%1e3==0&&c({current:g,total:v,percent:g/v*100})}}for(var w=0;w>>32-e}function k(t){var e;for(e=0;e<16;e++)p[e]=(255&t[4*e+0])<<0,p[e]|=(255&t[4*e+1])<<8,p[e]|=(255&t[4*e+2])<<16,p[e]|=(255&t[4*e+3])<<24;for(o(p,0,b,0,16),e=8;e>0;e-=2)b[4]^=x(b[0]+b[12],7),b[8]^=x(b[4]+b[0],9),b[12]^=x(b[8]+b[4],13),b[0]^=x(b[12]+b[8],18),b[9]^=x(b[5]+b[1],7),b[13]^=x(b[9]+b[5],9),b[1]^=x(b[13]+b[9],13),b[5]^=x(b[1]+b[13],18),b[14]^=x(b[10]+b[6],7),b[2]^=x(b[14]+b[10],9),b[6]^=x(b[2]+b[14],13),b[10]^=x(b[6]+b[2],18),b[3]^=x(b[15]+b[11],7),b[7]^=x(b[3]+b[15],9),b[11]^=x(b[7]+b[3],13),b[15]^=x(b[11]+b[7],18),b[1]^=x(b[0]+b[3],7),b[2]^=x(b[1]+b[0],9),b[3]^=x(b[2]+b[1],13),b[0]^=x(b[3]+b[2],18),b[6]^=x(b[5]+b[4],7),b[7]^=x(b[6]+b[5],9),b[4]^=x(b[7]+b[6],13),b[5]^=x(b[4]+b[7],18),b[11]^=x(b[10]+b[9],7),b[8]^=x(b[11]+b[10],9),b[9]^=x(b[8]+b[11],13),b[10]^=x(b[9]+b[8],18),b[12]^=x(b[15]+b[14],7),b[13]^=x(b[12]+b[15],9),b[14]^=x(b[13]+b[12],13),b[15]^=x(b[14]+b[13],18);for(e=0;e<16;++e)p[e]=b[e]+p[e];for(e=0;e<16;e++){var r=4*e;t[r+0]=p[e]>>0&255,t[r+1]=p[e]>>8&255,t[r+2]=p[e]>>16&255,t[r+3]=p[e]>>24&255}}function S(t,e,r,n,i){for(var o=0;o>>((3&e)<<3)&255;return i}}e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],363:[function(t,e,r){for(var n=t("./rng"),i=[],o={},a=0;a<256;a++)i[a]=(a+256).toString(16).substr(1),o[i[a]]=a;function s(t,e){var r=e||0,n=i;return n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]}var u=n(),f=[1|u[0],u[1],u[2],u[3],u[4],u[5]],c=16383&(u[6]<<8|u[7]),h=0,d=0;function l(t,e,r){var i=e&&r||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var a=0;a<16;a++)e[i+a]=o[a];return e||s(o)}var p=l;p.v1=function(t,e,r){var n=e&&r||0,i=e||[],o=void 0!==(t=t||{}).clockseq?t.clockseq:c,a=void 0!==t.msecs?t.msecs:(new Date).getTime(),u=void 0!==t.nsecs?t.nsecs:d+1,l=a-h+(u-d)/1e4;if(l<0&&void 0===t.clockseq&&(o=o+1&16383),(l<0||a>h)&&void 0===t.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");h=a,d=u,c=o;var p=(1e4*(268435455&(a+=122192928e5))+u)%4294967296;i[n++]=p>>>24&255,i[n++]=p>>>16&255,i[n++]=p>>>8&255,i[n++]=255&p;var b=a/4294967296*1e4&268435455;i[n++]=b>>>8&255,i[n++]=255&b,i[n++]=b>>>24&15|16,i[n++]=b>>>16&255,i[n++]=o>>>8|128,i[n++]=255&o;for(var m=t.node||f,y=0;y<6;y++)i[n+y]=m[y];return e||s(i)},p.v4=l,p.parse=function(t,e,r){var n=e&&r||0,i=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){i<16&&(e[n+i++]=o[t])});i<16;)e[n+i++]=0;return e},p.unparse=s,e.exports=p},{"./rng":362}],364:[function(t,e,r){(function(r,n){var i=t("underscore"),o=t("web3-core"),a=t("web3-core-method"),s=t("any-promise"),u=t("eth-lib/lib/account"),f=t("eth-lib/lib/hash"),c=t("eth-lib/lib/rlp"),h=t("eth-lib/lib/nat"),d=t("eth-lib/lib/bytes"),l=t(void 0===r?"crypto-browserify":"crypto"),p=t("scrypt.js"),b=t("uuid"),m=t("web3-utils"),y=t("web3-core-helpers"),v=function(t){return i.isUndefined(t)||i.isNull(t)},g=function(t){for(;t&&t.startsWith("0x0");)t="0x"+t.slice(3);return t},w=function(t){return t.length%2==1&&(t=t.replace("0x","0x0")),t},_=function(){var t=this;o.packageInit(this,arguments),delete this.BatchRequest,delete this.extend;var e=[new a({name:"getId",call:"net_version",params:0,outputFormatter:m.hexToNumber}),new a({name:"getGasPrice",call:"eth_gasPrice",params:0}),new a({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[function(t){if(m.isAddress(t))return t;throw new Error("Address "+t+' is not a valid address to get the "transactionCount".')},function(){return"latest"}]})];this._ethereumCall={},i.each(e,function(e){e.attachToObject(t._ethereumCall),e.setRequestManager(t._requestManager)}),this.wallet=new M(this)};function M(t){this._accounts=t,this.length=0,this.defaultKeyName="web3js_wallet"}_.prototype._addAccountFunctions=function(t){var e=this;return t.signTransaction=function(r,n){return e.signTransaction(r,t.privateKey,n)},t.sign=function(r){return e.sign(r,t.privateKey)},t.encrypt=function(r,n){return e.encrypt(t.privateKey,r,n)},t},_.prototype.create=function(t){return this._addAccountFunctions(u.create(t||m.randomHex(32)))},_.prototype.privateKeyToAccount=function(t){return this._addAccountFunctions(u.fromPrivate(t))},_.prototype.signTransaction=function(t,e,r){var n,o=!1;if(r=r||function(){},!t)return o=new Error("No transaction object given!"),r(o),s.reject(o);function a(t){if(t.gas||t.gasLimit||(o=new Error('"gas" is missing')),(t.nonce<0||t.gas<0||t.gasPrice<0||t.chainId<0)&&(o=new Error("Gas, gasPrice, nonce or chainId is lower than 0")),o)return r(o),s.reject(new Error('"gas" is missing'));try{var i=t=y.formatters.inputCallFormatter(t);i.to=t.to||"0x",i.data=t.data||"0x",i.value=t.value||"0x",i.chainId=m.numberToHex(t.chainId);var a=c.encode([d.fromNat(i.nonce),d.fromNat(i.gasPrice),d.fromNat(i.gas),i.to.toLowerCase(),d.fromNat(i.value),i.data,d.fromNat(i.chainId||"0x1"),"0x","0x"]),l=f.keccak256(a),p=u.makeSigner(2*h.toNumber(i.chainId||"0x1")+35)(f.keccak256(a),e),b=c.decode(a).slice(0,6).concat(u.decodeSignature(p));b[6]=w(g(b[6])),b[7]=w(g(b[7])),b[8]=w(g(b[8]));var v=c.encode(b),_=c.decode(v);n={messageHash:l,v:g(_[6]),r:g(_[7]),s:g(_[8]),rawTransaction:v}}catch(t){return r(t),s.reject(t)}return r(null,n),n}return void 0!==t.nonce&&void 0!==t.chainId&&void 0!==t.gasPrice?s.resolve(a(t)):s.all([v(t.chainId)?this._ethereumCall.getId():t.chainId,v(t.gasPrice)?this._ethereumCall.getGasPrice():t.gasPrice,v(t.nonce)?this._ethereumCall.getTransactionCount(this.privateKeyToAccount(e).address):t.nonce]).then(function(e){if(v(e[0])||v(e[1])||v(e[2]))throw new Error('One of the values "chainId", "gasPrice", or "nonce" couldn\'t be fetched: '+JSON.stringify(e));return a(i.extend(t,{chainId:e[0],gasPrice:e[1],nonce:e[2]}))})},_.prototype.recoverTransaction=function(t){var e=c.decode(t),r=u.encodeSignature(e.slice(6,9)),n=d.toNumber(e[6]),i=n<35?[]:[d.fromNumber(n-35>>1),"0x","0x"],o=e.slice(0,6).concat(i),a=c.encode(o);return u.recover(f.keccak256(a),r)},_.prototype.hashMessage=function(t){var e=m.isHexStrict(t)?m.hexToBytes(t):t,r=n.from(e),i="Ethereum Signed Message:\n"+e.length,o=n.from(i),a=n.concat([o,r]);return f.keccak256s(a)},_.prototype.sign=function(t,e){var r=this.hashMessage(t),n=u.sign(r,e),i=u.decodeSignature(n);return{message:t,messageHash:r,v:i[0],r:i[1],s:i[2],signature:n}},_.prototype.recover=function(t,e,r){var n=[].slice.apply(arguments);return i.isObject(t)?this.recover(t.messageHash,u.encodeSignature([t.v,t.r,t.s]),!0):(r||(t=this.hashMessage(t)),n.length>=4?(r=n.slice(-1)[0],r=!!i.isBoolean(r)&&!!r,this.recover(t,u.encodeSignature(n.slice(1,4)),r)):u.recover(t,e))},_.prototype.decrypt=function(t,e,r){if(!i.isString(e))throw new Error("No password given.");var o,a,s=i.isObject(t)?t:JSON.parse(r?t.toLowerCase():t);if(3!==s.version)throw new Error("Not a valid V3 wallet");if("scrypt"===s.crypto.kdf)a=s.crypto.kdfparams,o=p(new n(e),new n(a.salt,"hex"),a.n,a.r,a.p,a.dklen);else{if("pbkdf2"!==s.crypto.kdf)throw new Error("Unsupported key derivation scheme");if("hmac-sha256"!==(a=s.crypto.kdfparams).prf)throw new Error("Unsupported parameters to PBKDF2");o=l.pbkdf2Sync(new n(e),new n(a.salt,"hex"),a.c,a.dklen,"sha256")}var u=new n(s.crypto.ciphertext,"hex");if(m.sha3(n.concat([o.slice(16,32),u])).replace("0x","")!==s.crypto.mac)throw new Error("Key derivation failed - possibly wrong password");var f=l.createDecipheriv(s.crypto.cipher,o.slice(0,16),new n(s.crypto.cipherparams.iv,"hex")),c="0x"+n.concat([f.update(u),f.final()]).toString("hex");return this.privateKeyToAccount(c)},_.prototype.encrypt=function(t,e,r){var i,o=this.privateKeyToAccount(t),a=(r=r||{}).salt||l.randomBytes(32),s=r.iv||l.randomBytes(16),u=r.kdf||"scrypt",f={dklen:r.dklen||32,salt:a.toString("hex")};if("pbkdf2"===u)f.c=r.c||262144,f.prf="hmac-sha256",i=l.pbkdf2Sync(new n(e),a,f.c,f.dklen,"sha256");else{if("scrypt"!==u)throw new Error("Unsupported kdf");f.n=r.n||8192,f.r=r.r||8,f.p=r.p||1,i=p(new n(e),a,f.n,f.r,f.p,f.dklen)}var c=l.createCipheriv(r.cipher||"aes-128-ctr",i.slice(0,16),s);if(!c)throw new Error("Unsupported cipher");var h=n.concat([c.update(new n(o.privateKey.replace("0x",""),"hex")),c.final()]),d=m.sha3(n.concat([i.slice(16,32),new n(h,"hex")])).replace("0x","");return{version:3,id:b.v4({random:r.uuid||l.randomBytes(16)}),address:o.address.toLowerCase().replace("0x",""),crypto:{ciphertext:h.toString("hex"),cipherparams:{iv:s.toString("hex")},cipher:r.cipher||"aes-128-ctr",kdf:u,kdfparams:f,mac:d.toString("hex")}}},M.prototype._findSafeIndex=function(t){return t=t||0,i.has(this,t)?this._findSafeIndex(t+1):t},M.prototype._currentIndexes=function(){return Object.keys(this).map(function(t){return parseInt(t)}).filter(function(t){return t<9e20})},M.prototype.create=function(t,e){for(var r=0;r=2?e.slice(2):e;var r=h.decodeParameters(t,e);return 1===r.__length__?r[0]:(delete r.__length__,r)},d.prototype.deploy=function(t,e){if((t=t||{}).arguments=t.arguments||[],!(t=this._getOrSetDefaultOptions(t)).data)return a._fireError(new Error('No "data" specified in neither the given options, nor the default options.'),null,null,e);var r=n.find(this.options.jsonInterface,function(t){return"constructor"===t.type})||{};return r.signature="constructor",this._createTxObject.apply({method:r,parent:this,deployData:t.data,_ethAccounts:this.constructor._ethAccounts},t.arguments)},d.prototype._generateEventOptions=function(){var t=Array.prototype.slice.call(arguments),e=this._getCallback(t),r=n.isObject(t[t.length-1])?t.pop():{},i=n.isString(t[0])?t[0]:"allevents";if(!(i="allevents"===i.toLowerCase()?{name:"ALLEVENTS",jsonInterface:this.options.jsonInterface}:this.options.jsonInterface.find(function(t){return"event"===t.type&&(t.name===i||t.signature==="0x"+i.replace("0x",""))})))throw new Error('Event "'+i.name+"\" doesn't exist in this contract.");if(!a.isAddress(this.options.address))throw new Error("This contract object doesn't have address set yet, please set an address first.");return{params:this._encodeEventABI(i,r),event:i,callback:e}},d.prototype.clone=function(){return new this.constructor(this.options.jsonInterface,this.options.address,this.options)},d.prototype.once=function(t,e,r){var i=Array.prototype.slice.call(arguments);if(!(r=this._getCallback(i)))throw new Error("Once requires a callback as the second parameter.");e&&delete e.fromBlock,this._on(t,e,function(t,e,i){i.unsubscribe(),n.isFunction(r)&&r(t,e,i)})},d.prototype._on=function(){var t=this._generateEventOptions.apply(this,arguments);this._checkListener("newListener",t.event.name,t.callback),this._checkListener("removeListener",t.event.name,t.callback);var e=new s({subscription:{params:1,inputFormatter:[u.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(t.event),subscriptionHandler:function(t){t.removed?this.emit("changed",t):this.emit("data",t),n.isFunction(this.callback)&&this.callback(null,t,this)}},type:"eth",requestManager:this._requestManager});return e.subscribe("logs",t.params,t.callback||function(){}),e},d.prototype.getPastEvents=function(){var t=this._generateEventOptions.apply(this,arguments),e=new o({name:"getPastLogs",call:"eth_getLogs",params:1,inputFormatter:[u.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(t.event)});e.setRequestManager(this._requestManager);var r=e.buildCall();return e=null,r(t.params,t.callback)},d.prototype._createTxObject=function(){var t=Array.prototype.slice.call(arguments),e={};if("function"===this.method.type&&(e.call=this.parent._executeMethod.bind(e,"call"),e.call.request=this.parent._executeMethod.bind(e,"call",!0)),e.send=this.parent._executeMethod.bind(e,"send"),e.send.request=this.parent._executeMethod.bind(e,"send",!0),e.encodeABI=this.parent._encodeMethodABI.bind(e),e.estimateGas=this.parent._executeMethod.bind(e,"estimate"),t&&this.method.inputs&&t.length!==this.method.inputs.length){if(this.nextMethod)return this.nextMethod.apply(null,t);throw f.InvalidNumberOfParams(t.length,this.method.inputs.length,this.method.name)}return e.arguments=t||[],e._method=this.method,e._parent=this.parent,e._ethAccounts=this.parent.constructor._ethAccounts||this._ethAccounts,this.deployData&&(e._deployData=this.deployData),e},d.prototype._processExecuteArguments=function(t,e){var r={};if(r.type=t.shift(),r.callback=this._parent._getCallback(t),"call"===r.type&&!0!==t[t.length-1]&&(n.isString(t[t.length-1])||isFinite(t[t.length-1]))&&(r.defaultBlock=t.pop()),r.options=n.isObject(t[t.length-1])?t.pop():{},r.generateRequest=!0===t[t.length-1]&&t.pop(),r.options=this._parent._getOrSetDefaultOptions(r.options),r.options.data=this.encodeABI(),!this._deployData&&!a.isAddress(this._parent.options.address))throw new Error("This contract object doesn't have address set yet, please set an address first.");return this._deployData||(r.options.to=this._parent.options.address),r.options.data?r:a._fireError(new Error("Couldn't find a matching contract method, or the number of parameters is wrong."),e.eventEmitter,e.reject,r.callback)},d.prototype._executeMethod=function(){var t=this,e=this._parent._processExecuteArguments.call(this,Array.prototype.slice.call(arguments),r),r=c("send"!==e.type),i=t.constructor._ethAccounts||t._ethAccounts;if(e.generateRequest){var s={params:[u.inputCallFormatter.call(this._parent,e.options)],callback:e.callback};return"call"===e.type?(s.params.push(u.inputDefaultBlockNumberFormatter.call(this._parent,e.defaultBlock)),s.method="eth_call",s.format=this._parent._decodeMethodReturn.bind(null,this._method.outputs)):s.method="eth_sendTransaction",s}switch(e.type){case"estimate":return new o({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[u.inputCallFormatter],outputFormatter:a.hexToNumber,requestManager:t._parent._requestManager,accounts:i,defaultAccount:t._parent.defaultAccount,defaultBlock:t._parent.defaultBlock}).createFunction()(e.options,e.callback);case"call":return new o({name:"call",call:"eth_call",params:2,inputFormatter:[u.inputCallFormatter,u.inputDefaultBlockNumberFormatter],outputFormatter:function(e){return t._parent._decodeMethodReturn(t._method.outputs,e)},requestManager:t._parent._requestManager,accounts:i,defaultAccount:t._parent.defaultAccount,defaultBlock:t._parent.defaultBlock}).createFunction()(e.options,e.defaultBlock,e.callback);case"send":if(!a.isAddress(e.options.from))return a._fireError(new Error('No "from" address specified in neither the given options, nor the default options.'),r.eventEmitter,r.reject,e.callback);if(n.isBoolean(this._method.payable)&&!this._method.payable&&e.options.value&&e.options.value>0)return a._fireError(new Error("Can not send value to non-payable contract method or constructor"),r.eventEmitter,r.reject,e.callback);var f={receiptFormatter:function(e){if(n.isArray(e.logs)){var r=n.map(e.logs,function(e){return t._parent._decodeEventABI.call({name:"ALLEVENTS",jsonInterface:t._parent.options.jsonInterface},e)});e.events={};var i=0;r.forEach(function(t){t.event?e.events[t.event]?Array.isArray(e.events[t.event])?e.events[t.event].push(t):e.events[t.event]=[e.events[t.event],t]:e.events[t.event]=t:(e.events[i]=t,i++)}),delete e.logs}return e},contractDeployFormatter:function(e){var r=t._parent.clone();return r.options.address=e.contractAddress,r}};return new o({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[u.inputTransactionFormatter],requestManager:t._parent._requestManager,accounts:t.constructor._ethAccounts||t._ethAccounts,defaultAccount:t._parent.defaultAccount,defaultBlock:t._parent.defaultBlock,extraFormatters:f}).createFunction()(e.options,e.callback)}},e.exports=d},{underscore:365,"web3-core":209,"web3-core-helpers":191,"web3-core-method":193,"web3-core-promievent":198,"web3-core-subscriptions":206,"web3-eth-abi":213,"web3-utils":393}],367:[function(t,e,r){arguments[4][210][0].apply(r,arguments)},{dup:210}],368:[function(t,e,r){var n=t("web3-utils"),i=t("bn.js"),o=function(t){var e="A".charCodeAt(0),r="Z".charCodeAt(0);return(t=(t=t.toUpperCase()).substr(4)+t.substr(0,4)).split("").map(function(t){var n=t.charCodeAt(0);return n>=e&&n<=r?n-e+10:t}).join("")},a=function(t){for(var e,r=t;r.length>2;)e=r.slice(0,9),r=parseInt(e,10)%97+r.slice(e.length);return parseInt(r,10)%97},s=function(t){this._iban=t};s.toAddress=function(t){if(!(t=new s(t)).isDirect())throw new Error("IBAN is indirect and can't be converted");return t.toAddress()},s.toIban=function(t){return s.fromAddress(t).toString()},s.fromAddress=function(t){if(!n.isAddress(t))throw new Error("Provided address is not a valid address: "+t);t=t.replace("0x","").replace("0X","");var e=function(t,e){for(var r=t;r.length<2*e;)r="0"+r;return r}(new i(t,16).toString(36),15);return s.fromBban(e.toUpperCase())},s.fromBban=function(t){var e=("0"+(98-a(o("XE00"+t)))).slice(-2);return new s("XE"+e+t)},s.createIndirect=function(t){return s.fromBban("ETH"+t.institution+t.identifier)},s.isValid=function(t){return new s(t).isValid()},s.prototype.isValid=function(){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban)&&1===a(o(this._iban))},s.prototype.isDirect=function(){return 34===this._iban.length||35===this._iban.length},s.prototype.isIndirect=function(){return 20===this._iban.length},s.prototype.checksum=function(){return this._iban.substr(2,2)},s.prototype.institution=function(){return this.isIndirect()?this._iban.substr(7,4):""},s.prototype.client=function(){return this.isIndirect()?this._iban.substr(11):""},s.prototype.toAddress=function(){if(this.isDirect()){var t=this._iban.substr(4),e=new i(t,36);return n.toChecksumAddress(e.toString(16,20))}return""},s.prototype.toString=function(){return this._iban},e.exports=s},{"bn.js":367,"web3-utils":393}],369:[function(t,e,r){var n=t("web3-core"),i=t("web3-core-method"),o=t("web3-utils"),a=t("web3-net"),s=t("web3-core-helpers").formatters,u=function(){var t=this;n.packageInit(this,arguments),this.net=new a(this.currentProvider);var e=null,r="latest";Object.defineProperty(this,"defaultAccount",{get:function(){return e},set:function(t){return t&&(e=o.toChecksumAddress(s.inputAddressFormatter(t))),u.forEach(function(t){t.defaultAccount=e}),t},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return r},set:function(t){return r=t,u.forEach(function(t){t.defaultBlock=r}),t},enumerable:!0});var u=[new i({name:"getAccounts",call:"personal_listAccounts",params:0,outputFormatter:o.toChecksumAddress}),new i({name:"newAccount",call:"personal_newAccount",params:1,inputFormatter:[null],outputFormatter:o.toChecksumAddress}),new i({name:"unlockAccount",call:"personal_unlockAccount",params:3,inputFormatter:[s.inputAddressFormatter,null,null]}),new i({name:"lockAccount",call:"personal_lockAccount",params:1,inputFormatter:[s.inputAddressFormatter]}),new i({name:"importRawKey",call:"personal_importRawKey",params:2}),new i({name:"sendTransaction",call:"personal_sendTransaction",params:2,inputFormatter:[s.inputTransactionFormatter,null]}),new i({name:"signTransaction",call:"personal_signTransaction",params:2,inputFormatter:[s.inputTransactionFormatter,null]}),new i({name:"sign",call:"personal_sign",params:3,inputFormatter:[s.inputSignFormatter,s.inputAddressFormatter,null]}),new i({name:"ecRecover",call:"personal_ecRecover",params:2,inputFormatter:[s.inputSignFormatter,null]})];u.forEach(function(e){e.attachToObject(t),e.setRequestManager(t._requestManager),e.defaultBlock=t.defaultBlock,e.defaultAccount=t.defaultAccount})};n.addProviders(u),e.exports=u},{"web3-core":209,"web3-core-helpers":191,"web3-core-method":193,"web3-net":373,"web3-utils":393}],370:[function(t,e,r){arguments[4][178][0].apply(r,arguments)},{dup:178}],371:[function(t,e,r){var n=t("underscore");e.exports=function(t){var e,r=this;return this.net.getId().then(function(t){return e=t,r.getBlock(0)}).then(function(r){var i="private";return"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3"===r.hash&&1===e&&(i="main"),"0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303"===r.hash&&2===e&&(i="morden"),"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"===r.hash&&3===e&&(i="ropsten"),"0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177"===r.hash&&4===e&&(i="rinkeby"),"0xa3c565fc15c7478862d50ccd6561e3c06b24cc509bf388941c25ea985ce32cb9"===r.hash&&42===e&&(i="kovan"),n.isFunction(t)&&t(null,i),i}).catch(function(e){if(!n.isFunction(t))throw e;t(e)})}},{underscore:370}],372:[function(t,e,r){var n=t("underscore"),i=t("web3-core"),o=t("web3-core-helpers"),a=t("web3-core-subscriptions").subscriptions,s=t("web3-core-method"),u=t("web3-utils"),f=t("web3-net"),c=t("web3-eth-personal"),h=t("web3-eth-contract"),d=t("web3-eth-iban"),l=t("web3-eth-accounts"),p=t("web3-eth-abi"),b=t("./getNetworkType.js"),m=o.formatters,y=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getBlockByHash":"eth_getBlockByNumber"},v=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getTransactionByBlockHashAndIndex":"eth_getTransactionByBlockNumberAndIndex"},g=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getUncleByBlockHashAndIndex":"eth_getUncleByBlockNumberAndIndex"},w=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getBlockTransactionCountByHash":"eth_getBlockTransactionCountByNumber"},_=function(t){return n.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getUncleCountByBlockHash":"eth_getUncleCountByBlockNumber"},M=function(){var t=this;i.packageInit(this,arguments);var e=this.setProvider;this.setProvider=function(){e.apply(t,arguments),t.net.setProvider.apply(t,arguments),t.personal.setProvider.apply(t,arguments),t.accounts.setProvider.apply(t,arguments),t.Contract.setProvider(t.currentProvider,t.accounts)};var r=null,o="latest";Object.defineProperty(this,"defaultAccount",{get:function(){return r},set:function(e){return e&&(r=u.toChecksumAddress(m.inputAddressFormatter(e))),t.Contract.defaultAccount=r,t.personal.defaultAccount=r,x.forEach(function(t){t.defaultAccount=r}),e},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return o},set:function(e){return o=e,t.Contract.defaultBlock=o,t.personal.defaultBlock=o,x.forEach(function(t){t.defaultBlock=o}),e},enumerable:!0}),this.clearSubscriptions=t._requestManager.clearSubscriptions,this.net=new f(this.currentProvider),this.net.getNetworkType=b.bind(this),this.accounts=new l(this.currentProvider),this.personal=new c(this.currentProvider),this.personal.defaultAccount=this.defaultAccount;var M=function(){h.apply(this,arguments)};M.setProvider=function(){h.setProvider.apply(this,arguments)},(M.prototype=Object.create(h.prototype)).constructor=M,this.Contract=M,this.Contract.defaultAccount=this.defaultAccount,this.Contract.defaultBlock=this.defaultBlock,this.Contract.setProvider(this.currentProvider,this.accounts),this.Iban=d,this.abi=p;var x=[new s({name:"getNodeInfo",call:"web3_clientVersion"}),new s({name:"getProtocolVersion",call:"eth_protocolVersion",params:0}),new s({name:"getCoinbase",call:"eth_coinbase",params:0}),new s({name:"isMining",call:"eth_mining",params:0}),new s({name:"getHashrate",call:"eth_hashrate",params:0,outputFormatter:u.hexToNumber}),new s({name:"isSyncing",call:"eth_syncing",params:0,outputFormatter:m.outputSyncingFormatter}),new s({name:"getGasPrice",call:"eth_gasPrice",params:0,outputFormatter:m.outputBigNumberFormatter}),new s({name:"getAccounts",call:"eth_accounts",params:0,outputFormatter:u.toChecksumAddress}),new s({name:"getBlockNumber",call:"eth_blockNumber",params:0,outputFormatter:u.hexToNumber}),new s({name:"getBalance",call:"eth_getBalance",params:2,inputFormatter:[m.inputAddressFormatter,m.inputDefaultBlockNumberFormatter],outputFormatter:m.outputBigNumberFormatter}),new s({name:"getStorageAt",call:"eth_getStorageAt",params:3,inputFormatter:[m.inputAddressFormatter,u.numberToHex,m.inputDefaultBlockNumberFormatter]}),new s({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[m.inputAddressFormatter,m.inputDefaultBlockNumberFormatter]}),new s({name:"getBlock",call:y,params:2,inputFormatter:[m.inputBlockNumberFormatter,function(t){return!!t}],outputFormatter:m.outputBlockFormatter}),new s({name:"getUncle",call:g,params:2,inputFormatter:[m.inputBlockNumberFormatter,u.numberToHex],outputFormatter:m.outputBlockFormatter}),new s({name:"getBlockTransactionCount",call:w,params:1,inputFormatter:[m.inputBlockNumberFormatter],outputFormatter:u.hexToNumber}),new s({name:"getBlockUncleCount",call:_,params:1,inputFormatter:[m.inputBlockNumberFormatter],outputFormatter:u.hexToNumber}),new s({name:"getTransaction",call:"eth_getTransactionByHash",params:1,inputFormatter:[null],outputFormatter:m.outputTransactionFormatter}),new s({name:"getTransactionFromBlock",call:v,params:2,inputFormatter:[m.inputBlockNumberFormatter,u.numberToHex],outputFormatter:m.outputTransactionFormatter}),new s({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:m.outputTransactionReceiptFormatter}),new s({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[m.inputAddressFormatter,m.inputDefaultBlockNumberFormatter],outputFormatter:u.hexToNumber}),new s({name:"sendSignedTransaction",call:"eth_sendRawTransaction",params:1,inputFormatter:[null]}),new s({name:"signTransaction",call:"eth_signTransaction",params:1,inputFormatter:[m.inputTransactionFormatter]}),new s({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[m.inputTransactionFormatter]}),new s({name:"sign",call:"eth_sign",params:2,inputFormatter:[m.inputSignFormatter,m.inputAddressFormatter],transformPayload:function(t){return t.params.reverse(),t}}),new s({name:"call",call:"eth_call",params:2,inputFormatter:[m.inputCallFormatter,m.inputDefaultBlockNumberFormatter]}),new s({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[m.inputCallFormatter],outputFormatter:u.hexToNumber}),new s({name:"getCompilers",call:"eth_getCompilers",params:0}),new s({name:"compile.solidity",call:"eth_compileSolidity",params:1}),new s({name:"compile.lll",call:"eth_compileLLL",params:1}),new s({name:"compile.serpent",call:"eth_compileSerpent",params:1}),new s({name:"submitWork",call:"eth_submitWork",params:3}),new s({name:"getWork",call:"eth_getWork",params:0}),new s({name:"getPastLogs",call:"eth_getLogs",params:1,inputFormatter:[m.inputLogFormatter],outputFormatter:m.outputLogFormatter}),new a({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:m.outputBlockFormatter},pendingTransactions:{subscriptionName:"newPendingTransactions",params:0},logs:{params:1,inputFormatter:[m.inputLogFormatter],outputFormatter:m.outputLogFormatter,subscriptionHandler:function(t){t.removed?this.emit("changed",t):this.emit("data",t),n.isFunction(this.callback)&&this.callback(null,t,this)}},syncing:{params:0,outputFormatter:m.outputSyncingFormatter,subscriptionHandler:function(t){var e=this;!0!==this._isSyncing?(this._isSyncing=!0,this.emit("changed",e._isSyncing),n.isFunction(this.callback)&&this.callback(null,e._isSyncing,this),setTimeout(function(){e.emit("data",t),n.isFunction(e.callback)&&e.callback(null,t,e)},0)):(this.emit("data",t),n.isFunction(e.callback)&&this.callback(null,t,this),clearTimeout(this._isSyncingTimeout),this._isSyncingTimeout=setTimeout(function(){t.currentBlock>t.highestBlock-200&&(e._isSyncing=!1,e.emit("changed",e._isSyncing),n.isFunction(e.callback)&&e.callback(null,e._isSyncing,e))},500))}}}})];x.forEach(function(e){e.attachToObject(t),e.setRequestManager(t._requestManager,t.accounts),e.defaultBlock=t.defaultBlock,e.defaultAccount=t.defaultAccount})};i.addProviders(M),e.exports=M},{"./getNetworkType.js":371,underscore:370,"web3-core":209,"web3-core-helpers":191,"web3-core-method":193,"web3-core-subscriptions":206,"web3-eth-abi":213,"web3-eth-accounts":364,"web3-eth-contract":366,"web3-eth-iban":368,"web3-eth-personal":369,"web3-net":373,"web3-utils":393}],373:[function(t,e,r){var n=t("web3-core"),i=t("web3-core-method"),o=t("web3-utils"),a=function(){var t=this;n.packageInit(this,arguments),[new i({name:"getId",call:"net_version",params:0,outputFormatter:o.hexToNumber}),new i({name:"isListening",call:"net_listening",params:0}),new i({name:"getPeerCount",call:"net_peerCount",params:0,outputFormatter:o.hexToNumber})].forEach(function(e){e.attachToObject(t),e.setRequestManager(t._requestManager)})};n.addProviders(a),e.exports=a},{"web3-core":209,"web3-core-method":193,"web3-utils":393}],374:[function(t,e,r){e.exports=XMLHttpRequest},{}],375:[function(t,e,r){var n=t("web3-core-helpers").errors,i=t("xhr2"),o=function(t,e,r){this.host=t||"http://localhost:8545",this.timeout=e||0,this.connected=!1,this.headers=r};o.prototype._prepareRequest=function(){var t=new i;return t.open("POST",this.host,!0),t.setRequestHeader("Content-Type","application/json"),this.headers&&this.headers.forEach(function(e){t.setRequestHeader(e.name,e.value)}),t},o.prototype.send=function(t,e){var r=this,i=this._prepareRequest();i.onreadystatechange=function(){if(4===i.readyState&&1!==i.timeout){var t=i.responseText,o=null;try{t=JSON.parse(t)}catch(t){o=n.InvalidResponse(i.responseText)}r.connected=!0,e(o,t)}},i.ontimeout=function(){r.connected=!1,e(n.ConnectionTimeout(this.timeout))};try{i.send(JSON.stringify(t))}catch(t){this.connected=!1,e(n.InvalidConnection(this.host))}},e.exports=o},{"web3-core-helpers":191,xhr2:374}],376:[function(t,e,r){!function(t,n,i,o,a,s){var u=l(function(t,e){var r=e.length;return l(function(n){for(var i=0;i0;)if(U+=r,r=t.charAt(o++),4===z?(O+=String.fromCharCode(parseInt(U,16)),z=0,f=o-1):z++,!r)break t;if('"'===r&&!L){q=D.pop()||p,O+=t.substring(f,o-1);break}if(!("\\"!==r||L||(L=!0,O+=t.substring(f,o-1),r=t.charAt(o++))))break;if(L){if(L=!1,"n"===r?O+="\n":"r"===r?O+="\r":"t"===r?O+="\t":"f"===r?O+="\f":"b"===r?O+="\b":"u"===r?(z=1,U=""):O+=r,r=t.charAt(o++),f=o-1,r)continue;break}h.lastIndex=o;var d=h.exec(t);if(!d){o=t.length+1,O+=t.substring(f,o-1);break}if(o=d.index+1,!(r=t.charAt(d.index))){O+=t.substring(f,o-1);break}}continue;case M:if(!r)continue;if("r"!==r)return X("Invalid true started with t"+r);q=x;continue;case x:if(!r)continue;if("u"!==r)return X("Invalid true started with tr"+r);q=k;continue;case k:if(!r)continue;if("e"!==r)return X("Invalid true started with tru"+r);a(!0),u(),q=D.pop()||p;continue;case S:if(!r)continue;if("a"!==r)return X("Invalid false started with f"+r);q=E;continue;case E:if(!r)continue;if("l"!==r)return X("Invalid false started with fa"+r);q=A;continue;case A:if(!r)continue;if("s"!==r)return X("Invalid false started with fal"+r);q=j;continue;case j:if(!r)continue;if("e"!==r)return X("Invalid false started with fals"+r);a(!1),u(),q=D.pop()||p;continue;case I:if(!r)continue;if("u"!==r)return X("Invalid null started with n"+r);q=B;continue;case B:if(!r)continue;if("l"!==r)return X("Invalid null started with nu"+r);q=T;continue;case T:if(!r)continue;if("l"!==r)return X("Invalid null started with nul"+r);a(null),u(),q=D.pop()||p;continue;case C:if("."!==r)return X("Leading zero not followed by .");N+=r,q=P;continue;case P:if(-1!=="0123456789".indexOf(r))N+=r;else if("."===r){if(-1!==N.indexOf("."))return X("Invalid number has two dots");N+=r}else if("e"===r||"E"===r){if(-1!==N.indexOf("e")||-1!==N.indexOf("E"))return X("Invalid number has two exponential");N+=r}else if("+"===r||"-"===r){if("e"!==n&&"E"!==n)return X("Invalid symbol in number");N+=r}else N&&(a(parseFloat(N)),u(),N=""),o--,q=D.pop()||p;continue;default:return X("Unknown state: "+q)}H>=R&&(J=0,O!==s&&O.length>c&&(X("Max buffer length exceeded: textNode"),J=Math.max(J,O.length)),N.length>c&&(X("Max buffer length exceeded: numberNode"),J=Math.max(J,N.length)),R=c-J+H);var J}),t(ft).on(function(){if(q==l)return a({}),u(),void(F=!0);q===p&&0===K||X("Unexpected end");O!==s&&(a(O),u(),O=s);F=!0})}var R,O,N,L,F,q,D,U,z,K,H,V=(R=l(function(t){return t.unshift(/^/),(e=RegExp(t.map(c("source")).join(""))).exec.bind(e);var e}),L=R(O=/(\$?)/,/([\w-_]+|\*)/,N=/(?:{([\w ]*?)})?/),F=R(O,/\["([^"]+)"\]/,N),q=R(O,/\[(\d+|\*)\]/,N),D=R(O,/()/,/{([\w ]*?)}/),U=R(/\.\./),z=R(/\./),K=R(O,/!/),H=R(/$/),function(t){return t(h(L,F,q,D),U,z,K,H)});function W(t,e){return{key:t,node:e}}var X=c("key"),G=c("node"),J={};function Z(t){var e=t(tt).emit,r=t(et).emit,n=t(at).emit,o=t(ot).emit;function a(t,e,r){G(k(t))[e]=r}function s(t,r,n){t&&a(t,r,n);var i=M(W(r,n),t);return e(i),i}var u={};return u[dt]=function(t,e){if(!t)return n(e),s(t,J,e);var r,o,u,f=(o=e,u=G(k(r=t)),y(i,u)?s(r,v(u),o):r),c=S(f),h=X(k(f));return a(c,h,e),M(W(h,e),c)},u[lt]=function(t){return r(t),S(t)||o(G(k(t)))},u[ht]=s,u}var $=V(function(t,e,r,n,i){var a=1,s=2,c=3,d=f(X,k),l=f(G,k);function b(t,e){return!!e[a]?p(t,k):t}function y(t){if(t==m)return m;return p(function(t){return d(t)!=J},f(t,S))}function g(){return function(t){return d(t)==J}}function w(t,e,r,n,i){var o,a=t(r);if(a){var s=(o=a,B(function(t,e){return e(t,o)},n,e));return i(r.substr(v(a[0])),s)}}function M(t,e){return u(w,t,e)}var x=h(M(t,A(b,function(t,e){var r=e[c];return r?p(f(u(_,E(r.split(/\W+/))),l),t):t},function(t,e){var r=e[s];return p(r&&"*"!=r?function(t){return d(t)==r}:m,t)},y)),M(e,A(function(t){if(t==m)return m;var e=g(),r=t,n=y(function(t){return i(t)}),i=h(e,r,n);return i})),M(r,A()),M(n,A(b,g)),M(i,A(function(t){return function(e){var r=t(e);return!0===r?k(e):r}})),function(t){throw o('"'+t+'" could not be tokenised')});function j(t,e){return e}function I(t,e){return x(t,e,t?I:j)}return function(t){try{return I(t,m)}catch(e){throw o('Could not compile "'+t+'" because '+e.message)}}});function Y(t,e,r){var n,i;function o(t){return function(e){return e.id==t}}return{on:function(r,o){var a={listener:r,id:o||r};return e&&e.emit(t,r,a.id),n=M(a,n),i=M(r,i),this},emit:function(){!function t(e,r){e&&(k(e).apply(null,r),t(S(e),r))}(i,arguments)},un:function(e){var a;n=T(n,o(e),function(t){a=t}),a&&(i=T(i,function(t){return t==a.listener}),r&&r.emit(t,a.listener,a.id))},listeners:function(){return i},hasListener:function(t){return w(function t(e,r){return r&&(e(k(r))?k(r):t(e,S(r)))}(t?o(t):m,n))}}}var Q=1,tt=Q++,et=Q++,rt=Q++,nt=Q++,it="fail",ot=Q++,at=Q++,st="start",ut="data",ft="end",ct=Q++,ht=Q++,dt=Q++,lt=Q++;function pt(t,e,r){try{var n=a.parse(e)}catch(t){}return{statusCode:t,body:e,jsonBody:n,thrown:r}}function bt(t,e){var r={node:t(et),path:t(tt)};function n(e,r,n){var i=t(e).emit;r.on(function(t){var e,r,o,a=n(t);!1!==a&&(e=i,r=G(a),o=C(t),e(r,j(S(I(X,o))),j(I(G,o))))},e),t("removeListener").on(function(n){n==e&&(t(n).listeners()||r.un(e))})}t("newListener").on(function(t){var i=/(node|path):(.*)/.exec(t);if(i){var o=r[i[1]];o.hasListener(t)||n(t,o,e(i[2]))}})}function mt(t,e){var r,n=/^(node|path):./,i=t(ot),o=t(nt).emit,a=t(rt).emit,s=l(function(e,i){if(r[e])d(i,r[e]);else{var o=t(e),a=i[0];n.test(e)?f(o,a):o.on(a)}return r});function f(t,e,n){n=n||e;var i=c(e);return t.on(function(){var e=!1;r.forget=function(){e=!0},d(arguments,i),delete r.forget,e&&t.un(n)},n),r}function c(t){return function(){try{return t.apply(r,arguments)}catch(t){setTimeout(function(){throw t})}}}function h(e,r,n){var i,s;"node"==e?(s=n,i=function(){var t=s.apply(this,arguments);w(t)&&(t==gt.drop?o():a(t))}):i=n,f(t(e+":"+r),i,n)}function p(t,e,n){return g(e)?h(t,e,n):function(t,e){for(var r in e)h(t,r,e[r])}(t,e),r}return t(at).on(function(t){var e;r.root=(e=t,function(){return e})}),t(st).on(function(t,e){r.header=function(t){return t?e[t]:e}}),r={on:s,addListener:s,removeListener:function(e,n,o){if("done"==e)i.un(n);else if("node"==e||"path"==e)t.un(e+":"+n,o);else{var a=n;t(e).un(a)}return r},emit:t.emit,node:u(p,"node"),path:u(p,"path"),done:u(f,i),start:u(function(e,n){return t(e).on(c(n),n),r},st),fail:t(it).on,abort:t(ct).emit,header:b,root:b,source:e}}function yt(e,r,n,i,o){var a=function(){var t={},e=n("newListener"),r=n("removeListener");function n(n){return t[n]=Y(n,e,r)}function i(e){return t[e]||n(e)}return["emit","on","un"].forEach(function(t){i[t]=l(function(e,r){d(r,i(e)[t])})}),i}();return r&&function(e,r,n,i,o,a,f){var c,h=e(ut).emit,d=e(it).emit,l=0,p=!0;function b(){var t=r.responseText,e=t.substr(l);e&&h(e),l=v(t)}e(ct).on(function(){r.onreadystatechange=null,r.abort()}),"onprogress"in r&&(r.onprogress=b),r.onreadystatechange=function(){function t(){try{p&&e(st).emit(r.status,(t=r.getAllResponseHeaders(),n={},t&&t.split("\r\n").forEach(function(t){var e=t.indexOf(": ");n[t.substring(0,e)]=t.substring(e+2)}),n)),p=!1}catch(t){}var t,n}switch(r.readyState){case 2:case 3:return t();case 4:t(),2==String(r.status)[0]?(b(),e(ft).emit()):d(pt(r.status,r.responseText))}};try{for(var m in r.open(n,i,!0),a)r.setRequestHeader(m,a[m]);(function(t,e){function r(e){return e.port||{"http:":80,"https:":443}[e.protocol||t.protocol]}return!!(e.protocol&&e.protocol!=t.protocol||e.host&&e.host!=t.host||e.host&&r(e)!=r(t))})(t.location,{protocol:(c=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(i)||[])[1]||"",host:c[2]||"",port:c[3]||""})||r.setRequestHeader("X-Requested-With","XMLHttpRequest"),r.withCredentials=f,r.send(o)}catch(e){t.setTimeout(u(d,pt(s,s,e)),0)}}(a,new XMLHttpRequest,e,r,n,i,o),P(a),function(t,e){var r,n={};function i(t){return function(e){r=t(r,e)}}for(var o in e)t(o).on(i(e[o]),n);t(rt).on(function(t){var e=k(r),n=X(e),i=S(r);i&&(G(k(i))[n]=t)}),t(nt).on(function(){var t=k(r),e=X(t),n=S(r);n&&delete G(k(n))[e]}),t(ct).on(function(){for(var r in e)t(r).un(n)})}(a,Z(a)),bt(a,$),mt(a,r)}function vt(t,e,r,n,i,o,s){return i=i?a.parse(a.stringify(i)):{},n?g(n)||(n=a.stringify(n),i["Content-Type"]=i["Content-Type"]||"application/json"):n=null,t(r||"GET",(u=e,!1===s&&(-1==u.indexOf("?")?u+="?":u+="&",u+="_="+(new Date).getTime()),u),n,i,o||!1);var u}function gt(t){var e=A("resume","pause","pipe"),r=u(_,e);return t?r(t)||g(t)?vt(yt,t):vt(yt,t.url,t.method,t.body,t.headers,t.withCredentials,t.cached):yt()}gt.drop=function(){return gt.drop},"function"==typeof define&&define.amd?define("oboe",[],function(){return gt}):"object"===(void 0===r?"undefined":_typeof(r))?e.exports=gt:t.oboe=gt}(function(){try{return window}catch(t){return self}}(),Object,Array,Error,JSON)},{}],377:[function(t,e,r){arguments[4][178][0].apply(r,arguments)},{dup:178}],378:[function(t,e,r){var n=t("underscore"),i=t("web3-core-helpers").errors,o=t("oboe"),a=function(t,e){var r=this;this.responseCallbacks={},this.notificationCallbacks=[],this.path=t,this.connection=e.connect({path:this.path}),this.addDefaultEvents();var i=function(t){var e=null;n.isArray(t)?t.forEach(function(t){r.responseCallbacks[t.id]&&(e=t.id)}):e=t.id,e||-1===t.method.indexOf("_subscription")?r.responseCallbacks[e]&&(r.responseCallbacks[e](null,t),delete r.responseCallbacks[e]):r.notificationCallbacks.forEach(function(e){n.isFunction(e)&&e(t)})};"Socket"===e.constructor.name?o(this.connection).done(i):this.connection.on("data",function(t){r._parseResponse(t.toString()).forEach(i)})};a.prototype.addDefaultEvents=function(){var t=this;this.connection.on("connect",function(){}),this.connection.on("error",function(){t._timeout()}),this.connection.on("end",function(){t._timeout()}),this.connection.on("timeout",function(){t._timeout()})},a.prototype._parseResponse=function(t){var e=this,r=[];return t.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach(function(t){e.lastChunk&&(t=e.lastChunk+t);var n=null;try{n=JSON.parse(t)}catch(r){return e.lastChunk=t,clearTimeout(e.lastChunkTimeout),void(e.lastChunkTimeout=setTimeout(function(){throw e._timeout(),i.InvalidResponse(t)},15e3))}clearTimeout(e.lastChunkTimeout),e.lastChunk=null,n&&r.push(n)}),r},a.prototype._addResponseCallback=function(t,e){var r=t.id||t[0].id,n=t.method||t[0].method;this.responseCallbacks[r]=e,this.responseCallbacks[r].method=n},a.prototype._timeout=function(){for(var t in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(t)&&(this.responseCallbacks[t](i.InvalidConnection("on IPC")),delete this.responseCallbacks[t])},a.prototype.reconnect=function(){this.connection.connect({path:this.path})},a.prototype.send=function(t,e){this.connection.writable||this.connection.connect({path:this.path}),this.connection.write(JSON.stringify(t)),this._addResponseCallback(t,e)},a.prototype.on=function(t,e){if("function"!=typeof e)throw new Error("The second parameter callback must be a function.");switch(t){case"data":this.notificationCallbacks.push(e);break;default:this.connection.on(t,e)}},a.prototype.once=function(t,e){if("function"!=typeof e)throw new Error("The second parameter callback must be a function.");this.connection.once(t,e)},a.prototype.removeListener=function(t,e){var r=this;switch(t){case"data":this.notificationCallbacks.forEach(function(t,n){t===e&&r.notificationCallbacks.splice(n,1)});break;default:this.connection.removeListener(t,e)}},a.prototype.removeAllListeners=function(t){switch(t){case"data":this.notificationCallbacks=[];break;default:this.connection.removeAllListeners(t)}},a.prototype.reset=function(){this._timeout(),this.notificationCallbacks=[],this.connection.removeAllListeners("error"),this.connection.removeAllListeners("end"),this.connection.removeAllListeners("timeout"),this.addDefaultEvents()},e.exports=a},{oboe:376,underscore:377,"web3-core-helpers":191}],379:[function(t,e,r){arguments[4][178][0].apply(r,arguments)},{dup:178}],380:[function(t,e,r){(function(r){var n=t("underscore"),i=t("web3-core-helpers").errors,o=null,a=null,s=null;"undefined"!=typeof window?(o=window.WebSocket,a=btoa,s=function(t){return new URL(t)}):(o=t("websocket").w3cwebsocket,a=function(t){return r(t).toString("base64")},s=t("url").parse);var u=function(t,e){var r=this;this.responseCallbacks={},this.notificationCallbacks=[],e=e||{},this._customTimeout=e.timeout;var i=s(t),u=e.headers||{};i.username&&i.password&&(u.authorization="Basic "+a(i.username+":"+i.password)),this.connection=new o(t,void 0,void 0,u),this.addDefaultEvents(),this.connection.onmessage=function(t){var e="string"==typeof t.data?t.data:"";r._parseResponse(e).forEach(function(t){var e=null;n.isArray(t)?t.forEach(function(t){r.responseCallbacks[t.id]&&(e=t.id)}):e=t.id,e||-1===t.method.indexOf("_subscription")?r.responseCallbacks[e]&&(r.responseCallbacks[e](null,t),delete r.responseCallbacks[e]):r.notificationCallbacks.forEach(function(e){n.isFunction(e)&&e(t)})})}};u.prototype.addDefaultEvents=function(){var t=this;this.connection.onerror=function(){t._timeout()},this.connection.onclose=function(){t._timeout(),t.reset()}},u.prototype._parseResponse=function(t){var e=this,r=[];return t.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach(function(t){e.lastChunk&&(t=e.lastChunk+t);var n=null;try{n=JSON.parse(t)}catch(r){return e.lastChunk=t,clearTimeout(e.lastChunkTimeout),void(e.lastChunkTimeout=setTimeout(function(){throw e._timeout(),i.InvalidResponse(t)},15e3))}clearTimeout(e.lastChunkTimeout),e.lastChunk=null,n&&r.push(n)}),r},u.prototype._addResponseCallback=function(t,e){var r=t.id||t[0].id,n=t.method||t[0].method;this.responseCallbacks[r]=e,this.responseCallbacks[r].method=n;var o=this;this._customTimeout&&setTimeout(function(){o.responseCallbacks[r]&&(o.responseCallbacks[r](i.ConnectionTimeout(o._customTimeout)),delete o.responseCallbacks[r])},this._customTimeout)},u.prototype._timeout=function(){for(var t in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(t)&&(this.responseCallbacks[t](i.InvalidConnection("on WS")),delete this.responseCallbacks[t])},u.prototype.send=function(t,e){var r=this;if(this.connection.readyState!==this.connection.CONNECTING){if(this.connection.readyState!==this.connection.OPEN)return console.error("connection not open on send()"),"function"==typeof this.connection.onerror?this.connection.onerror(new Error("connection not open")):console.error("no error callback"),void e(new Error("connection not open"));this.connection.send(JSON.stringify(t)),this._addResponseCallback(t,e)}else setTimeout(function(){r.send(t,e)},10)},u.prototype.on=function(t,e){if("function"!=typeof e)throw new Error("The second parameter callback must be a function.");switch(t){case"data":this.notificationCallbacks.push(e);break;case"connect":this.connection.onopen=e;break;case"end":this.connection.onclose=e;break;case"error":this.connection.onerror=e}},u.prototype.removeListener=function(t,e){var r=this;switch(t){case"data":this.notificationCallbacks.forEach(function(t,n){t===e&&r.notificationCallbacks.splice(n,1)})}},u.prototype.removeAllListeners=function(t){switch(t){case"data":this.notificationCallbacks=[];break;case"connect":this.connection.onopen=null;break;case"end":this.connection.onclose=null;break;case"error":this.connection.onerror=null}},u.prototype.reset=function(){this._timeout(),this.notificationCallbacks=[],this.addDefaultEvents()},e.exports=u}).call(this,t("buffer").Buffer)},{buffer:47,underscore:379,url:158,"web3-core-helpers":191,websocket:45}],381:[function(t,e,r){var n=t("web3-core"),i=t("web3-core-subscriptions").subscriptions,o=t("web3-core-method"),a=t("web3-net"),s=function(){var t=this;n.packageInit(this,arguments);var e=this.setProvider;this.setProvider=function(){e.apply(t,arguments),t.net.setProvider.apply(t,arguments)},this.clearSubscriptions=t._requestManager.clearSubscriptions,this.net=new a(this.currentProvider),[new i({name:"subscribe",type:"shh",subscriptions:{messages:{params:1}}}),new o({name:"getVersion",call:"shh_version",params:0}),new o({name:"getInfo",call:"shh_info",params:0}),new o({name:"setMaxMessageSize",call:"shh_setMaxMessageSize",params:1}),new o({name:"setMinPoW",call:"shh_setMinPoW",params:1}),new o({name:"markTrustedPeer",call:"shh_markTrustedPeer",params:1}),new o({name:"newKeyPair",call:"shh_newKeyPair",params:0}),new o({name:"addPrivateKey",call:"shh_addPrivateKey",params:1}),new o({name:"deleteKeyPair",call:"shh_deleteKeyPair",params:1}),new o({name:"hasKeyPair",call:"shh_hasKeyPair",params:1}),new o({name:"getPublicKey",call:"shh_getPublicKey",params:1}),new o({name:"getPrivateKey",call:"shh_getPrivateKey",params:1}),new o({name:"newSymKey",call:"shh_newSymKey",params:0}),new o({name:"addSymKey",call:"shh_addSymKey",params:1}),new o({name:"generateSymKeyFromPassword",call:"shh_generateSymKeyFromPassword",params:1}),new o({name:"hasSymKey",call:"shh_hasSymKey",params:1}),new o({name:"getSymKey",call:"shh_getSymKey",params:1}),new o({name:"deleteSymKey",call:"shh_deleteSymKey",params:1}),new o({name:"newMessageFilter",call:"shh_newMessageFilter",params:1}),new o({name:"getFilterMessages",call:"shh_getFilterMessages",params:1}),new o({name:"deleteMessageFilter",call:"shh_deleteMessageFilter",params:1}),new o({name:"post",call:"shh_post",params:1,inputFormatter:[null]})].forEach(function(e){e.attachToObject(t),e.setRequestManager(t._requestManager)})};n.addProviders(s),e.exports=s},{"web3-core":209,"web3-core-method":193,"web3-core-subscriptions":206,"web3-net":373}],382:[function(t,e,r){arguments[4][210][0].apply(r,arguments)},{dup:210}],383:[function(t,e,r){arguments[4][165][0].apply(r,arguments)},{dup:165}],384:[function(t,e,r){var n=t("bn.js"),i=t("number-to-bn"),o=new n(0),a=new n(-1),s={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};function u(t){var e=t?t.toLowerCase():"ether",r=s[e];if("string"!=typeof r)throw new Error("[ethjs-unit] the unit provided "+t+" doesn't exists, please use the one of the following units "+JSON.stringify(s,null,2));return new n(r,10)}function f(t){if("string"==typeof t){if(!t.match(/^-?[0-9.]+$/))throw new Error("while converting number to string, invalid number value '"+t+"', should be a number matching (^-?[0-9.]+).");return t}if("number"==typeof t)return String(t);if("object"===(void 0===t?"undefined":_typeof(t))&&t.toString&&(t.toTwos||t.dividedToIntegerBy))return t.toPrecision?String(t.toPrecision()):t.toString(10);throw new Error("while converting number to string, invalid number value '"+t+"' type "+(void 0===t?"undefined":_typeof(t))+".")}e.exports={unitMap:s,numberToString:f,getValueOfUnit:u,fromWei:function(t,e,r){var n=i(t),f=n.lt(o),c=u(e),h=s[e].length-1||1,d=r||{};f&&(n=n.mul(a));for(var l=n.mod(c).toString(10);l.length2)throw new Error("[ethjs-unit] while converting number "+t+" to wei, too many decimal points");var d=h[0],l=h[1];if(d||(d="0"),l||(l="0"),l.length>o)throw new Error("[ethjs-unit] while converting number "+t+" to wei, too many decimal places");for(;l.length65536){if(!i)throw new Error("Requested too many random bytes.");r(new Error("Requested too many random bytes."))}if(void 0!==n&&n.randomBytes){if(!i)return"0x"+n.randomBytes(e).toString("hex");n.randomBytes(e,function(t,e){t?r(u):r(null,"0x"+e.toString("hex"))})}else{var o;if(void 0!==n?o=n:"undefined"!=typeof msCrypto&&(o=msCrypto),o&&o.getRandomValues){var a=o.getRandomValues(new Uint8Array(e)),s="0x"+Array.from(a).map(function(t){return t.toString(16)}).join("");if(!i)return s;r(null,s)}else{var u=new Error('No "crypto" object available. This Browser doesn\'t support generating secure random bytes.');if(!i)throw u;r(u)}}}},{"./crypto.js":388}],390:[function(t,e,r){var n=t("is-hex-prefixed");e.exports=function(t){return"string"!=typeof t?t:n(t)?t.slice(2):t}},{"is-hex-prefixed":385}],391:[function(t,e,r){arguments[4][178][0].apply(r,arguments)},{dup:178}],392:[function(t,e,r){(function(t){!function(n){var i="object"==(void 0===r?"undefined":_typeof(r))&&r,o="object"==(void 0===e?"undefined":_typeof(e))&&e&&e.exports==i&&e,a="object"==(void 0===t?"undefined":_typeof(t))&&t;a.global!==a&&a.window!==a||(n=a);var s,u,f,c=String.fromCharCode;function h(t){for(var e,r,n=[],i=0,o=t.length;i=55296&&e<=56319&&i=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function l(t,e){return c(t>>e&63|128)}function p(t){if(0==(4294967168&t))return c(t);var e="";return 0==(4294965248&t)?e=c(t>>6&31|192):0==(4294901760&t)?(d(t),e=c(t>>12&15|224),e+=l(t,6)):0==(4292870144&t)&&(e=c(t>>18&7|240),e+=l(t,12),e+=l(t,6)),e+=c(63&t|128)}function b(){if(f>=u)throw Error("Invalid byte index");var t=255&s[f];if(f++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function m(){var t,e;if(f>u)throw Error("Invalid byte index");if(f==u)return!1;if(t=255&s[f],f++,0==(128&t))return t;if(192==(224&t)){if((e=(31&t)<<6|b())>=128)return e;throw Error("Invalid continuation byte")}if(224==(240&t)){if((e=(15&t)<<12|b()<<6|b())>=2048)return d(e),e;throw Error("Invalid continuation byte")}if(240==(248&t)&&(e=(15&t)<<18|b()<<12|b()<<6|b())>=65536&&e<=1114111)return e;throw Error("Invalid UTF-8 detected")}var y={version:"2.0.0",encode:function(t){for(var e=h(t),r=e.length,n=-1,i="";++n65535&&(i+=c((e-=65536)>>>10&1023|55296),e=56320|1023&e),i+=c(e);return i}(r)}};if("function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define(function(){return y});else if(i&&!i.nodeType)if(o)o.exports=y;else{var v={}.hasOwnProperty;for(var g in y)v.call(y,g)&&(i[g]=y[g])}else n.utf8=y}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],393:[function(t,e,r){var n=t("underscore"),i=t("ethjs-unit"),o=t("./utils.js"),a=t("./soliditySha3.js"),s=t("randomhex"),u=function(t){if(!o.isHexStrict(t))throw new Error("The parameter must be a valid HEX string.");var e="",r=0,n=t.length;for("0x"===t.substring(0,2)&&(r=2);r7?r+=t[n].toUpperCase():r+=t[n];return r},toHex:o.toHex,toBN:o.toBN,bytesToHex:o.bytesToHex,hexToBytes:o.hexToBytes,hexToNumberString:o.hexToNumberString,hexToNumber:o.hexToNumber,toDecimal:o.hexToNumber,numberToHex:o.numberToHex,fromDecimal:o.numberToHex,hexToUtf8:o.hexToUtf8,hexToString:o.hexToUtf8,toUtf8:o.hexToUtf8,utf8ToHex:o.utf8ToHex,stringToHex:o.utf8ToHex,fromUtf8:o.utf8ToHex,hexToAscii:u,toAscii:u,asciiToHex:f,fromAscii:f,unitMap:i.unitMap,toWei:function(t,e){if(e=c(e),!o.isBN(t)&&!n.isString(t))throw new Error("Please pass numbers as strings or BigNumber objects to avoid precision errors.");return o.isBN(t)?i.toWei(t,e):i.toWei(t,e).toString(10)},fromWei:function(t,e){if(e=c(e),!o.isBN(t)&&!n.isString(t))throw new Error("Please pass numbers as strings or BigNumber objects to avoid precision errors.");return o.isBN(t)?i.fromWei(t,e):i.fromWei(t,e).toString(10)},padLeft:o.leftPad,leftPad:o.leftPad,padRight:o.rightPad,rightPad:o.rightPad,toTwosComplement:o.toTwosComplement}},{"./soliditySha3.js":394,"./utils.js":395,"ethjs-unit":384,randomhex:389,underscore:391}],394:[function(t,e,r){var n=t("underscore"),i=t("bn.js"),o=t("./utils.js"),a=function(t){var e=void 0===t?"undefined":_typeof(t);if("string"===e)return o.isHexStrict(t)?new i(t.replace(/0x/i,""),16):new i(t,10);if("number"===e)return new i(t);if(o.isBigNumber(t))return new i(t.toString(10));if(o.isBN(t))return t;throw new Error(t+" is not a number")},s=function(t,e,r){var n,s,u,f;if("bytes"===(t=(u=t).startsWith("int[")?"int256"+u.slice(3):"int"===u?"int256":u.startsWith("uint[")?"uint256"+u.slice(4):"uint"===u?"uint256":u.startsWith("fixed[")?"fixed128x128"+u.slice(5):"fixed"===u?"fixed128x128":u.startsWith("ufixed[")?"ufixed128x128"+u.slice(6):"ufixed"===u?"ufixed128x128":u)){if(e.replace(/^0x/i,"").length%2!=0)throw new Error("Invalid bytes characters "+e.length);return e}if("string"===t)return o.utf8ToHex(e);if("bool"===t)return e?"01":"00";if(t.startsWith("address")){if(n=r?64:40,!o.isAddress(e))throw new Error(e+" is not a valid address, or the checksum is invalid.");return o.leftPad(e.toLowerCase(),n)}if(n=(f=/^\D+(\d+).*$/.exec(t))?parseInt(f[1],10):null,t.startsWith("bytes")){if(!n)throw new Error("bytes[] not yet supported in solidity");if(r&&(n=32),n<1||n>32||n256)throw new Error("Invalid uint"+n+" size");if((s=a(e)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+s.bitLength());if(s.lt(new i(0)))throw new Error("Supplied uint "+s.toString()+" is negative");return n?o.leftPad(s.toString("hex"),n/8*2):s}if(t.startsWith("int")){if(n%8||n<8||n>256)throw new Error("Invalid int"+n+" size");if((s=a(e)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+s.bitLength());return s.lt(new i(0))?s.toTwos(n).toString("hex"):n?o.leftPad(s.toString("hex"),n/8*2):s}throw new Error("Unsupported or invalid type: "+t)},u=function(t){if(n.isArray(t))throw new Error("Autodetection of array types is not supported.");var e,r,a,u="";if(n.isObject(t)&&(t.hasOwnProperty("v")||t.hasOwnProperty("t")||t.hasOwnProperty("value")||t.hasOwnProperty("type"))?(e=t.hasOwnProperty("t")?t.t:t.type,u=t.hasOwnProperty("v")?t.v:t.value):(e=o.toHex(t,!0),u=o.toHex(t),e.startsWith("int")||e.startsWith("uint")||(e="bytes")),!e.startsWith("int")&&!e.startsWith("uint")||"string"!=typeof u||/^(-)?0x/i.test(u)||(u=new i(u)),n.isArray(u)){if(a=/^\D+\d*\[(\d+)\]$/.exec(e),(r=a?parseInt(a[1],10):null)&&u.length!==r)throw new Error(e+" is not matching the given array "+JSON.stringify(u));r=u.length}return n.isArray(u)?u.map(function(t){return s(e,t,r).toString("hex").replace("0x","")}).join(""):s(e,u,r).toString("hex").replace("0x","")};e.exports=function(){var t=Array.prototype.slice.call(arguments),e=n.map(t,u);return o.sha3("0x"+e.join(""))}},{"./utils.js":395,"bn.js":382,underscore:391}],395:[function(t,e,r){var n=t("underscore"),i=t("bn.js"),o=t("number-to-bn"),a=t("utf8"),s=t("eth-lib/lib/hash"),u=function(t){return t instanceof i||t&&t.constructor&&"BN"===t.constructor.name},f=function(t){return t&&t.constructor&&"BigNumber"===t.constructor.name},c=function(t){try{return o.apply(null,arguments)}catch(e){throw new Error(e+' Given value: "'+t+'"')}},h=function(t){return!!/^(0x)?[0-9a-f]{40}$/i.test(t)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(t)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(t))||d(t))},d=function(t){t=t.replace(/^0x/i,"");for(var e=y(t.toLowerCase()).replace(/^0x/i,""),r=0;r<40;r++)if(parseInt(e[r],16)>7&&t[r].toUpperCase()!==t[r]||parseInt(e[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},l=function(t){var e="";t=(t=(t=(t=(t=a.encode(t)).replace(/^(?:\u0000)*/,"")).split("").reverse().join("")).replace(/^(?:\u0000)*/,"")).split("").reverse().join("");for(var r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x"+e.join("")},isHex:function(t){return(n.isString(t)||n.isNumber(t))&&/^(-0x|0x)?[0-9a-f]*$/i.test(t)},isHexStrict:m,leftPad:function(t,e,r){var n=/^0x/i.test(t)||"number"==typeof t,i=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(i).join(r||"0")+t},rightPad:function(t,e,r){var n=/^0x/i.test(t)||"number"==typeof t,i=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(i).join(r||"0")},toTwosComplement:function(t){return"0x"+c(t).toTwos(256).toString(16,64)},sha3:y}},{"bn.js":382,"eth-lib/lib/hash":383,"number-to-bn":386,underscore:391,utf8:392}],396:[function(t,e,r){e.exports={name:"web3",namespace:"ethereum",version:"1.0.0-beta.34",description:"Ethereum JavaScript API",repository:"https://github.com/ethereum/web3.js/tree/master/packages/web3",license:"LGPL-3.0",main:"src/index.js",types:"index.d.ts",bugs:{url:"https://github.com/ethereum/web3.js/issues"},keywords:["Ethereum","JavaScript","API"],author:"ethereum.org",authors:[{name:"Fabian Vogelsteller",email:"fabian@ethereum.org",homepage:"http://frozeman.de"},{name:"Marek Kotewicz",email:"marek@parity.io",url:"https://github.com/debris"},{name:"Marian Oancea",url:"https://github.com/cubedro"},{name:"Gav Wood",email:"g@parity.io",homepage:"http://gavwood.com"},{name:"Jeffery Wilcke",email:"jeffrey.wilcke@ethereum.org",url:"https://github.com/obscuren"}],dependencies:{"web3-bzz":"1.0.0-beta.34","web3-core":"1.0.0-beta.34","web3-eth":"1.0.0-beta.34","web3-eth-personal":"1.0.0-beta.34","web3-net":"1.0.0-beta.34","web3-shh":"1.0.0-beta.34","web3-utils":"1.0.0-beta.34"}}},{}],BN:[function(t,e,r){arguments[4][240][0].apply(r,arguments)},{buffer:17,dup:240}],Web3:[function(t,e,r){var n=t("../package.json").version,i=t("web3-core"),o=t("web3-eth"),a=t("web3-net"),s=t("web3-eth-personal"),u=t("web3-shh"),f=t("web3-bzz"),c=t("web3-utils"),h=function(){var t=this;i.packageInit(this,arguments),this.version=n,this.utils=c,this.eth=new o(this),this.shh=new u(this),this.bzz=new f(this);var e=this.setProvider;this.setProvider=function(r,n){return e.apply(t,arguments),this.eth.setProvider(r,n),this.shh.setProvider(r,n),this.bzz.setProvider(r),!0}};h.version=n,h.utils=c,h.modules={Eth:o,Net:a,Personal:s,Shh:u,Bzz:f},i.addProviders(h),e.exports=h},{"../package.json":396,"web3-bzz":187,"web3-core":209,"web3-eth":372,"web3-eth-personal":369,"web3-net":373,"web3-shh":381,"web3-utils":393}]},{},["Web3"])("Web3")}); diff --git a/test/e2e/snaps/test-snap-bip-44.spec.js b/test/e2e/snaps/test-snap-bip-44.spec.js index 763d6a3a7..eb37ab42c 100644 --- a/test/e2e/snaps/test-snap-bip-44.spec.js +++ b/test/e2e/snaps/test-snap-bip-44.spec.js @@ -18,9 +18,6 @@ describe('Test Snap bip-44', function () { fixtures: 'imported-account', ganacheOptions, title: this.test.title, - driverOptions: { - type: 'flask', - }, }, async ({ driver }) => { await driver.navigate(); @@ -67,12 +64,12 @@ describe('Test Snap bip-44', function () { windowHandles, ); await driver.clickElement({ - text: 'Approve & Install', + text: 'Approve & install', tag: 'button', }); // deal with permissions popover await driver.delay(1000); - await driver.press('#warning-accept', driver.Key.SPACE); + await driver.press('#key-access-bip44-0', driver.Key.SPACE); await driver.clickElement({ text: 'Confirm', tag: 'button', diff --git a/test/e2e/snaps/test-snap-confirm.spec.js b/test/e2e/snaps/test-snap-confirm.spec.js index 49caa9e89..f4dcfa99d 100644 --- a/test/e2e/snaps/test-snap-confirm.spec.js +++ b/test/e2e/snaps/test-snap-confirm.spec.js @@ -18,9 +18,6 @@ describe('Test Snap Confirm', function () { fixtures: 'imported-account', ganacheOptions, title: this.test.title, - driverOptions: { - type: 'flask', - }, }, async ({ driver }) => { await driver.navigate(); @@ -59,7 +56,7 @@ describe('Test Snap Confirm', function () { windowHandles, ); await driver.clickElement({ - text: 'Approve & Install', + text: 'Approve & install', tag: 'button', }); diff --git a/test/e2e/snaps/test-snap-error.spec.js b/test/e2e/snaps/test-snap-error.spec.js index 734520600..bb4fc251a 100644 --- a/test/e2e/snaps/test-snap-error.spec.js +++ b/test/e2e/snaps/test-snap-error.spec.js @@ -19,7 +19,6 @@ describe('Test Snap Error', function () { fixtures: 'imported-account', ganacheOptions, title: this.test.title, - driverOptions: { type: 'flask' }, }, async ({ driver }) => { await driver.navigate(); @@ -57,7 +56,7 @@ describe('Test Snap Error', function () { windowHandles, ); await driver.clickElement({ - text: 'Approve & Install', + text: 'Approve & install', tag: 'button', }); diff --git a/test/e2e/snaps/test-snap-managestate.spec.js b/test/e2e/snaps/test-snap-managestate.spec.js index f22e2fce1..03e481e89 100644 --- a/test/e2e/snaps/test-snap-managestate.spec.js +++ b/test/e2e/snaps/test-snap-managestate.spec.js @@ -19,9 +19,6 @@ describe('Test Snap manageState', function () { fixtures: 'imported-account', ganacheOptions, title: this.test.title, - driverOptions: { - type: 'flask', - }, }, async ({ driver }) => { await driver.navigate(); @@ -67,7 +64,7 @@ describe('Test Snap manageState', function () { windowHandles, ); await driver.clickElement({ - text: 'Approve & Install', + text: 'Approve & install', tag: 'button', }); diff --git a/test/e2e/snaps/test-snap-notification.spec.js b/test/e2e/snaps/test-snap-notification.spec.js index 85ab18267..0a303bc9c 100644 --- a/test/e2e/snaps/test-snap-notification.spec.js +++ b/test/e2e/snaps/test-snap-notification.spec.js @@ -19,9 +19,6 @@ describe('Test Snap Notification', function () { fixtures: 'imported-account', ganacheOptions, title: this.test.title, - driverOptions: { - type: 'flask', - }, }, async ({ driver }) => { await driver.navigate(); @@ -67,7 +64,7 @@ describe('Test Snap Notification', function () { windowHandles, ); await driver.clickElement({ - text: 'Approve & Install', + text: 'Approve & install', tag: 'button', }); diff --git a/test/e2e/tests/add-account.spec.js b/test/e2e/tests/add-account.spec.js index f4950199b..ca9415ac3 100644 --- a/test/e2e/tests/add-account.spec.js +++ b/test/e2e/tests/add-account.spec.js @@ -34,7 +34,7 @@ describe('Add account', function () { await driver.press('#password', driver.Key.ENTER); await driver.clickElement('.account-menu__icon'); - await driver.clickElement({ text: 'Create Account', tag: 'div' }); + await driver.clickElement({ text: 'Create account', tag: 'div' }); await driver.fill('.new-account-create-form input', '2nd account'); await driver.clickElement({ text: 'Create', tag: 'button' }); @@ -65,7 +65,7 @@ describe('Add account', function () { ); await driver.clickElement('.account-menu__icon'); - await driver.clickElement({ text: 'Create Account', tag: 'div' }); + await driver.clickElement({ text: 'Create account', tag: 'div' }); await driver.fill('.new-account-create-form input', '2nd account'); await driver.clickElement({ text: 'Create', tag: 'button' }); @@ -89,7 +89,7 @@ describe('Add account', function () { // generate a third accound await driver.clickElement('.account-menu__icon'); - await driver.clickElement({ text: 'Create Account', tag: 'div' }); + await driver.clickElement({ text: 'Create account', tag: 'div' }); await driver.fill('.new-account-create-form input', '3rd account'); await driver.clickElement({ text: 'Create', tag: 'button' }); @@ -146,7 +146,7 @@ describe('Add account', function () { // recreate a "2nd account" await driver.clickElement('.account-menu__icon'); - await driver.clickElement({ text: 'Create Account', tag: 'div' }); + await driver.clickElement({ text: 'Create account', tag: 'div' }); await driver.fill('.new-account-create-form input', '2nd account'); await driver.clickElement({ text: 'Create', tag: 'button' }); @@ -175,7 +175,7 @@ describe('Add account', function () { // re-generate a third accound await driver.clickElement('.account-menu__icon'); - await driver.clickElement({ text: 'Create Account', tag: 'div' }); + await driver.clickElement({ text: 'Create account', tag: 'div' }); await driver.fill('.new-account-create-form input', '3rd account'); await driver.clickElement({ text: 'Create', tag: 'button' }); @@ -217,7 +217,7 @@ describe('Add account', function () { await driver.delay(regularDelayMs); await driver.clickElement('.account-menu__icon'); - await driver.clickElement({ text: 'Create Account', tag: 'div' }); + await driver.clickElement({ text: 'Create account', tag: 'div' }); await driver.fill('.new-account-create-form input', '2nd account'); await driver.clickElement({ text: 'Create', tag: 'button' }); @@ -233,7 +233,7 @@ describe('Add account', function () { // import with private key await driver.clickElement('.account-menu__icon'); - await driver.clickElement({ text: 'Import Account', tag: 'div' }); + await driver.clickElement({ text: 'Import account', tag: 'div' }); // enter private key', await driver.fill('#private-key-box', testPrivateKey); diff --git a/test/e2e/tests/add-hide-token.spec.js b/test/e2e/tests/add-hide-token.spec.js index 066bd8782..8722bcfb0 100644 --- a/test/e2e/tests/add-hide-token.spec.js +++ b/test/e2e/tests/add-hide-token.spec.js @@ -72,6 +72,9 @@ describe('Add existing token using search', function () { fixtures: 'imported-account', ganacheOptions, title: this.test.title, + driverOptions: { + timeOut: 20000, + }, }, async ({ driver }) => { await driver.navigate(); @@ -80,9 +83,12 @@ describe('Add existing token using search', function () { await driver.clickElement({ text: 'import tokens', tag: 'a' }); await driver.fill('#search-tokens', 'BAT'); - await driver.clickElement({ text: 'BAT', tag: 'span' }); + await driver.clickElement({ + text: 'BAT', + tag: 'span', + }); await driver.clickElement({ text: 'Next', tag: 'button' }); - await driver.clickElement({ text: 'Import Tokens', tag: 'button' }); + await driver.clickElement({ text: 'Import tokens', tag: 'button' }); await driver.waitForSelector({ css: '.token-overview__primary-balance', diff --git a/test/e2e/tests/address-book.spec.js b/test/e2e/tests/address-book.spec.js index e4d43d347..b0121bcab 100644 --- a/test/e2e/tests/address-book.spec.js +++ b/test/e2e/tests/address-book.spec.js @@ -14,7 +14,6 @@ describe('Address Book', function () { it('Adds an entry to the address book and sends eth to that address', async function () { await withFixtures( { - dapp: true, fixtures: 'imported-account', ganacheOptions, title: this.test.title, diff --git a/test/e2e/tests/advanced-settings.spec.js b/test/e2e/tests/advanced-settings.spec.js new file mode 100644 index 000000000..b0d1eea35 --- /dev/null +++ b/test/e2e/tests/advanced-settings.spec.js @@ -0,0 +1,72 @@ +const { strict: assert } = require('assert'); +const { convertToHexValue, withFixtures } = require('../helpers'); + +describe('Advanced Settings', function () { + const ganacheOptions = { + accounts: [ + { + secretKey: + '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', + balance: convertToHexValue(25000000000000000000), + }, + ], + }; + + it('should show conversion on test network when activated', async function () { + await withFixtures( + { + dapp: true, + fixtures: 'imported-account', + ganacheOptions, + title: this.test.title, + }, + async ({ driver }) => { + await driver.navigate(); + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + await driver.clickElement('.account-menu__icon'); + await driver.clickElement({ text: 'Settings', tag: 'div' }); + await driver.clickElement({ text: 'Advanced', tag: 'div' }); + + await driver.clickElement( + '[data-testid="advanced-setting-show-testnet-conversion"] label', + ); + + await driver.clickElement( + '.settings-page__header__title-container__close-button', + ); + + const secondaryCurrency = await driver.findElement( + '[data-testid="eth-overview__secondary-currency"] .currency-display-component__suffix', + ); + assert.equal( + await secondaryCurrency.getText(), + 'USD', + `Secondary currency is not present`, + ); + }, + ); + }); + + it('should not show conversion on test network when deactivated', async function () { + await withFixtures( + { + dapp: true, + fixtures: 'imported-account', + ganacheOptions, + title: this.test.title, + }, + async ({ driver }) => { + await driver.navigate(); + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + const secondaryCurrency = await driver.isElementPresent( + '[data-testid="eth-overview__secondary-currency"]', + ); + assert.equal(secondaryCurrency, false, `Secondary currency is present`); + }, + ); + }); +}); diff --git a/test/e2e/tests/auto-lock.spec.js b/test/e2e/tests/auto-lock.spec.js index dc27466d7..7401540ac 100644 --- a/test/e2e/tests/auto-lock.spec.js +++ b/test/e2e/tests/auto-lock.spec.js @@ -45,7 +45,7 @@ describe('Auto-Lock Timer', function () { // Verify the wallet is loccked const pageTitle = await driver.findElement('.unlock-page__title'); const unlockButton = await driver.findElement('.unlock-page button'); - assert.equal(await pageTitle.getText(), 'Welcome Back!'); + assert.equal(await pageTitle.getText(), 'Welcome back!'); assert.equal(await unlockButton.isDisplayed(), true); }, ); diff --git a/test/e2e/tests/backup.spec.js b/test/e2e/tests/backup.spec.js new file mode 100644 index 000000000..99b3a43ea --- /dev/null +++ b/test/e2e/tests/backup.spec.js @@ -0,0 +1,81 @@ +const { strict: assert } = require('assert'); +const { promises: fs } = require('fs'); +const { + convertToHexValue, + withFixtures, + createDownloadFolder, +} = require('../helpers'); + +const downloadsFolder = `${process.cwd()}/test-artifacts/downloads`; + +const backupExists = async () => { + const date = new Date(); + + const prependZero = (num, maxLength) => { + return num.toString().padStart(maxLength, '0'); + }; + + const prefixZero = (num) => prependZero(num, 2); + + /* + * userData.YYYY_MM_DD_HH_mm_SS e.g userData.2022_01_13_13_45_56 + * */ + const userDataFileName = `MetaMaskUserData.${date.getFullYear()}_${prefixZero( + date.getMonth() + 1, + )}_${prefixZero(date.getDay())}_${prefixZero(date.getHours())}_${prefixZero( + date.getMinutes(), + )}_${prefixZero(date.getDay())}.json`; + + try { + const backup = `${downloadsFolder}/${userDataFileName}`; + await fs.access(backup); + return true; + } catch (e) { + return false; + } +}; + +describe('Backup', function () { + const ganacheOptions = { + accounts: [ + { + secretKey: + '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', + balance: convertToHexValue(25000000000000000000), + }, + ], + }; + it('should create backup for the account', async function () { + await withFixtures( + { + fixtures: 'imported-account', + ganacheOptions, + title: this.test.title, + failOnConsoleError: false, + }, + async ({ driver }) => { + await createDownloadFolder(downloadsFolder); + await driver.navigate(); + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + // Download user settings + await driver.clickElement('.account-menu__icon'); + await driver.clickElement({ text: 'Settings', tag: 'div' }); + await driver.clickElement({ text: 'Advanced', tag: 'div' }); + await driver.clickElement({ + text: 'Backup', + tag: 'button', + }); + + // Verify download + let fileExists; + await driver.wait(async () => { + fileExists = await backupExists(); + return fileExists === true; + }, 10000); + assert.equal(fileExists, true); + }, + ); + }); +}); diff --git a/test/e2e/tests/chain-interactions.spec.js b/test/e2e/tests/chain-interactions.spec.js index 3b7d57408..c95d3d211 100644 --- a/test/e2e/tests/chain-interactions.spec.js +++ b/test/e2e/tests/chain-interactions.spec.js @@ -39,11 +39,8 @@ describe('Chain Interactions', function () { ); // verify chain details - const [ - networkName, - networkUrl, - chainIdElement, - ] = await driver.findElements('.definition-list dd'); + const [networkName, networkUrl, chainIdElement] = + await driver.findElements('.definition-list dd'); assert.equal(await networkName.getText(), `Localhost ${port}`); assert.equal(await networkUrl.getText(), `http://127.0.0.1:${port}`); assert.equal(await chainIdElement.getText(), chainId.toString()); diff --git a/test/e2e/tests/collectibles.spec.js b/test/e2e/tests/collectibles.spec.js new file mode 100644 index 000000000..53882d0a3 --- /dev/null +++ b/test/e2e/tests/collectibles.spec.js @@ -0,0 +1,200 @@ +const { strict: assert } = require('assert'); +const { + convertToHexValue, + withFixtures, + veryLargeDelayMs, +} = require('../helpers'); +const { SMART_CONTRACTS } = require('../seeder/smart-contracts'); + +describe('Collectibles', function () { + const smartContract = SMART_CONTRACTS.COLLECTIBLES; + const ganacheOptions = { + accounts: [ + { + secretKey: + '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', + balance: convertToHexValue(25000000000000000000), + }, + ], + }; + it('should transfer a single NFT from one account to another', async function () { + await withFixtures( + { + dapp: true, + fixtures: 'connected-state', + ganacheOptions, + smartContract, + title: this.test.title, + failOnConsoleError: false, + }, + async ({ driver, _, contractRegistry }) => { + const contract = contractRegistry.getContractAddress(smartContract); + await driver.navigate(); + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + // Click transfer + await driver.openNewPage(`http://127.0.0.1:8080/?contract=${contract}`); + await driver.waitForSelector({ + css: '#collectiblesStatus', + text: 'Deployed', + }); + await driver.delay(veryLargeDelayMs); + await driver.fill('#transferTokenInput', '1'); + await driver.clickElement('#transferFromButton'); + await driver.waitUntilXWindowHandles(3); + const windowHandles = await driver.getAllWindowHandles(); + const extension = windowHandles[0]; + await driver.switchToWindowWithTitle( + 'MetaMask Notification', + windowHandles, + ); + + // Confirm transfer + await driver.waitForSelector({ + css: '.confirm-page-container-summary__title', + text: 'TestDappCollectibles', + }); + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + await driver.waitUntilXWindowHandles(2); + await driver.switchToWindow(extension); + await driver.clickElement('[data-testid="home__activity-tab"]'); + await driver.waitForSelector( + '.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)', + { timeout: 10000 }, + ); + + // Verify transaction + const completedTx = await driver.findElement('.list-item__title'); + const completedTxText = await completedTx.getText(); + assert.equal(completedTxText, 'Send Token'); + }, + ); + }); + it('should approve an address to transfer a single NFT', async function () { + await withFixtures( + { + dapp: true, + fixtures: 'connected-state', + ganacheOptions, + smartContract, + title: this.test.title, + failOnConsoleError: false, + }, + async ({ driver, _, contractRegistry }) => { + const contract = contractRegistry.getContractAddress(smartContract); + await driver.navigate(); + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + // Click approve + await driver.openNewPage(`http://127.0.0.1:8080/?contract=${contract}`); + await driver.waitForSelector({ + css: '#collectiblesStatus', + text: 'Deployed', + }); + await driver.delay(veryLargeDelayMs); + await driver.fill('#approveTokenInput', '1'); + await driver.clickElement('#approveButton'); + await driver.waitUntilXWindowHandles(3); + const windowHandles = await driver.getAllWindowHandles(); + const extension = windowHandles[0]; + await driver.switchToWindowWithTitle( + 'MetaMask Notification', + windowHandles, + ); + + // Verify dialog + const title = await driver.findElement( + '[data-testid="confirm-approve-title"]', + ); + const data = await driver.findElements( + '.confirm-approve-content__data .confirm-approve-content__small-text', + ); + assert.equal( + await title.getText(), + 'Give permission to access your TestDappCollectibles (#1)?', + ); + assert.equal(await data[0].getText(), 'Function: Approve'); + + // Confirm approval + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + await driver.waitUntilXWindowHandles(2); + await driver.switchToWindow(extension); + await driver.clickElement('[data-testid="home__activity-tab"]'); + await driver.waitForSelector( + '.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)', + { timeout: 10000 }, + ); + + // Verify transaction + const completedTx = await driver.findElement('.list-item__title'); + const completedTxText = await completedTx.getText(); + assert.equal(completedTxText, 'Approve Token spend limit'); + }, + ); + }); + it('should approve an address to transfer all NFTs', async function () { + await withFixtures( + { + dapp: true, + fixtures: 'connected-state', + ganacheOptions, + smartContract, + title: this.test.title, + failOnConsoleError: false, + }, + async ({ driver, _, contractRegistry }) => { + const contract = contractRegistry.getContractAddress(smartContract); + await driver.navigate(); + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + // Click set approval for all + await driver.openNewPage(`http://127.0.0.1:8080/?contract=${contract}`); + await driver.waitForSelector({ + css: '#collectiblesStatus', + text: 'Deployed', + }); + await driver.delay(veryLargeDelayMs); + await driver.clickElement('#setApprovalForAllButton'); + await driver.waitUntilXWindowHandles(3); + const windowHandles = await driver.getAllWindowHandles(); + const extension = windowHandles[0]; + await driver.switchToWindowWithTitle( + 'MetaMask Notification', + windowHandles, + ); + + // Verify dialog + const title = await driver.findElement( + '[data-testid="confirm-approve-title"]', + ); + const data = await driver.findElements( + '.confirm-approve-content__data .confirm-approve-content__small-text', + ); + assert.equal( + await title.getText(), + 'Give permission to access all of your TestDappCollectibles?', + ); + assert.equal(await data[0].getText(), 'Function: SetApprovalForAll'); + assert.equal(await data[1].getText(), 'Parameters: true'); + + // Confirmation set approval for all + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + await driver.waitUntilXWindowHandles(2); + await driver.switchToWindow(extension); + await driver.clickElement('[data-testid="home__activity-tab"]'); + await driver.waitForSelector( + '.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)', + { timeout: 10000 }, + ); + + // Verify transaction + const completedTx = await driver.findElement('.list-item__title'); + const completedTxText = await completedTx.getText(); + assert.equal(completedTxText, 'Approve Token with no spend limit'); + }, + ); + }); +}); diff --git a/test/e2e/tests/contract-interactions.spec.js b/test/e2e/tests/contract-interactions.spec.js index ad0ce7fd6..d50ac6cb9 100644 --- a/test/e2e/tests/contract-interactions.spec.js +++ b/test/e2e/tests/contract-interactions.spec.js @@ -1,5 +1,6 @@ const { strict: assert } = require('assert'); const { convertToHexValue, withFixtures } = require('../helpers'); +const { SMART_CONTRACTS } = require('../seeder/smart-contracts'); describe('Deploy contract and call contract methods', function () { const ganacheOptions = { @@ -11,22 +12,32 @@ describe('Deploy contract and call contract methods', function () { }, ], }; + const smartContract = SMART_CONTRACTS.PIGGYBANK; it('should display the correct account balance after contract interactions', async function () { await withFixtures( { dapp: true, fixtures: 'connected-state', ganacheOptions, + smartContract, title: this.test.title, }, - async ({ driver }) => { + async ({ driver, contractRegistry }) => { + const contractAddress = await contractRegistry.getContractAddress( + smartContract, + ); await driver.navigate(); await driver.fill('#password', 'correct horse battery staple'); await driver.press('#password', driver.Key.ENTER); // deploy contract - await driver.openNewPage('http://127.0.0.1:8080/'); - await driver.clickElement('#deployButton'); + await driver.openNewPage( + `http://127.0.0.1:8080/?contract=${contractAddress}`, + ); + + // wait for deployed contract, calls and confirms a contract method where ETH is sent + await driver.findClickableElement('#deployButton'); + await driver.clickElement('#depositButton'); await driver.waitUntilXWindowHandles(3); let windowHandles = await driver.getAllWindowHandles(); const extension = windowHandles[0]; @@ -34,41 +45,7 @@ describe('Deploy contract and call contract methods', function () { 'E2E Test Dapp', windowHandles, ); - // displays the contract creation data - await driver.switchToWindowWithTitle( - 'MetaMask Notification', - windowHandles, - ); - await driver.clickElement({ text: 'Data', tag: 'button' }); - await driver.findElement({ text: '127.0.0.1', tag: 'div' }); - const confirmDataDiv = await driver.findElement( - '.confirm-page-container-content__data-box', - ); - const confirmDataText = await confirmDataDiv.getText(); - assert.ok(confirmDataText.includes('Origin:')); - assert.ok(confirmDataText.includes('127.0.0.1')); - assert.ok(confirmDataText.includes('Bytes:')); - assert.ok(confirmDataText.includes('675')); - - // confirms a deploy contract transaction - await driver.clickElement({ text: 'Details', tag: 'button' }); - await driver.clickElement({ text: 'Confirm', tag: 'button' }); - await driver.waitUntilXWindowHandles(2); - await driver.switchToWindow(extension); - await driver.clickElement('[data-testid="home__activity-tab"]'); - await driver.waitForSelector( - '.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)', - { timeout: 10000 }, - ); - const completedTx = await driver.findElement('.list-item__title'); - const completedTxText = await completedTx.getText(); - assert.equal(completedTxText, 'Contract Deployment'); - // calls and confirms a contract method where ETH is sent - await driver.switchToWindow(dapp); - await driver.clickElement('#depositButton'); - await driver.waitUntilXWindowHandles(3); - windowHandles = await driver.getAllWindowHandles(); await driver.switchToWindowWithTitle( 'MetaMask Notification', windowHandles, @@ -80,8 +57,9 @@ describe('Deploy contract and call contract methods', function () { await driver.clickElement({ text: 'Confirm', tag: 'button' }); await driver.waitUntilXWindowHandles(2); await driver.switchToWindow(extension); + await driver.clickElement({ text: 'Activity', tag: 'button' }); await driver.waitForSelector( - '.transaction-list__completed-transactions .transaction-list-item:nth-of-type(2)', + '.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)', { timeout: 10000 }, ); await driver.waitForSelector( @@ -109,7 +87,7 @@ describe('Deploy contract and call contract methods', function () { await driver.waitUntilXWindowHandles(2); await driver.switchToWindow(extension); await driver.waitForSelector( - '.transaction-list__completed-transactions .transaction-list-item:nth-of-type(3)', + '.transaction-list__completed-transactions .transaction-list-item:nth-of-type(2)', { timeout: 10000 }, ); await driver.waitForSelector( diff --git a/test/e2e/tests/custom-rpc-history.spec.js b/test/e2e/tests/custom-rpc-history.spec.js index dad19482c..9907090d7 100644 --- a/test/e2e/tests/custom-rpc-history.spec.js +++ b/test/e2e/tests/custom-rpc-history.spec.js @@ -33,7 +33,7 @@ describe('Stores custom RPC history', function () { await driver.clickElement('.network-display'); - await driver.clickElement({ text: 'Add Network', tag: 'button' }); + await driver.clickElement({ text: 'Add network', tag: 'button' }); await driver.findElement('.networks-tab__sub-header-text'); @@ -83,7 +83,7 @@ describe('Stores custom RPC history', function () { await driver.clickElement('.network-display'); - await driver.clickElement({ text: 'Add Network', tag: 'button' }); + await driver.clickElement({ text: 'Add network', tag: 'button' }); await driver.findElement('.networks-tab__sub-header-text'); @@ -121,7 +121,7 @@ describe('Stores custom RPC history', function () { await driver.clickElement('.network-display'); - await driver.clickElement({ text: 'Add Network', tag: 'button' }); + await driver.clickElement({ text: 'Add network', tag: 'button' }); await driver.findElement('.networks-tab__sub-header-text'); @@ -132,8 +132,7 @@ describe('Stores custom RPC history', function () { await chainIdInput.clear(); await chainIdInput.sendKeys(duplicateChainId); await driver.findElement({ - text: - 'This Chain ID is currently used by the Localhost 8545 network.', + text: 'This Chain ID is currently used by the Localhost 8545 network.', tag: 'h6', }); @@ -214,7 +213,7 @@ describe('Stores custom RPC history', function () { await driver.delay(largeDelayMs); await driver.clickElement('.network-display'); - await driver.clickElement({ text: 'Add Network', tag: 'button' }); + await driver.clickElement({ text: 'Add network', tag: 'button' }); await driver.findVisibleElement('.settings-page__content'); // // cancel new custom rpc diff --git a/test/e2e/tests/custom-token-add-approve.spec.js b/test/e2e/tests/custom-token-add-approve.spec.js new file mode 100644 index 000000000..7b68e093e --- /dev/null +++ b/test/e2e/tests/custom-token-add-approve.spec.js @@ -0,0 +1,353 @@ +/* eslint-disable mocha/no-skipped-tests */ +const { strict: assert } = require('assert'); + +const { + convertToHexValue, + withFixtures, + getWindowHandles, +} = require('../helpers'); + +describe.skip('Create token, approve token and approve token without gas', function () { + describe('Add a custom token from a dapp', function () { + const ganacheOptions = { + accounts: [ + { + secretKey: + '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', + balance: convertToHexValue(25000000000000000000), + }, + ], + }; + + it('creates, imports and renders the balance for the new token', async function () { + await withFixtures( + { + dapp: true, + fixtures: 'connected-state', + ganacheOptions, + title: this.test.title, + }, + async ({ driver }) => { + await driver.navigate(); + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + // create token + await driver.openNewPage(`http://127.0.0.1:8080/`); + await driver.waitForSelector({ text: 'Create Token', tag: 'button' }); + await driver.clickElement({ text: 'Create Token', tag: 'button' }); + + const windowHandles = await getWindowHandles(driver, 3); + await driver.switchToWindow(windowHandles.popup); + await driver.clickElement({ text: 'Edit', tag: 'button' }); + const inputs = await driver.findElements('input[type="number"]'); + const gasLimitInput = inputs[0]; + const gasPriceInput = inputs[1]; + await gasLimitInput.fill('4700000'); + await gasPriceInput.fill('20'); + await driver.waitForSelector({ text: 'Save', tag: 'button' }); + await driver.clickElement({ text: 'Save', tag: 'button' }); + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + + await driver.switchToWindow(windowHandles.dapp); + + const tokenContractAddress = await driver.waitForSelector({ + css: '#tokenAddress', + text: '0x', + }); + const tokenAddress = await tokenContractAddress.getText(); + + // imports custom token from extension + await driver.switchToWindow(windowHandles.extension); + await driver.clickElement(`[data-testid="home__asset-tab"]`); + await driver.clickElement({ tag: 'button', text: 'Assets' }); + + await driver.clickElement({ text: 'import tokens', tag: 'a' }); + await driver.clickElement({ + text: 'Custom token', + tag: 'button', + }); + await driver.waitForSelector('#custom-address'); + await driver.fill('#custom-address', tokenAddress); + await driver.waitForSelector('#custom-symbol'); + await driver.waitForSelector('#custom-decimals'); + await driver.delay(2000); + + await driver.clickElement({ + text: 'Add custom token', + tag: 'button', + }); + + await driver.delay(2000); + await driver.clickElement({ + text: 'Import tokens', + tag: 'button', + }); + + // renders balance for newly created token + await driver.waitForSelector('.app-header__logo-container'); + await driver.clickElement('.app-header__logo-container'); + await driver.clickElement({ tag: 'button', text: 'Assets' }); + const asset = await driver.waitForSelector({ + css: '.asset-list-item__token-value', + text: '10', + }); + assert.equal(await asset.getText(), '10'); + }, + ); + }); + }); + + describe('Approves a custom token from dapp', function () { + let windowHandles; + + const ganacheOptions = { + accounts: [ + { + secretKey: + '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', + balance: convertToHexValue(25000000000000000000), + }, + ], + }; + it('approves an already created token and displays the token approval data', async function () { + await withFixtures( + { + dapp: true, + fixtures: 'connected-state', + ganacheOptions, + title: this.test.title, + }, + async ({ driver }) => { + await driver.navigate(); + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + await driver.openNewPage(`http://127.0.0.1:8080/`); + + await driver.waitForSelector({ text: 'Create Token', tag: 'button' }); + await driver.clickElement({ text: 'Create Token', tag: 'button' }); + windowHandles = await getWindowHandles(driver, 3); + await driver.switchToWindow(windowHandles.popup); + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + await driver.switchToWindow(windowHandles.dapp); + await driver.waitForSelector({ + text: 'Approve Tokens', + tag: 'button', + }); + await driver.clickElement({ text: 'Approve Tokens', tag: 'button' }); + + // displays the token approval data + // switch to popup + windowHandles = await getWindowHandles(driver, 3); + await driver.switchToWindow(windowHandles.popup); + + const functionType = await driver.findElement( + '.confirm-approve-content__data .confirm-approve-content__small-text', + ); + + await driver.scrollToElement(functionType); + const functionTypeText = await functionType.getText(); + assert.equal(functionTypeText, 'Function: Approve'); + const confirmDataDiv = await driver.findElement( + '.confirm-approve-content__data__data-block', + ); + const confirmDataText = await confirmDataDiv.getText(); + assert( + confirmDataText.match( + /0x095ea7b30000000000000000000000009bc5baf874d2da8d216ae9f137804184ee5afef4/u, + ), + ); + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + await driver.switchToWindow(windowHandles.extension); + await driver.clickElement({ tag: 'button', text: 'Activity' }); + + await driver.wait(async () => { + const pendingTxes = await driver.findElements( + '.transaction-list-item', + ); + return pendingTxes.length === 2; + }, 10000); + + await driver.waitForSelector({ + // Selects only the very first transaction list item immediately following the 'Pending' header + css: '.transaction-list__pending-transactions .transaction-list__header + .transaction-list-item .list-item__heading', + text: 'Approve Token spend limit', + }); + }, + ); + }); + + it('customizes gas, edit permissions and checks transaction in transaction list', async function () { + await withFixtures( + { + dapp: true, + fixtures: 'connected-state', + ganacheOptions, + title: this.test.title, + }, + async ({ driver }) => { + await driver.navigate(); + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + await driver.openNewPage(`http://127.0.0.1:8080/`); + + await driver.waitForSelector({ text: 'Create Token', tag: 'button' }); + await driver.clickElement({ text: 'Create Token', tag: 'button' }); + windowHandles = await getWindowHandles(driver, 3); + await driver.switchToWindow(windowHandles.popup); + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + + await driver.switchToWindow(windowHandles.dapp); + + await driver.waitForSelector({ + text: 'Approve Tokens', + tag: 'button', + }); + await driver.clickElement({ text: 'Approve Tokens', tag: 'button' }); + + // switch to popup + windowHandles = await getWindowHandles(driver, 3); + await driver.switchToWindow(windowHandles.popup); + + await driver.clickElement( + '.confirm-approve-content__small-blue-text', + ); + await driver.clickElement( + { text: 'Edit suggested gas fee', tag: 'button' }, + 10000, + ); + const [gasLimitInput, gasPriceInput] = await driver.findElements( + 'input[type="number"]', + ); + await gasPriceInput.clear(); + await gasPriceInput.fill('10'); + await gasLimitInput.clear(); + await gasLimitInput.fill('60001'); + await driver.findClickableElement({ text: 'Save', tag: 'button' }); + await driver.clickElement({ text: 'Save', tag: 'button' }); + + await driver.waitForSelector({ + css: '.confirm-approve-content__transaction-details-content__secondary-fee', + text: '0.0006 ETH', + }); + + // edits the permission + const editButtons = await driver.findClickableElements( + '.confirm-approve-content__small-blue-text', + ); + await editButtons[2].click(); + + // wait for permission modal to be visible + const permissionModal = await driver.findVisibleElement( + 'span .modal', + ); + const radioButtons = await driver.findClickableElements( + '.edit-approval-permission__edit-section__radio-button', + ); + const customSpendLimit = await radioButtons[1]; + await customSpendLimit.click(); + await driver.fill('input', '5'); + await driver.clickElement({ text: 'Save', tag: 'button' }); + + // wait for permission modal to be removed from DOM. + await permissionModal.waitForElementState('hidden'); + const permissionInfo = await driver.findElements( + '.confirm-approve-content__medium-text', + ); + const amountDiv = permissionInfo[0]; + assert.equal(await amountDiv.getText(), '5 TST'); + + // submits the transaction + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + + // finds the transaction in transaction list + await driver.switchToWindow(windowHandles.extension); + await driver.clickElement({ tag: 'button', text: 'Activity' }); + await driver.waitForSelector({ + // Select only the heading of the first entry in the transaction list. + css: '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading', + text: 'Approve Token spend limit', + }); + }, + ); + }); + }); + + describe('Approves a custom token from dapp when no gas value is specified', function () { + let windowHandles; + + const ganacheOptions = { + accounts: [ + { + secretKey: + '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', + balance: convertToHexValue(25000000000000000000), + }, + ], + }; + + it('approves an already created token, shows the correct recipient, submits the transaction and finds the transaction in the transactions list', async function () { + await withFixtures( + { + dapp: true, + fixtures: 'connected-state', + ganacheOptions, + title: this.test.title, + }, + async ({ driver }) => { + await driver.navigate(); + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + await driver.openNewPage(`http://127.0.0.1:8080/`); + + await driver.waitForSelector({ text: 'Create Token', tag: 'button' }); + await driver.clickElement({ text: 'Create Token', tag: 'button' }); + windowHandles = await getWindowHandles(driver, 3); + await driver.switchToWindow(windowHandles.popup); + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + + await driver.switchToWindow(windowHandles.dapp); + + await driver.clickElement({ + text: 'Approve Tokens Without Gas', + tag: 'button', + }); + + await driver.switchToWindow(windowHandles.extension); + await driver.clickElement({ tag: 'button', text: 'Activity' }); + + await driver.wait(async () => { + const pendingTxes = await driver.findElements( + '.transaction-list__pending-transactions .transaction-list-item', + ); + return pendingTxes.length === 1; + }, 10000); + + await driver.waitForSelector({ + // Selects only the very first transaction list item immediately following the 'Pending' header + css: '.transaction-list__pending-transactions .transaction-list__header + .transaction-list-item .list-item__heading', + text: 'Approve Token spend limit', + }); + + await driver.clickElement('.transaction-list-item'); + + const permissionInfo = await driver.findElements( + '.confirm-approve-content__medium-text', + ); + const recipientDiv = permissionInfo[1]; + assert.equal(await recipientDiv.getText(), '0x2f318C33...C970'); + + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + + await driver.waitForSelector({ + css: '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading', + text: 'Approve Token spend limit', + }); + }, + ); + }); + }); +}); diff --git a/test/e2e/tests/eth-sign.spec.js b/test/e2e/tests/eth-sign.spec.js index c0502f93e..cf685726a 100644 --- a/test/e2e/tests/eth-sign.spec.js +++ b/test/e2e/tests/eth-sign.spec.js @@ -42,7 +42,7 @@ describe('Eth sign', function () { '.request-signature__header__text', ); const origin = await driver.findElement('.request-signature__origin'); - assert.equal(await title.getText(), 'Signature Request'); + assert.equal(await title.getText(), 'Signature request'); assert.equal(await origin.getText(), 'http://127.0.0.1:8080'); const personalMessageRow = await driver.findElement( diff --git a/test/e2e/tests/failing-contract.spec.js b/test/e2e/tests/failing-contract.spec.js index 50944c165..bdeb6373b 100644 --- a/test/e2e/tests/failing-contract.spec.js +++ b/test/e2e/tests/failing-contract.spec.js @@ -1,7 +1,9 @@ const { strict: assert } = require('assert'); const { convertToHexValue, withFixtures } = require('../helpers'); +const { SMART_CONTRACTS } = require('../seeder/smart-contracts'); describe('Failing contract interaction ', function () { + const smartContract = SMART_CONTRACTS.FAILING; const ganacheOptions = { hardfork: 'london', accounts: [ @@ -18,41 +20,25 @@ describe('Failing contract interaction ', function () { dapp: true, fixtures: 'connected-state', ganacheOptions, + smartContract, title: this.test.title, }, - async ({ driver }) => { + async ({ driver, contractRegistry }) => { + const contractAddress = await contractRegistry.getContractAddress( + smartContract, + ); await driver.navigate(); await driver.fill('#password', 'correct horse battery staple'); await driver.press('#password', driver.Key.ENTER); - // deploy contract - await driver.openNewPage('http://127.0.0.1:8080/'); - await driver.clickElement('#deployFailingButton'); - await driver.waitUntilXWindowHandles(3); + await driver.openNewPage( + `http://127.0.0.1:8080/?contract=${contractAddress}`, + ); let windowHandles = await driver.getAllWindowHandles(); const extension = windowHandles[0]; - const dapp = await driver.switchToWindowWithTitle( - 'E2E Test Dapp', - windowHandles, - ); - await driver.switchToWindowWithTitle( - 'MetaMask Notification', - windowHandles, - ); - await driver.clickElement({ text: 'Confirm', tag: 'button' }); - await driver.waitUntilXWindowHandles(2); - await driver.switchToWindow(extension); - await driver.clickElement('[data-testid="home__activity-tab"]'); - await driver.waitForSelector( - '.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)', - { timeout: 10000 }, - ); - const completedTx = await driver.findElement('.list-item__title'); - const completedTxText = await completedTx.getText(); - assert.equal(completedTxText, 'Contract Deployment'); - // calls failing contract method - await driver.switchToWindow(dapp); + // waits for deployed contract and calls failing contract method + await driver.findClickableElement('#deployButton'); await driver.clickElement('#sendFailingButton'); await driver.waitUntilXWindowHandles(3); windowHandles = await driver.getAllWindowHandles(); @@ -81,8 +67,9 @@ describe('Failing contract interaction ', function () { await driver.clickElement({ text: 'Confirm', tag: 'button' }); await driver.waitUntilXWindowHandles(2); await driver.switchToWindow(extension); + await driver.clickElement({ text: 'Activity', tag: 'button' }); await driver.waitForSelector( - '.transaction-list__completed-transactions .transaction-list-item:nth-of-type(2)', + '.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)', { timeout: 10000 }, ); diff --git a/test/e2e/tests/from-import-ui.spec.js b/test/e2e/tests/from-import-ui.spec.js index 41c63ccb1..74298956c 100644 --- a/test/e2e/tests/from-import-ui.spec.js +++ b/test/e2e/tests/from-import-ui.spec.js @@ -77,9 +77,9 @@ describe('MetaMask Import UI', function () { await driver.clickElement('.network-display'); await driver.clickElement({ text: 'Localhost', tag: 'span' }); - // choose Create Account from the account menu + // choose Create account from the account menu await driver.clickElement('.account-menu__icon'); - await driver.clickElement({ text: 'Create Account', tag: 'div' }); + await driver.clickElement({ text: 'Create account', tag: 'div' }); // set account name await driver.fill('.new-account-create-form input', '2nd account'); @@ -202,9 +202,9 @@ describe('MetaMask Import UI', function () { await driver.press('#password', driver.Key.ENTER); // Imports an account with private key - // choose Create Account from the account menu + // choose Create account from the account menu await driver.clickElement('.account-menu__icon'); - await driver.clickElement({ text: 'Import Account', tag: 'div' }); + await driver.clickElement({ text: 'Import account', tag: 'div' }); // enter private key', await driver.fill('#private-key-box', testPrivateKey1); @@ -231,8 +231,8 @@ describe('MetaMask Import UI', function () { assert.equal(await importedLabel.getText(), 'IMPORTED'); // Imports and removes an account - // choose Create Account from the account menu - await driver.clickElement({ text: 'Import Account', tag: 'div' }); + // choose Create account from the account menu + await driver.clickElement({ text: 'Import account', tag: 'div' }); // enter private key await driver.fill('#private-key-box', testPrivateKey2); await driver.clickElement({ text: 'Import', tag: 'button' }); @@ -306,7 +306,7 @@ describe('MetaMask Import UI', function () { // Imports an account with JSON file await driver.clickElement('.account-menu__icon'); - await driver.clickElement({ text: 'Import Account', tag: 'div' }); + await driver.clickElement({ text: 'Import account', tag: 'div' }); await driver.clickElement('.new-account-import-form__select'); await driver.clickElement({ text: 'JSON File', tag: 'option' }); @@ -379,7 +379,7 @@ describe('MetaMask Import UI', function () { // choose Import Account from the account menu await driver.clickElement('.account-menu__icon'); - await driver.clickElement({ text: 'Import Account', tag: 'div' }); + await driver.clickElement({ text: 'Import account', tag: 'div' }); // enter private key', await driver.fill('#private-key-box', testPrivateKey); @@ -416,10 +416,10 @@ describe('MetaMask Import UI', function () { await driver.fill('#password', 'correct horse battery staple'); await driver.press('#password', driver.Key.ENTER); - // choose Connect Hardware Wallet from the account menu + // choose Connect hardware wallet from the account menu await driver.clickElement('.account-menu__icon'); await driver.clickElement({ - text: 'Connect Hardware Wallet', + text: 'Connect hardware wallet', tag: 'div', }); await driver.delay(regularDelayMs); diff --git a/test/e2e/tests/incremental-security.spec.js b/test/e2e/tests/incremental-security.spec.js index a12f49831..d7ba9e0b7 100644 --- a/test/e2e/tests/incremental-security.spec.js +++ b/test/e2e/tests/incremental-security.spec.js @@ -42,7 +42,7 @@ describe('Incremental Security', function () { await driver.clickElement('.btn-secondary'); // clicks the "Create New Wallet" option - await driver.clickElement({ text: 'Create a Wallet', tag: 'button' }); + await driver.clickElement({ text: 'Create a wallet', tag: 'button' }); // accepts a secure password await driver.fill( @@ -156,7 +156,7 @@ describe('Incremental Security', function () { await driver.clickElement({ text: 'Confirm', tag: 'button' }); // can click through the success screen - await driver.clickElement({ text: 'All Done', tag: 'button' }); + await driver.clickElement({ text: 'All done', tag: 'button' }); // should have the correct amount of eth currencyDisplay = await driver.waitForSelector({ diff --git a/test/e2e/tests/metamask-responsive-ui.spec.js b/test/e2e/tests/metamask-responsive-ui.spec.js index 3b796834e..d0f6906db 100644 --- a/test/e2e/tests/metamask-responsive-ui.spec.js +++ b/test/e2e/tests/metamask-responsive-ui.spec.js @@ -87,11 +87,11 @@ describe('MetaMask Responsive UI', function () { }); await driver.delay(tinyDelayMs); - // clicks the "I Agree" option on the metametrics opt-in screen + // clicks the "I agree" option on the metametrics opt-in screen await driver.clickElement('.btn-primary'); // clicks the "Create New Wallet" option - await driver.clickElement({ text: 'Create a Wallet', tag: 'button' }); + await driver.clickElement({ text: 'Create a wallet', tag: 'button' }); // accepts a secure password await driver.fill( diff --git a/test/e2e/tests/navigate-transactions.spec.js b/test/e2e/tests/navigate-transactions.spec.js index 4d02097f5..3e1eca68a 100644 --- a/test/e2e/tests/navigate-transactions.spec.js +++ b/test/e2e/tests/navigate-transactions.spec.js @@ -14,7 +14,6 @@ describe('Navigate transactions', function () { it('should navigate the unapproved transactions', async function () { await withFixtures( { - dapp: true, fixtures: 'navigate-transactions', ganacheOptions, title: this.test.title, @@ -150,7 +149,6 @@ describe('Navigate transactions', function () { it('should reject and remove an unapproved transaction', async function () { await withFixtures( { - dapp: true, fixtures: 'navigate-transactions', ganacheOptions, title: this.test.title, @@ -182,7 +180,6 @@ describe('Navigate transactions', function () { it('should confirm and remove an unapproved transaction', async function () { await withFixtures( { - dapp: true, fixtures: 'navigate-transactions', ganacheOptions, title: this.test.title, @@ -214,7 +211,6 @@ describe('Navigate transactions', function () { it('should reject and remove all unapproved transactions', async function () { await withFixtures( { - dapp: true, fixtures: 'navigate-transactions', ganacheOptions, title: this.test.title, @@ -226,7 +222,7 @@ describe('Navigate transactions', function () { // reject transactions await driver.clickElement({ text: 'Reject 4', tag: 'a' }); - await driver.clickElement({ text: 'Reject All', tag: 'button' }); + await driver.clickElement({ text: 'Reject all', tag: 'button' }); const balance = await driver.findElement( '[data-testid="eth-overview__primary-currency"]', ); diff --git a/test/e2e/tests/phishing-detection.spec.js b/test/e2e/tests/phishing-detection.spec.js index d6ed9375a..ccad1dd4a 100644 --- a/test/e2e/tests/phishing-detection.spec.js +++ b/test/e2e/tests/phishing-detection.spec.js @@ -1,6 +1,9 @@ const { strict: assert } = require('assert'); const { convertToHexValue, withFixtures } = require('../helpers'); +const PHISHFORT_CDN_URL = + 'https://cdn.jsdelivr.net/gh/phishfort/phishfort-lists@master/blacklists/hotlist.json'; + describe('Phishing Detection', function () { async function mockPhishingDetection(mockServer) { await mockServer @@ -20,6 +23,14 @@ describe('Phishing Detection', function () { }; }); } + async function mockPhishfortPhishingDetection(mockServer) { + await mockServer.forGet(PHISHFORT_CDN_URL).thenCallback(() => { + return { + statusCode: 200, + json: ['127.0.0.1'], + }; + }); + } const ganacheOptions = { accounts: [ { @@ -127,4 +138,27 @@ describe('Phishing Detection', function () { }, ); }); + + it('should display the MetaMask Phishing Detection page with the correct new issue link if the issue was detected from the phishfort list', async function () { + await withFixtures( + { + fixtures: 'imported-account', + ganacheOptions, + title: this.test.title, + testSpecificMock: mockPhishfortPhishingDetection, + dapp: true, + failOnConsoleError: false, + }, + async ({ driver }) => { + await driver.navigate(); + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + await driver.openNewPage('http://127.0.0.1:8080'); + const newIssueLink = await driver.findElements( + "a[href='https://github.com/phishfort/phishfort-lists/issues/new?title=[Legitimate%20Site%20Blocked]%20127.0.0.1&body=http%3A%2F%2F127.0.0.1%3A8080%2F']", + ); + assert.equal(newIssueLink.length, 1); + }, + ); + }); }); diff --git a/test/e2e/tests/send-hex-address.spec.js b/test/e2e/tests/send-hex-address.spec.js index ed89901db..af815c238 100644 --- a/test/e2e/tests/send-hex-address.spec.js +++ b/test/e2e/tests/send-hex-address.spec.js @@ -174,7 +174,7 @@ describe('Send ERC20 to a 40 character hexadecimal address', function () { 'MetaMask Notification', windowHandles, ); - await driver.clickElement({ text: 'Add Token', tag: 'button' }); + await driver.clickElement({ text: 'Add token', tag: 'button' }); await driver.waitUntilXWindowHandles(2); await driver.switchToWindow(extension); @@ -273,7 +273,7 @@ describe('Send ERC20 to a 40 character hexadecimal address', function () { 'MetaMask Notification', windowHandles, ); - await driver.clickElement({ text: 'Add Token', tag: 'button' }); + await driver.clickElement({ text: 'Add token', tag: 'button' }); await driver.waitUntilXWindowHandles(2); await driver.switchToWindow(extension); diff --git a/test/e2e/tests/send-to-contract.spec.js b/test/e2e/tests/send-to-contract.spec.js new file mode 100644 index 000000000..1cdb47e43 --- /dev/null +++ b/test/e2e/tests/send-to-contract.spec.js @@ -0,0 +1,73 @@ +const { strict: assert } = require('assert'); +const { convertToHexValue, withFixtures } = require('../helpers'); +const { SMART_CONTRACTS } = require('../seeder/smart-contracts'); + +describe('Send ERC20 token to contract address', function () { + const smartContract = SMART_CONTRACTS.HST; + const ganacheOptions = { + accounts: [ + { + secretKey: + '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', + balance: convertToHexValue(25000000000000000000), + }, + ], + }; + it('should display the token contract warning to the user', async function () { + await withFixtures( + { + dapp: true, + fixtures: 'connected-state', + ganacheOptions, + smartContract, + title: this.test.title, + failOnConsoleError: false, + }, + async ({ driver, contractRegistry }) => { + const contractAddress = await contractRegistry.getContractAddress( + smartContract, + ); + await driver.navigate(); + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + // Create TST + await driver.openNewPage( + `http://127.0.0.1:8080/?contract=${contractAddress}`, + ); + let windowHandles = await driver.getAllWindowHandles(); + const extension = windowHandles[0]; + + // Add token + await driver.findClickableElement('#deployButton'); + await driver.clickElement('#watchAsset'); + await driver.waitUntilXWindowHandles(3); + windowHandles = await driver.getAllWindowHandles(); + await driver.switchToWindowWithTitle( + 'MetaMask Notification', + windowHandles, + ); + await driver.clickElement({ text: 'Add token', tag: 'button' }); + await driver.waitUntilXWindowHandles(2); + await driver.switchToWindow(extension); + + // Send TST + await driver.clickElement('[data-testid="home__asset-tab"]'); + await driver.clickElement('.token-cell'); + await driver.clickElement('[data-testid="eth-overview-send"]'); + + // Type contract address + await driver.fill( + 'input[placeholder="Search, public address (0x), or ENS"]', + contractAddress, + ); + + // Verify warning + const warningText = + 'Warning: you are about to send to a token contract which could result in a loss of funds. Learn more\nI understand'; + const warning = await driver.findElement('.send__warning-container'); + assert.equal(await warning.getText(), warningText); + }, + ); + }); +}); diff --git a/test/e2e/tests/settings-search.spec.js b/test/e2e/tests/settings-search.spec.js index d817acb1c..69ac23ec0 100644 --- a/test/e2e/tests/settings-search.spec.js +++ b/test/e2e/tests/settings-search.spec.js @@ -12,20 +12,19 @@ describe('Settings Search', function () { ], }; const settingsSearch = { - general: 'Primary Currency', - advanced: 'State Logs', + general: 'Primary currency', + advanced: 'State logs', contacts: 'Contacts', security: 'Reveal Secret', alerts: 'Browsing a website', networks: 'Ethereum Mainnet', - experimental: 'Token Detection', + experimental: 'Enable Enhanced Gas Fee UI', about: 'Terms of Use', }; it('should find element inside the General tab', async function () { await withFixtures( { - dapp: true, fixtures: 'imported-account', ganacheOptions, title: this.test.title, @@ -52,7 +51,6 @@ describe('Settings Search', function () { it('should find element inside the Advanced tab', async function () { await withFixtures( { - dapp: true, fixtures: 'imported-account', ganacheOptions, title: this.test.title, @@ -80,7 +78,6 @@ describe('Settings Search', function () { it('should find element inside the Contacts tab', async function () { await withFixtures( { - dapp: true, fixtures: 'imported-account', ganacheOptions, title: this.test.title, @@ -108,7 +105,6 @@ describe('Settings Search', function () { it('should find element inside the Security tab', async function () { await withFixtures( { - dapp: true, fixtures: 'imported-account', ganacheOptions, title: this.test.title, @@ -136,7 +132,6 @@ describe('Settings Search', function () { it('should find element inside the Alerts tab', async function () { await withFixtures( { - dapp: true, fixtures: 'imported-account', ganacheOptions, title: this.test.title, @@ -164,7 +159,6 @@ describe('Settings Search', function () { it('should find element inside the Networks tab', async function () { await withFixtures( { - dapp: true, fixtures: 'imported-account', ganacheOptions, title: this.test.title, @@ -192,7 +186,6 @@ describe('Settings Search', function () { it('should find element inside the Experimental tab', async function () { await withFixtures( { - dapp: true, fixtures: 'imported-account', ganacheOptions, title: this.test.title, @@ -220,7 +213,6 @@ describe('Settings Search', function () { it('should find element inside the About tab', async function () { await withFixtures( { - dapp: true, fixtures: 'imported-account', ganacheOptions, title: this.test.title, @@ -248,7 +240,6 @@ describe('Settings Search', function () { it('should display "Element not found" for a non-existing element', async function () { await withFixtures( { - dapp: true, fixtures: 'imported-account', ganacheOptions, title: this.test.title, diff --git a/test/e2e/tests/signature-request.spec.js b/test/e2e/tests/signature-request.spec.js index 7cb53e233..1de8409a1 100644 --- a/test/e2e/tests/signature-request.spec.js +++ b/test/e2e/tests/signature-request.spec.js @@ -55,7 +55,7 @@ describe('Sign Typed Data V4 Signature Request', function () { const message = await driver.findElement( '.signature-request-message--node-value', ); - assert.equal(await title.getText(), 'Signature Request'); + assert.equal(await title.getText(), 'Signature request'); assert.equal(await name.getText(), 'Ether Mail'); assert.equal(await origin.getText(), 'http://127.0.0.1:8080'); assert.equal( @@ -137,7 +137,7 @@ describe('Sign Typed Data V3 Signature Request', function () { const messages = await driver.findElements( '.signature-request-message--node-value', ); - assert.equal(await title.getText(), 'Signature Request'); + assert.equal(await title.getText(), 'Signature request'); assert.equal(await name.getText(), 'Ether Mail'); assert.equal(await origin.getText(), 'http://127.0.0.1:8080'); assert.equal( @@ -208,7 +208,7 @@ describe('Sign Typed Data Signature Request', function () { const message = await driver.findElements( '.request-signature__row-value', ); - assert.equal(await title.getText(), 'Signature Request'); + assert.equal(await title.getText(), 'Signature request'); assert.equal(await origin.getText(), 'http://127.0.0.1:8080'); assert.equal(await message[0].getText(), 'Hi, Alice!'); assert.equal(await message[1].getText(), '1337'); diff --git a/test/e2e/tests/state-logs.spec.js b/test/e2e/tests/state-logs.spec.js index 6152ff01a..ae42abfc1 100644 --- a/test/e2e/tests/state-logs.spec.js +++ b/test/e2e/tests/state-logs.spec.js @@ -1,17 +1,16 @@ const { strict: assert } = require('assert'); const { promises: fs } = require('fs'); -const { convertToHexValue, withFixtures } = require('../helpers'); +const { + convertToHexValue, + withFixtures, + createDownloadFolder, +} = require('../helpers'); const downloadsFolder = `${process.cwd()}/test-artifacts/downloads`; -const createDownloadFolder = async () => { - await fs.rm(downloadsFolder, { recursive: true, force: true }); - await fs.mkdir(downloadsFolder, { recursive: true }); -}; - const stateLogsExist = async () => { try { - const stateLogs = `${downloadsFolder}/MetaMask State Logs.json`; + const stateLogs = `${downloadsFolder}/MetaMask state logs.json`; await fs.access(stateLogs); return true; } catch (e) { @@ -38,17 +37,17 @@ describe('State logs', function () { failOnConsoleError: false, }, async ({ driver }) => { - await createDownloadFolder(); + await createDownloadFolder(downloadsFolder); await driver.navigate(); await driver.fill('#password', 'correct horse battery staple'); await driver.press('#password', driver.Key.ENTER); - // Download State Logs + // Download state logs await driver.clickElement('.account-menu__icon'); await driver.clickElement({ text: 'Settings', tag: 'div' }); await driver.clickElement({ text: 'Advanced', tag: 'div' }); await driver.clickElement({ - text: 'Download State Logs', + text: 'Download state logs', tag: 'button', }); diff --git a/test/e2e/tests/swap-eth.spec.js b/test/e2e/tests/swap-eth.spec.js index 5e26b00e0..e53ba0d6d 100644 --- a/test/e2e/tests/swap-eth.spec.js +++ b/test/e2e/tests/swap-eth.spec.js @@ -14,10 +14,13 @@ describe('Swap Eth for another Token', function () { it('Completes a Swap between Eth and Matic', async function () { await withFixtures( { - fixtures: 'imported-account', + fixtures: 'special-settings', ganacheOptions, title: this.test.title, failOnConsoleError: false, + driverOptions: { + timeOut: 20000, + }, }, async ({ driver }) => { await driver.navigate(); @@ -37,7 +40,6 @@ describe('Swap Eth for another Token', function () { '[class="dropdown-search-list__closed-primary-label dropdown-search-list__select-default"]', ); await driver.clickElement('[placeholder="Search for a token"]'); - await driver.clickElement('[placeholder="Search for a token"]'); await driver.fill('[placeholder="Search for a token"]', 'DAI'); await driver.waitForSelector( '[class="searchable-item-list__primary-label"]', @@ -45,7 +47,7 @@ describe('Swap Eth for another Token', function () { await driver.clickElement( '[class="searchable-item-list__primary-label"]', ); - await driver.clickElement({ text: 'Review Swap', tag: 'button' }); + await driver.clickElement({ text: 'Review swap', tag: 'button' }); await driver.waitForSelector('[class*="box--align-items-center"]'); const estimatedEth = await driver.waitForSelector({ css: '[class*="box--align-items-center"]', diff --git a/test/e2e/tests/token-details.spec.js b/test/e2e/tests/token-details.spec.js index 6b182fc03..fd93d7d0f 100644 --- a/test/e2e/tests/token-details.spec.js +++ b/test/e2e/tests/token-details.spec.js @@ -24,7 +24,7 @@ describe('Token Details', function () { await driver.press('#password', driver.Key.ENTER); await driver.clickElement({ text: 'import tokens', tag: 'a' }); - await driver.clickElement({ text: 'Custom Token', tag: 'button' }); + await driver.clickElement({ text: 'Custom token', tag: 'button' }); const tokenAddress = '0x2EFA2Cb29C2341d8E5Ba7D3262C9e9d6f1Bf3711'; const tokenSymbol = 'AAVE'; @@ -32,8 +32,8 @@ describe('Token Details', function () { await driver.fill('#custom-address', tokenAddress); await driver.waitForSelector('#custom-symbol-helper-text'); await driver.fill('#custom-symbol', tokenSymbol); - await driver.clickElement({ text: 'Add Custom Token', tag: 'button' }); - await driver.clickElement({ text: 'Import Tokens', tag: 'button' }); + await driver.clickElement({ text: 'Add custom token', tag: 'button' }); + await driver.clickElement({ text: 'Import tokens', tag: 'button' }); await driver.clickElement('[title="Asset options"]'); await driver.clickElement({ text: 'Token details', tag: 'span' }); diff --git a/test/e2e/user-actions-benchmark.js b/test/e2e/user-actions-benchmark.js new file mode 100644 index 000000000..f91f6c318 --- /dev/null +++ b/test/e2e/user-actions-benchmark.js @@ -0,0 +1,130 @@ +const path = require('path'); +const { promises: fs } = require('fs'); +const yargs = require('yargs/yargs'); +const { hideBin } = require('yargs/helpers'); +const { exitWithError } = require('../../development/lib/exit-with-error'); +const { + isWritable, + getFirstParentDirectoryThatExists, +} = require('../helpers/file'); +const { convertToHexValue, withFixtures } = require('./helpers'); + +const ganacheOptions = { + accounts: [ + { + secretKey: + '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', + balance: convertToHexValue(25000000000000000000), + }, + ], +}; + +async function loadNewAccount() { + let loadingTimes; + + await withFixtures( + { + fixtures: 'imported-account', + ganacheOptions, + }, + async ({ driver }) => { + await driver.navigate(); + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + await driver.clickElement('.account-menu__icon'); + const timestampBeforeAction = new Date(); + await driver.clickElement({ text: 'Create account', tag: 'div' }); + await driver.fill('.new-account-create-form input', '2nd account'); + await driver.clickElement({ text: 'Create', tag: 'button' }); + await driver.waitForSelector({ + css: '.currency-display-component__text', + text: '0', + }); + const timestampAfterAction = new Date(); + loadingTimes = timestampAfterAction - timestampBeforeAction; + }, + ); + return loadingTimes; +} + +async function confirmTx() { + let loadingTimes; + await withFixtures( + { + fixtures: 'imported-account', + ganacheOptions, + }, + async ({ driver }) => { + await driver.navigate(); + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + await driver.clickElement('[data-testid="eth-overview-send"]'); + + await driver.fill( + 'input[placeholder="Search, public address (0x), or ENS"]', + '0x2f318C334780961FB129D2a6c30D0763d9a5C970', + ); + + const inputAmount = await driver.findElement('.unit-input__input'); + await inputAmount.fill('1'); + + await driver.clickElement({ text: 'Next', tag: 'button' }); + const timestampBeforeAction = new Date(); + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + + await driver.clickElement('[data-testid="home__activity-tab"]'); + await driver.wait(async () => { + const confirmedTxes = await driver.findElements( + '.transaction-list__completed-transactions .transaction-list-item', + ); + return confirmedTxes.length === 1; + }, 10000); + + await driver.waitForSelector('.transaction-status--confirmed'); + const timestampAfterAction = new Date(); + loadingTimes = timestampAfterAction - timestampBeforeAction; + }, + ); + return loadingTimes; +} + +async function main() { + const { argv } = yargs(hideBin(process.argv)).usage( + '$0 [options]', + 'Run a page load benchmark', + (_yargs) => + _yargs.option('out', { + description: + 'Output filename. Output printed to STDOUT of this is omitted.', + type: 'string', + normalize: true, + }), + ); + + const results = {}; + results.loadNewAccount = await loadNewAccount(); + results.confirmTx = await confirmTx(); + const { out } = argv; + + if (out) { + const outputDirectory = path.dirname(out); + const existingParentDirectory = await getFirstParentDirectoryThatExists( + outputDirectory, + ); + if (!(await isWritable(existingParentDirectory))) { + throw new Error('Specified output file directory is not writable'); + } + if (outputDirectory !== existingParentDirectory) { + await fs.mkdir(outputDirectory, { recursive: true }); + } + await fs.writeFile(out, JSON.stringify(results, null, 2)); + } else { + console.log(JSON.stringify(results, null, 2)); + } +} + +main().catch((error) => { + exitWithError(error); +}); diff --git a/test/e2e/webdriver/chrome.js b/test/e2e/webdriver/chrome.js index a9df3e646..09069906c 100644 --- a/test/e2e/webdriver/chrome.js +++ b/test/e2e/webdriver/chrome.js @@ -18,7 +18,14 @@ class ChromeDriver { if (responsive) { args.push('--auto-open-devtools-for-tabs'); } - args.push('--log-level=3'); + + if (process.env.ENABLE_MV3) { + args.push('--log-level=0'); + args.push('--enable-logging'); + args.push(`--user-data-dir=${process.cwd()}/test-artifacts/chrome`); + } else { + args.push('--log-level=3'); + } const options = new chrome.Options().addArguments(args); options.setProxy(proxy.manual({ https: HTTPS_PROXY_HOST })); options.setAcceptInsecureCerts(true); diff --git a/test/e2e/webdriver/driver.js b/test/e2e/webdriver/driver.js index 76a47cf8d..d7bd58818 100644 --- a/test/e2e/webdriver/driver.js +++ b/test/e2e/webdriver/driver.js @@ -397,6 +397,20 @@ class Driver { ); } + async checkBrowserForLavamoatLogs() { + const browserLogs = ( + await fs.readFile( + `${process.cwd()}/test-artifacts/chrome/chrome_debug.log`, + ) + ) + .toString('utf-8') + .split(/\r?\n/u); + + await fs.writeFile('/tmp/all_logs.json', JSON.stringify(browserLogs)); + + return browserLogs; + } + async checkBrowserForConsoleErrors() { const ignoredLogTypes = ['WARNING']; const ignoredErrorMessages = [ diff --git a/test/e2e/webdriver/firefox.js b/test/e2e/webdriver/firefox.js index 776792e10..6bb90b9ab 100644 --- a/test/e2e/webdriver/firefox.js +++ b/test/e2e/webdriver/firefox.js @@ -4,8 +4,6 @@ const path = require('path'); const { Builder, By, until } = require('selenium-webdriver'); const firefox = require('selenium-webdriver/firefox'); const proxy = require('selenium-webdriver/proxy'); -const { getVersion } = require('../../../development/lib/get-version'); -const { BuildType } = require('../../../development/lib/build-type'); /** * The prefix for temporary Firefox profiles. All Firefox profiles used for e2e tests @@ -32,10 +30,9 @@ class FirefoxDriver { * @param {object} options - the options for the build * @param options.responsive * @param options.port - * @param options.type * @returns {Promise<{driver: !ThenableWebDriver, extensionUrl: string, extensionId: string}>} */ - static async build({ responsive, port, type }) { + static async build({ responsive, port }) { const templateProfile = fs.mkdtempSync(TEMP_PROFILE_PATH_PREFIX); const options = new firefox.Options().setProfile(templateProfile); options.setProxy(proxy.manual({ https: HTTPS_PROXY_HOST })); @@ -55,14 +52,7 @@ class FirefoxDriver { const driver = builder.build(); const fxDriver = new FirefoxDriver(driver); - const version = getVersion(type || BuildType.main, 0); - let extensionString = `builds/metamask-firefox-${version}.zip`; - - if (type) { - extensionString = `builds/metamask-${type}-firefox-${version}.zip`; - } - - const extensionId = await fxDriver.installExtension(extensionString); + const extensionId = await fxDriver.installExtension('dist/firefox'); const internalExtensionId = await fxDriver.getInternalId(); if (responsive) { diff --git a/test/e2e/webdriver/index.js b/test/e2e/webdriver/index.js index 13fcbb29f..ebec9a002 100644 --- a/test/e2e/webdriver/index.js +++ b/test/e2e/webdriver/index.js @@ -3,15 +3,15 @@ const Driver = require('./driver'); const ChromeDriver = require('./chrome'); const FirefoxDriver = require('./firefox'); -async function buildWebDriver({ responsive, port, type } = {}) { +async function buildWebDriver({ responsive, port, timeOut } = {}) { const browser = process.env.SELENIUM_BROWSER; const { driver: seleniumDriver, extensionId, extensionUrl, - } = await buildBrowserWebDriver(browser, { responsive, port, type }); - const driver = new Driver(seleniumDriver, browser, extensionUrl); + } = await buildBrowserWebDriver(browser, { responsive, port }); + const driver = new Driver(seleniumDriver, browser, extensionUrl, timeOut); return { driver, diff --git a/test/helpers/file.js b/test/helpers/file.js new file mode 100644 index 000000000..f2f13fa83 --- /dev/null +++ b/test/helpers/file.js @@ -0,0 +1,37 @@ +/* eslint-disable node/shebang */ +const path = require('path'); +const { promises: fs, constants: fsConstants } = require('fs'); + +async function isWritable(directory) { + try { + await fs.access(directory, fsConstants.W_OK); + return true; + } catch (error) { + if (error.code !== 'EACCES') { + throw error; + } + return false; + } +} + +async function getFirstParentDirectoryThatExists(directory) { + let nextDirectory = directory; + for (;;) { + try { + await fs.access(nextDirectory, fsConstants.F_OK); + return nextDirectory; + } catch (error) { + if (error.code !== 'ENOENT') { + throw error; + } else if (nextDirectory === path.dirname(nextDirectory)) { + throw new Error('Failed to find parent directory that exists'); + } + nextDirectory = path.dirname(nextDirectory); + } + } +} + +module.exports = { + isWritable, + getFirstParentDirectoryThatExists, +}; diff --git a/test/helpers/setup-helper.js b/test/helpers/setup-helper.js index fb77e8ee6..2c7a8299f 100644 --- a/test/helpers/setup-helper.js +++ b/test/helpers/setup-helper.js @@ -6,7 +6,9 @@ import { JSDOM } from 'jsdom'; process.env.IN_TEST = true; -global.chrome = { runtime: { id: 'testid' } }; +global.chrome = { + runtime: { id: 'testid', getManifest: () => ({ manifest_version: 2 }) }, +}; nock.disableNetConnect(); nock.enableNetConnect('localhost'); @@ -55,12 +57,20 @@ global.Element = window.Element; // required by `react-popper` global.HTMLElement = window.HTMLElement; +// Jest no longer adds the following timers so we use set/clear Timeouts +global.setImmediate = + global.setImmediate || ((fn, ...args) => global.setTimeout(fn, 0, ...args)); +global.clearImmediate = + global.clearImmediate || ((id) => global.clearTimeout(id)); + // required by any components anchored on `popover-content` const popoverContent = window.document.createElement('div'); popoverContent.setAttribute('id', 'popover-content'); window.document.body.appendChild(popoverContent); // fetch +// fetch is part of node js in future versions, thus triggering no-shadow +// eslint-disable-next-line no-shadow const fetch = require('node-fetch'); const { Headers, Request, Response } = fetch; diff --git a/test/jest/setup.js b/test/jest/setup.js index 6176cfc66..ae49888e5 100644 --- a/test/jest/setup.js +++ b/test/jest/setup.js @@ -1,2 +1,10 @@ // This file is for Jest-specific setup only and runs before our Jest tests. import '@testing-library/jest-dom'; + +jest.mock('webextension-polyfill', () => { + return { + runtime: { + getManifest: () => ({ manifest_version: 2 }), + }, + }; +}); diff --git a/test/lib/render-helpers.js b/test/lib/render-helpers.js index 27bc73b7c..0291df0f8 100644 --- a/test/lib/render-helpers.js +++ b/test/lib/render-helpers.js @@ -2,9 +2,11 @@ import React, { useMemo } from 'react'; import { Provider } from 'react-redux'; import { render } from '@testing-library/react'; import { mount, shallow } from 'enzyme'; -import { MemoryRouter } from 'react-router-dom'; +import { Router, MemoryRouter } from 'react-router-dom'; import PropTypes from 'prop-types'; +import { createMemoryHistory } from 'history'; import { I18nContext, LegacyI18nProvider } from '../../ui/contexts/i18n'; +import { LegacyMetaMetricsProvider } from '../../ui/contexts/metametrics'; import { getMessage } from '../../ui/helpers/utils/i18n-helper'; import * as en from '../../app/_locales/en/messages.json'; @@ -77,25 +79,34 @@ I18nProvider.defaultProps = { children: undefined, }; -export function renderWithProvider(component, store) { +export function renderWithProvider(component, store, pathname = '/') { + const history = createMemoryHistory({ initialEntries: [pathname] }); const Wrapper = ({ children }) => store ? ( - + - {children} + + {children} + - + ) : ( - {children} + + + {children} + + ); Wrapper.propTypes = { children: PropTypes.node, }; - - return render(component, { wrapper: Wrapper }); + return { + ...render(component, { wrapper: Wrapper }), + history, + }; } export function renderWithLocalization(component) { diff --git a/test/setup.js b/test/setup.js index 57e79a557..68a0b152c 100644 --- a/test/setup.js +++ b/test/setup.js @@ -1,4 +1,5 @@ require('@babel/register'); +require('ts-node/register'); require('./helpers/setup-helper'); diff --git a/tsconfig.json b/tsconfig.json index 34389d567..49cc11a4e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "allowJs": true, "allowSyntheticDefaultImports": true, + "baseUrl": ".", "inlineSources": true, "isolatedModules": true, "jsx": "react", @@ -22,5 +23,8 @@ "dist/**/*", "node_modules/**" ], - "extends": "@tsconfig/node14/tsconfig.json" + "extends": "@tsconfig/node16/tsconfig.json", + "paths": { + "*": ["./types/*"] + } } diff --git a/types/classnames.d.ts b/types/classnames.d.ts new file mode 100644 index 000000000..a2a57bae1 --- /dev/null +++ b/types/classnames.d.ts @@ -0,0 +1,5 @@ +declare module 'classnames' { + export default function classnames( + ...args: (string | Record)[] + ): string; +} diff --git a/types/react-tippy.d.ts b/types/react-tippy.d.ts new file mode 100644 index 000000000..b14126b26 --- /dev/null +++ b/types/react-tippy.d.ts @@ -0,0 +1,71 @@ +// Copied from +// which for some reason is not included in the distributed version +declare module 'react-tippy' { + import * as React from 'react'; + + export type Position = + | 'top' + | 'top-start' + | 'top-end' + | 'bottom' + | 'bottom-start' + | 'bottom-end' + | 'left' + | 'left-start' + | 'left-end' + | 'right' + | 'right-start' + | 'right-end'; + export type Trigger = 'mouseenter' | 'focus' | 'click' | 'manual'; + export type Animation = 'shift' | 'perspective' | 'fade' | 'scale' | 'none'; + export type Size = 'small' | 'regular' | 'big'; + export type Theme = 'dark' | 'light' | 'transparent'; + + export interface TooltipProps { + title?: string; + disabled?: boolean; + open?: boolean; + useContext?: boolean; + onRequestClose?: () => void; + position?: Position; + trigger?: Trigger; + tabIndex?: number; + interactive?: boolean; + interactiveBorder?: number; + delay?: number; + hideDelay?: number; + animation?: Animation; + arrow?: boolean; + arrowSize?: Size; + animateFill?: boolean; + duration?: number; + hideDuration?: number; + distance?: number; + offset?: number; + hideOnClick?: boolean | 'persistent'; + multiple?: boolean; + followCursor?: boolean; + inertia?: boolean; + transitionFlip?: boolean; + popperOptions?: any; + html?: React.ReactElement; + unmountHTMLWhenHide?: boolean; + size?: Size; + sticky?: boolean; + stickyDuration?: boolean; + beforeShown?: () => void; + shown?: () => void; + beforeHidden?: () => void; + hidden?: () => void; + theme?: Theme; + className?: string; + style?: React.CSSProperties; + } + + export class Tooltip extends React.Component {} + + export function withTooltip

( + component: React.ComponentType

, + options: TooltipProps, + ): JSX.Element; +} diff --git a/types/react.d.ts b/types/react.d.ts new file mode 100644 index 000000000..c7dd2b37d --- /dev/null +++ b/types/react.d.ts @@ -0,0 +1,9 @@ +declare namespace React { + /* eslint-disable-next-line import/no-extraneous-dependencies */ + import * as CSS from 'csstype'; + + // Add custom CSS properties so that they can be used in `style` props + export interface CSSProperties extends CSS.Properties { + '--progress'?: string; + } +} diff --git a/ui/__mocks__/webextension-polyfill.js b/ui/__mocks__/webextension-polyfill.js index 54e90aa25..0984c767d 100644 --- a/ui/__mocks__/webextension-polyfill.js +++ b/ui/__mocks__/webextension-polyfill.js @@ -1,3 +1,3 @@ module.exports = { - runtime: {}, + runtime: { getManifest: () => ({ manifest_version: 2 }) }, }; diff --git a/ui/components/app/account-list-item/README.mdx b/ui/components/app/account-list-item/README.mdx index a0eb00386..6c2db73a2 100644 --- a/ui/components/app/account-list-item/README.mdx +++ b/ui/components/app/account-list-item/README.mdx @@ -9,6 +9,6 @@ Account List Item is referred for each account item on the Account List's compon -## Component API +## Props diff --git a/ui/components/app/account-menu/account-menu.component.js b/ui/components/app/account-menu/account-menu.component.js index 44b68b739..fbd67f923 100644 --- a/ui/components/app/account-menu/account-menu.component.js +++ b/ui/components/app/account-menu/account-menu.component.js @@ -5,7 +5,11 @@ import Fuse from 'fuse.js'; import InputAdornment from '@material-ui/core/InputAdornment'; import classnames from 'classnames'; import { ENVIRONMENT_TYPE_POPUP } from '../../../../shared/constants/app'; -import { EVENT } from '../../../../shared/constants/metametrics'; +import { + EVENT, + EVENT_NAMES, + CONTEXT_PROPS, +} from '../../../../shared/constants/metametrics'; import { getEnvironmentType } from '../../../../app/scripts/lib/util'; import Identicon from '../../ui/identicon'; import SiteIcon from '../../ui/site-icon'; @@ -210,15 +214,15 @@ export default class AccountMenu extends Component { onClick={() => { this.context.trackEvent({ category: EVENT.CATEGORIES.NAVIGATION, - event: 'Switched Account', + event: EVENT_NAMES.NAV_ACCOUNT_SWITCHED, properties: { - action: 'Main Menu', - legacy_event: true, + location: 'Main Menu', }, }); showAccountDetail(identity.address); }} key={identity.address} + data-testid="account-menu__account" >

{isSelected ? ( @@ -230,6 +234,7 @@ export default class AccountMenu extends Component {
{identity.name || ''}
@@ -356,10 +361,10 @@ export default class AccountMenu extends Component { toggleAccountMenu(); trackEvent({ category: EVENT.CATEGORIES.NAVIGATION, - event: 'Clicked Create Account', + event: EVENT_NAMES.ACCOUNT_ADD_SELECTED, properties: { - action: 'Main Menu', - legacy_event: true, + account_type: EVENT.ACCOUNT_TYPES.DEFAULT, + location: 'Main Menu', }, }); history.push(NEW_ACCOUNT_ROUTE); @@ -372,10 +377,10 @@ export default class AccountMenu extends Component { toggleAccountMenu(); trackEvent({ category: EVENT.CATEGORIES.NAVIGATION, - event: 'Clicked Import Account', + event: EVENT_NAMES.ACCOUNT_ADD_SELECTED, properties: { - action: 'Main Menu', - legacy_event: true, + account_type: EVENT.ACCOUNT_TYPES.IMPORTED, + location: 'Main Menu', }, }); history.push(IMPORT_ACCOUNT_ROUTE); @@ -393,10 +398,10 @@ export default class AccountMenu extends Component { toggleAccountMenu(); trackEvent({ category: EVENT.CATEGORIES.NAVIGATION, - event: 'Clicked Connect Hardware', + event: EVENT_NAMES.ACCOUNT_ADD_SELECTED, properties: { - action: 'Main Menu', - legacy_event: true, + account_type: EVENT.ACCOUNT_TYPES.HARDWARE, + location: 'Main Menu', }, }); if (getEnvironmentType() === ENVIRONMENT_TYPE_POPUP) { @@ -440,6 +445,18 @@ export default class AccountMenu extends Component { } { + trackEvent( + { + category: EVENT.CATEGORIES.NAVIGATION, + event: EVENT_NAMES.SUPPORT_LINK_CLICKED, + properties: { + url: supportLink, + }, + }, + { + contextPropsIntoEventProperties: [CONTEXT_PROPS.PAGE_TITLE], + }, + ); global.platform.openTab({ url: supportLink }); }} icon={ @@ -457,10 +474,9 @@ export default class AccountMenu extends Component { history.push(SETTINGS_ROUTE); this.context.trackEvent({ category: EVENT.CATEGORIES.NAVIGATION, - event: 'Opened Settings', + event: EVENT_NAMES.NAV_SETTINGS_OPENED, properties: { - action: 'Main Menu', - legacy_event: true, + location: 'Main Menu', }, }); }} diff --git a/ui/components/app/account-menu/account-menu.test.js b/ui/components/app/account-menu/account-menu.test.js index c8393533c..86bfcf66d 100644 --- a/ui/components/app/account-menu/account-menu.test.js +++ b/ui/components/app/account-menu/account-menu.test.js @@ -1,14 +1,11 @@ import React from 'react'; import sinon from 'sinon'; import configureMockStore from 'redux-mock-store'; -import { Provider } from 'react-redux'; -import { mountWithRouter } from '../../../../test/lib/render-helpers'; -import Button from '../../ui/button'; +import { fireEvent, screen } from '@testing-library/react'; +import { renderWithProvider } from '../../../../test/lib/render-helpers'; import AccountMenu from '.'; describe('Account Menu', () => { - let wrapper; - const mockStore = { metamask: { provider: { @@ -57,13 +54,8 @@ describe('Account Menu', () => { }, }; - beforeAll(() => { - wrapper = mountWithRouter( - - - , - store, - ); + beforeEach(() => { + renderWithProvider(, store); }); afterEach(() => { @@ -73,58 +65,53 @@ describe('Account Menu', () => { describe('Render Content', () => { it('returns account name from identities', () => { - const accountName = wrapper.find('.account-menu__name'); + const accountName = screen.queryAllByTestId('account-menu__account'); expect(accountName).toHaveLength(2); }); it('renders user preference currency display balance from account balance', () => { - const accountBalance = wrapper.find( - '.currency-display-component.account-menu__balance', - ); + const accountBalance = screen.queryAllByTestId('account-menu__balance'); + expect(accountBalance).toHaveLength(2); }); it('simulate click', () => { - const click = wrapper.find( - '.account-menu__account.account-menu__item--clickable', - ); - click.first().simulate('click'); + const click = screen.getAllByTestId('account-menu__account'); + fireEvent.click(click[0]); expect(props.showAccountDetail.calledOnce).toStrictEqual(true); expect(props.showAccountDetail.getCall(0).args[0]).toStrictEqual('0x00'); }); it('render imported account label', () => { - const importedAccount = wrapper.find('.keyring-label.allcaps'); - expect(importedAccount.text()).toStrictEqual('[imported]'); + const importedAccount = screen.getByText('Imported'); + expect(importedAccount).toBeInTheDocument(); }); }); describe('Log Out', () => { - let logout; - it('logout', () => { - logout = wrapper.find(Button); - expect(logout).toHaveLength(1); + const logout = screen.getByText('Lock'); + expect(logout).toBeInTheDocument(); }); it('simulate click', () => { - logout.simulate('click'); + const logout = screen.getByText('Lock'); + fireEvent.click(logout); expect(props.lockMetamask.calledOnce).toStrictEqual(true); expect(props.history.push.getCall(0).args[0]).toStrictEqual('/'); }); }); describe('Create Account', () => { - let createAccount; - it('renders create account item', () => { - createAccount = wrapper.find({ text: 'createAccount' }); - expect(createAccount).toHaveLength(1); + const createAccount = screen.getByText('Create account'); + expect(createAccount).toBeInTheDocument(); }); it('calls toggle menu and push new-account route to history', () => { - createAccount.simulate('click'); + const createAccount = screen.getByText('Create account'); + fireEvent.click(createAccount); expect(props.toggleAccountMenu.calledOnce).toStrictEqual(true); expect(props.history.push.getCall(0).args[0]).toStrictEqual( '/new-account', @@ -133,15 +120,14 @@ describe('Account Menu', () => { }); describe('Import Account', () => { - let importAccount; - it('renders import account item', () => { - importAccount = wrapper.find({ text: 'importAccount' }); - expect(importAccount).toHaveLength(1); + const importAccount = screen.getByText('Import account'); + expect(importAccount).toBeInTheDocument(); }); it('calls toggle menu and push /new-account/import route to history', () => { - importAccount.simulate('click'); + const importAccount = screen.getByText('Import account'); + fireEvent.click(importAccount); expect(props.toggleAccountMenu.calledOnce).toStrictEqual(true); expect(props.history.push.getCall(0).args[0]).toStrictEqual( '/new-account/import', @@ -149,16 +135,15 @@ describe('Account Menu', () => { }); }); - describe('Connect Hardware Wallet', () => { - let connectHardwareWallet; - + describe('Connect hardware wallet', () => { it('renders import account item', () => { - connectHardwareWallet = wrapper.find({ text: 'connectHardwareWallet' }); - expect(connectHardwareWallet).toHaveLength(1); + const connectHardwareWallet = screen.getByText('Connect hardware wallet'); + expect(connectHardwareWallet).toBeInTheDocument(); }); it('calls toggle menu and push /new-account/connect route to history', () => { - connectHardwareWallet.simulate('click'); + const connectHardwareWallet = screen.getByText('Connect hardware wallet'); + fireEvent.click(connectHardwareWallet); expect(props.toggleAccountMenu.calledOnce).toStrictEqual(true); expect(props.history.push.getCall(0).args[0]).toStrictEqual( '/new-account/connect', @@ -167,31 +152,29 @@ describe('Account Menu', () => { }); describe('Support', () => { - let support; global.platform = { openTab: sinon.spy() }; it('renders import account item', () => { - support = wrapper.find({ text: 'needHelpSubmitTicket' }); - expect(support).toHaveLength(1); + const support = screen.getByText('Submit a ticket'); + expect(support).toBeInTheDocument(); }); it('opens support link when clicked', () => { - support = wrapper.find({ text: 'needHelpSubmitTicket' }); - support.simulate('click'); + const support = screen.getByText('Submit a ticket'); + fireEvent.click(support); expect(global.platform.openTab.calledOnce).toStrictEqual(true); }); }); describe('Settings', () => { - let settings; - it('renders import account item', () => { - settings = wrapper.find({ text: 'settings' }); - expect(settings).toHaveLength(1); + const settings = screen.getByText('Settings'); + expect(settings).toBeInTheDocument(); }); it('calls toggle menu and push /new-account/connect route to history', () => { - settings.simulate('click'); + const settings = screen.getByText('Settings'); + fireEvent.click(settings); expect(props.toggleAccountMenu.calledOnce).toStrictEqual(true); expect(props.history.push.getCall(0).args[0]).toStrictEqual('/settings'); }); diff --git a/ui/components/app/account-menu/index.scss b/ui/components/app/account-menu/index.scss index b6461f7b1..d3b79532a 100644 --- a/ui/components/app/account-menu/index.scss +++ b/ui/components/app/account-menu/index.scss @@ -5,23 +5,23 @@ width: 320px; border-radius: 4px; background: var(--color-background-default); - box-shadow: rgba($black, 0.15) 0 2px 2px 2px; + box-shadow: var(--shadow-size-sm) var(--color-shadow-default); min-width: 150px; color: var(--color-text-default); - @media screen and (max-width: $break-small) { + @include screen-sm-max { right: 16px; } - @media screen and (min-width: $break-large) { + @include screen-sm-min { right: calc((100vw - 85vw) / 2); } - @media screen and (min-width: 769px) { + @include screen-md-min { right: calc((100vw - 80vw) / 2); } - @media screen and (min-width: 1281px) { + @include screen-lg-min { right: calc((100vw - 65vw) / 2); } @@ -36,9 +36,9 @@ background: none; width: 100%; - @media screen and (max-width: $break-small) { - padding: 14px; - height: 54px; + @include screen-sm-max { + padding: 0 14px; + height: 40px; } &--clickable { @@ -65,7 +65,11 @@ } &__text { - @include Paragraph; + @include H6; + + @include screen-md-min { + @include Paragraph; + } color: var(--color-text-default); } @@ -121,10 +125,6 @@ position: relative; flex-direction: column; z-index: 200; - - @media (max-height: 600px) { - max-height: 236px; - } } &__accounts { @@ -133,8 +133,14 @@ max-height: 256px; scrollbar-width: auto; - @media screen and (max-width: $break-small) { - max-height: 156px; + @include screen-sm-max { + max-height: 240px; + } + + // If window is smaller than extension popover height + // reduce scrollable accounts window height + @media screen and (max-height: 600px) { + max-height: 130px; } .keyring-label { @@ -191,7 +197,7 @@ border: 0; width: 100%; - @media screen and (max-width: $break-small) { + @include screen-sm-max { padding: 12px 14px; } @@ -231,7 +237,11 @@ } &__name { - @include H4; + @include H6; + + @include screen-md-min { + @include Paragraph; + } color: var(--color-text-default); text-overflow: ellipsis; diff --git a/ui/components/app/add-network/add-network.js b/ui/components/app/add-network/add-network.js index 3ebf2d293..c6d5fe06e 100644 --- a/ui/components/app/add-network/add-network.js +++ b/ui/components/app/add-network/add-network.js @@ -28,12 +28,13 @@ import { ENVIRONMENT_TYPE_POPUP, MESSAGE_TYPE, } from '../../../../shared/constants/app'; -import { requestUserApproval } from '../../../store/actions'; +import { requestAddNetworkApproval } from '../../../store/actions'; import Popover from '../../ui/popover'; import ConfirmationPage from '../../../pages/confirmation/confirmation'; import { FEATURED_RPCS } from '../../../../shared/constants/network'; import { ADD_NETWORK_ROUTE } from '../../../helpers/constants/routes'; import { getEnvironmentType } from '../../../../app/scripts/lib/util'; +import ZENDESK_URLS from '../../../helpers/constants/zendesk-url'; const AddNetwork = () => { const t = useContext(I18nContext); @@ -58,14 +59,13 @@ const AddNetwork = () => { const [showPopover, setShowPopover] = useState(false); useEffect(() => { - const anAddNetworkConfirmationFromMetaMaskExists = unapprovedConfirmations?.find( - (confirmation) => { + const anAddNetworkConfirmationFromMetaMaskExists = + unapprovedConfirmations?.find((confirmation) => { return ( confirmation.origin === 'metamask' && confirmation.type === MESSAGE_TYPE.ADD_ETHEREUM_CHAIN ); - }, - ); + }); if (!showPopover && anAddNetworkConfirmationFromMetaMaskExists) { setShowPopover(true); } @@ -82,7 +82,9 @@ const AddNetwork = () => { className="add-network__edge-case-box" borderRadius={SIZES.MD} padding={4} - margin={[4, 6, 0, 6]} + marginTop={4} + marginRight={6} + marginLeft={6} display={DISPLAY.FLEX} flexDirection={FLEX_DIRECTION.ROW} backgroundColor={COLORS.BACKGROUND_ALTERNATIVE} @@ -147,24 +149,23 @@ const AddNetwork = () => { )} {t('addFromAListOfPopularNetworks')} {t('popularCustomNetworks')} @@ -216,7 +217,7 @@ const AddNetwork = () => { {t('addNetworkTooltipWarning', [ @@ -238,7 +239,7 @@ const AddNetwork = () => { type="inline" className="add-network__add-button" onClick={async () => { - await dispatch(requestUserApproval(item, true)); + await dispatch(requestAddNetworkApproval(item, true)); }} > {t('add')} @@ -276,7 +277,7 @@ const AddNetwork = () => { )} {showPopover && ( - + )} diff --git a/ui/components/app/add-network/index.scss b/ui/components/app/add-network/index.scss index 4c7d9f909..29899b329 100644 --- a/ui/components/app/add-network/index.scss +++ b/ui/components/app/add-network/index.scss @@ -2,7 +2,7 @@ &__networks-container { padding-inline-end: 24px; - @media screen and (max-width: $break-small) { + @include screen-sm-max { padding: 0; } } @@ -10,7 +10,7 @@ &__header { border-bottom: 1px solid var(--color-border-default); - @media screen and (max-width: 575px) { + @include screen-sm-max { padding-inline-start: 24px; padding-inline-end: 24px; } @@ -22,14 +22,14 @@ } &__main-container { - @media screen and (max-width: 575px) { + @include screen-sm-max { padding-inline-start: 24px; padding-inline-end: 24px; } } &__list-of-networks { - @media screen and (min-width: $break-large) { + @include screen-sm-min { width: 75%; } } @@ -65,7 +65,7 @@ width: 100%; padding-bottom: 8px; - @media screen and (max-width: 575px) { + @include screen-sm-max { padding-inline-start: 24px !important; } diff --git a/ui/components/app/advanced-gas-controls/advanced-gas-controls.test.js b/ui/components/app/advanced-gas-controls/advanced-gas-controls.test.js index e44fb0a50..7ca1ae6aa 100644 --- a/ui/components/app/advanced-gas-controls/advanced-gas-controls.test.js +++ b/ui/components/app/advanced-gas-controls/advanced-gas-controls.test.js @@ -22,7 +22,7 @@ describe('AdvancedGasControls Component', () => { it('should not render maxFee and maxPriorityFee inputs if supportsEIP1559 is false', () => { const { queryByText } = renderComponent({ supportsEIP1559: false }); - expect(queryByText('Gas Limit')).toBeInTheDocument(); + expect(queryByText('Gas limit')).toBeInTheDocument(); expect(queryByText('Gas price')).toBeInTheDocument(); expect(queryByText('Max fee')).not.toBeInTheDocument(); expect(queryByText('Max priority fee')).not.toBeInTheDocument(); @@ -34,7 +34,7 @@ describe('AdvancedGasControls Component', () => { supportsEIP1559: true, }); expect(queryByText('Gas price')).not.toBeInTheDocument(); - expect(queryByText('Gas Limit')).toBeInTheDocument(); + expect(queryByText('Gas limit')).toBeInTheDocument(); expect(queryByText('Max fee')).toBeInTheDocument(); expect(queryByText('Max priority fee')).toBeInTheDocument(); }); diff --git a/ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-defaults/advanced-gas-fee-defaults.js b/ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-defaults/advanced-gas-fee-defaults.js index beefff4fa..59428a649 100644 --- a/ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-defaults/advanced-gas-fee-defaults.js +++ b/ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-defaults/advanced-gas-fee-defaults.js @@ -22,11 +22,8 @@ import { useI18nContext } from '../../../../hooks/useI18nContext'; const AdvancedGasFeeDefaults = () => { const t = useI18nContext(); const dispatch = useDispatch(); - const { - gasErrors, - maxBaseFee, - maxPriorityFeePerGas, - } = useAdvancedGasFeePopoverContext(); + const { gasErrors, maxBaseFee, maxPriorityFeePerGas } = + useAdvancedGasFeePopoverContext(); const advancedGasFeeValues = useSelector(getAdvancedGasFeeValues); const { updateTransactionEventFragment } = useTransactionEventFragment(); const { editGasMode } = useGasFeeContext(); @@ -78,7 +75,9 @@ const AdvancedGasFeeDefaults = () => {
diff --git a/ui/components/app/cancel-speedup-popover/cancel-speedup-popover.test.js b/ui/components/app/cancel-speedup-popover/cancel-speedup-popover.test.js index d753a9350..d800a32ef 100644 --- a/ui/components/app/cancel-speedup-popover/cancel-speedup-popover.test.js +++ b/ui/components/app/cancel-speedup-popover/cancel-speedup-popover.test.js @@ -24,10 +24,8 @@ const MAXGASCOST_ABOVE_MOCK_MEDIUM_BN = new BigNumber( MAXFEEPERGAS_ABOVE_MOCK_MEDIUM_HEX, 16, ).times(21000, 10); -const MAXGASCOST_ABOVE_MOCK_MEDIUM_BN_PLUS_TEN_PCT_HEX = MAXGASCOST_ABOVE_MOCK_MEDIUM_BN.times( - 1.1, - 10, -).toString(16); +const MAXGASCOST_ABOVE_MOCK_MEDIUM_BN_PLUS_TEN_PCT_HEX = + MAXGASCOST_ABOVE_MOCK_MEDIUM_BN.times(1.1, 10).toString(16); const EXPECTED_ETH_FEE_1 = hexWEIToDecETH( MAXGASCOST_ABOVE_MOCK_MEDIUM_BN_PLUS_TEN_PCT_HEX, @@ -40,18 +38,15 @@ const MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_BN_WEI = new BigNumber( decGWEIToHexWEI(MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_DEC_GWEI), 16, ); -const MAXFEEPERGAS_BELOW_MOCK_MEDIUM_HEX = MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_BN_WEI.div( - 10, - 10, -).toString(16); +const MAXFEEPERGAS_BELOW_MOCK_MEDIUM_HEX = + MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_BN_WEI.div(10, 10).toString(16); const EXPECTED_ETH_FEE_2 = hexWEIToDecETH( MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_BN_WEI.times(21000, 10).toString(16), ); -const MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_HEX_WEI = MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_BN_WEI.toString( - 16, -); +const MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_HEX_WEI = + MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_BN_WEI.toString(16); jest.mock('../../../store/actions', () => ({ disconnectGasFeeEstimatePoller: jest.fn(), @@ -123,9 +118,9 @@ describe('CancelSpeedupPopover', () => { expect(screen.queryByText('❌Cancel')).toBeInTheDocument(); }); - it('should have 🚀Speed Up in header if editGasMode is speedup', async () => { + it('should have 🚀Speed up in header if editGasMode is speedup', async () => { await act(async () => render({ editGasMode: EDIT_GAS_MODES.SPEED_UP })); - expect(screen.queryByText('🚀Speed Up')).toBeInTheDocument(); + expect(screen.queryByText('🚀Speed up')).toBeInTheDocument(); }); it('information tooltip should contain the correct text if editGasMode is cancel', async () => { @@ -142,7 +137,7 @@ describe('CancelSpeedupPopover', () => { expect( InfoTooltip.mock.calls[0][0].contentText.props.children[0], ).toStrictEqual( - 'To Speed Up a transaction the gas fee must be increased by at least 10% for it to be recognized by the network.', + 'To Speed up a transaction the gas fee must be increased by at least 10% for it to be recognized by the network.', ); }); diff --git a/ui/components/app/collectible-details/collectible-details.js b/ui/components/app/collectible-details/collectible-details.js index df991634e..b50dd6062 100644 --- a/ui/components/app/collectible-details/collectible-details.js +++ b/ui/components/app/collectible-details/collectible-details.js @@ -47,11 +47,10 @@ import CollectibleOptions from '../collectible-options/collectible-options'; import Button from '../../ui/button'; import { startNewDraftTransaction } from '../../../ducks/send'; import InfoTooltip from '../../ui/info-tooltip'; -import { ERC721 } from '../../../helpers/constants/common'; import { usePrevious } from '../../../hooks/usePrevious'; import { useCopyToClipboard } from '../../../hooks/useCopyToClipboard'; import { isEqualCaseInsensitive } from '../../../../shared/modules/string-utils'; -import { ASSET_TYPES } from '../../../../shared/constants/transaction'; +import { ASSET_TYPES, ERC721 } from '../../../../shared/constants/transaction'; import CollectibleDefaultImage from '../collectible-default-image'; export default function CollectibleDetails({ collectible }) { diff --git a/ui/components/app/collectible-details/index.scss b/ui/components/app/collectible-details/index.scss index c368c63ff..44cad6eb5 100644 --- a/ui/components/app/collectible-details/index.scss +++ b/ui/components/app/collectible-details/index.scss @@ -6,7 +6,7 @@ $spacer-break-small: 16px; .collectible-details { padding: 0 $spacer-break-small; - @media screen and (min-width: $break-large) { + @include screen-sm-min { padding: 0 $spacer-break-large; } @@ -15,14 +15,14 @@ $spacer-break-small: 16px; flex-direction: column; margin-bottom: $spacer-break-small; - @media screen and (min-width: $break-large) { + @include screen-sm-min { margin-bottom: $spacer-break-large; flex-direction: row; } } &__info { - @media screen and (min-width: $break-large) { + @include screen-sm-min { max-width: calc( 100% - #{$card-width-break-large} - #{$spacer-break-large} @@ -35,7 +35,7 @@ $spacer-break-small: 16px; overflow: hidden; margin-bottom: $spacer-break-small; - @media screen and (min-width: $break-large) { + @include screen-sm-min { margin-right: $spacer-break-large; margin-bottom: 0; max-width: $card-width-break-large; @@ -95,7 +95,7 @@ $spacer-break-small: 16px; &__send-button { margin-inline-end: 8px; - @media screen and (min-width: $break-large) { + @include screen-sm-min { max-width: 160px; } } diff --git a/ui/components/app/collectible-options/collectible-options.js b/ui/components/app/collectible-options/collectible-options.js index 5df1b2019..358cf00fb 100644 --- a/ui/components/app/collectible-options/collectible-options.js +++ b/ui/components/app/collectible-options/collectible-options.js @@ -6,10 +6,8 @@ import { Menu, MenuItem } from '../../ui/menu'; const CollectibleOptions = ({ onRemove, onViewOnOpensea }) => { const t = useContext(I18nContext); - const [ - collectibleOptionsButtonElement, - setCollectibleOptionsButtonElement, - ] = useState(null); + const [collectibleOptionsButtonElement, setCollectibleOptionsButtonElement] = + useState(null); const [collectibleOptionsOpen, setCollectibleOptionsOpen] = useState(false); return ( diff --git a/ui/components/app/collectibles-detection-notice/collectibles-detection-notice.js b/ui/components/app/collectibles-detection-notice/collectibles-detection-notice.js index 3cf95e716..00e512385 100644 --- a/ui/components/app/collectibles-detection-notice/collectibles-detection-notice.js +++ b/ui/components/app/collectibles-detection-notice/collectibles-detection-notice.js @@ -56,8 +56,9 @@ export default function CollectiblesDetectionNotice() { diff --git a/ui/components/app/collectibles-tab/collectibles-tab.test.js b/ui/components/app/collectibles-tab/collectibles-tab.test.js index 9a1eba461..4d9494b88 100644 --- a/ui/components/app/collectibles-tab/collectibles-tab.test.js +++ b/ui/components/app/collectibles-tab/collectibles-tab.test.js @@ -137,8 +137,8 @@ const COLLECTIBLES_CONTRACTS = [ ]; const collectiblesDropdownState = { - 0x495f947276749ce646f68ac8c248420045cb7b5e: true, - 0xdc7382eb0bc9c352a4cba23c909bda01e0206414: true, + '0x495f947276749ce646f68ac8c248420045cb7b5e': true, + '0xdc7382eb0bc9c352a4cba23c909bda01e0206414': true, }; const ACCOUNT_1 = '0x123'; @@ -182,10 +182,12 @@ describe('Collectible Items', () => { const checkAndUpdateAllCollectiblesOwnershipStatusStub = jest.fn(); const updateCollectibleDropDownStateStub = jest.fn(); setBackgroundConnection({ - setCollectiblesDetectionNoticeDismissed: setCollectiblesDetectionNoticeDismissedStub, + setCollectiblesDetectionNoticeDismissed: + setCollectiblesDetectionNoticeDismissedStub, detectCollectibles: detectCollectiblesStub, getState: getStateStub, - checkAndUpdateAllCollectiblesOwnershipStatus: checkAndUpdateAllCollectiblesOwnershipStatusStub, + checkAndUpdateAllCollectiblesOwnershipStatus: + checkAndUpdateAllCollectiblesOwnershipStatusStub, updateCollectibleDropDownState: updateCollectibleDropDownStateStub, }); const historyPushMock = jest.fn(); @@ -214,14 +216,16 @@ describe('Collectible Items', () => { }); expect(screen.queryByText('New! NFT detection')).not.toBeInTheDocument(); }); - it('should take user to the experimental settings tab in setings when user clicks "Turn on NFT detection in Settings"', () => { + it('should take user to the experimental settings tab in settings when user clicks "Turn on NFT detection in Settings"', () => { render({ selectedAddress: ACCOUNT_2, collectibles: COLLECTIBLES, }); fireEvent.click(screen.queryByText('Turn on NFT detection in Settings')); expect(historyPushMock).toHaveBeenCalledTimes(1); - expect(historyPushMock).toHaveBeenCalledWith(EXPERIMENTAL_ROUTE); + expect(historyPushMock).toHaveBeenCalledWith( + `${EXPERIMENTAL_ROUTE}#autodetect-nfts`, + ); }); it('should not render the Collectibles Detection Notice when currently selected network is Mainnet and currently selected account has no collectibles but use collectible autodetection preference is set to true', () => { render({ @@ -309,13 +313,13 @@ describe('Collectible Items', () => { ).toHaveBeenCalled(); }); - it('should render a link "Enable Autodetect" when some collectibles are present and collectible auto-detection preference is set to false, which, when clicked sends user to the experimental tab of settings', () => { + it('should render a link "Enable autodetect" when some collectibles are present and collectible auto-detection preference is set to false, which, when clicked sends user to the experimental tab of settings', () => { render({ selectedAddress: ACCOUNT_1, collectibles: COLLECTIBLES, }); expect(historyPushMock).toHaveBeenCalledTimes(0); - fireEvent.click(screen.queryByText('Enable Autodetect')); + fireEvent.click(screen.queryByText('Enable autodetect')); expect(historyPushMock).toHaveBeenCalledTimes(1); expect(historyPushMock).toHaveBeenCalledWith(EXPERIMENTAL_ROUTE); }); diff --git a/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.test.js b/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.test.js index aec9b8ca2..65ef0e606 100644 --- a/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.test.js +++ b/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.test.js @@ -70,7 +70,7 @@ describe('Confirm Page Container Content', () => { expect(queryByText('I want to proceed anyway')).not.toBeInTheDocument(); expect(getByText('Confirm').closest('button')).toBeDisabled(); expect( - getByText('Transaction Error. Exception thrown in contract code.'), + getByText('Transaction error. Exception thrown in contract code.'), ).toBeInTheDocument(); const cancelButton = getByText('Reject'); @@ -91,7 +91,7 @@ describe('Confirm Page Container Content', () => { ), ).not.toBeInTheDocument(); expect( - queryByText('Transaction Error. Exception thrown in contract code.'), + queryByText('Transaction error. Exception thrown in contract code.'), ).not.toBeInTheDocument(); expect(queryByText('I want to proceed anyway')).not.toBeInTheDocument(); diff --git a/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.component.js b/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.component.js index e31e81bce..442329497 100644 --- a/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.component.js +++ b/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.component.js @@ -42,9 +42,8 @@ const ConfirmPageContainerSummary = (props) => { TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM, TRANSACTION_TYPES.TOKEN_METHOD_SAFE_TRANSFER_FROM, ]; - const isContractTypeTransaction = contractInitiatedTransactionType.includes( - transactionType, - ); + const isContractTypeTransaction = + contractInitiatedTransactionType.includes(transactionType); let contractAddress; if (isContractTypeTransaction) { // If the transaction is TOKEN_METHOD_TRANSFER or TOKEN_METHOD_TRANSFER_FROM diff --git a/ui/components/app/confirm-page-container/confirm-page-container.component.js b/ui/components/app/confirm-page-container/confirm-page-container.component.js index 82d6d2c41..8816d2e90 100644 --- a/ui/components/app/confirm-page-container/confirm-page-container.component.js +++ b/ui/components/app/confirm-page-container/confirm-page-container.component.js @@ -169,6 +169,10 @@ export default class ConfirmPageContainer extends Component { const networkName = NETWORK_TO_NAME_MAP[currentTransaction.chainId] || networkIdentifier; + const isSetApproveForAll = + currentTransaction.type === + TRANSACTION_TYPES.TOKEN_METHOD_SET_APPROVAL_FOR_ALL; + const { t } = this.context; return ( @@ -302,12 +306,20 @@ export default class ConfirmPageContainer extends Component { )} + {isSetApproveForAll && ( + + {t('confirmPageDialogSetApprovalForAll')} + + )} {contentComponent && ( {unapprovedTxCount > 1 && ( diff --git a/ui/components/app/confirm-page-container/enableEIP1559V2-notice/enableEIP1559V2-notice.js b/ui/components/app/confirm-page-container/enableEIP1559V2-notice/enableEIP1559V2-notice.js index b9019424e..a0d33a151 100644 --- a/ui/components/app/confirm-page-container/enableEIP1559V2-notice/enableEIP1559V2-notice.js +++ b/ui/components/app/confirm-page-container/enableEIP1559V2-notice/enableEIP1559V2-notice.js @@ -34,7 +34,9 @@ export default function EnableEIP1559V2Notice({ isFirstAlert }) { return ( diff --git a/ui/components/app/confirm-page-container/index.scss b/ui/components/app/confirm-page-container/index.scss index 20aa1d94f..ca3e12aa7 100644 --- a/ui/components/app/confirm-page-container/index.scss +++ b/ui/components/app/confirm-page-container/index.scss @@ -3,6 +3,12 @@ @import 'confirm-detail-row/index'; @import 'confirm-page-container-navigation/index'; +.confirm-page-container { + &__dialog { + margin: 12px 16px; + } +} + .page-container { &__content-component-wrapper { height: 100%; diff --git a/ui/components/app/connected-accounts-list/connected-accounts-list.component.js b/ui/components/app/connected-accounts-list/connected-accounts-list.component.js index 20d4cdf91..ee5945600 100644 --- a/ui/components/app/connected-accounts-list/connected-accounts-list.component.js +++ b/ui/components/app/connected-accounts-list/connected-accounts-list.component.js @@ -125,11 +125,8 @@ export default class ConnectedAccountsList extends PureComponent { } render() { - const { - connectedAccounts, - selectedAddress, - shouldRenderListOptions, - } = this.props; + const { connectedAccounts, selectedAddress, shouldRenderListOptions } = + this.props; const { t } = this.context; return ( diff --git a/ui/components/app/connected-accounts-permissions/connected-accounts-permissions.js b/ui/components/app/connected-accounts-permissions/connected-accounts-permissions.js index dce984c47..8d7ae1bde 100644 --- a/ui/components/app/connected-accounts-permissions/connected-accounts-permissions.js +++ b/ui/components/app/connected-accounts-permissions/connected-accounts-permissions.js @@ -36,7 +36,8 @@ const ConnectedAccountsPermissions = ({ permissions }) => { className={classnames( 'connected-accounts-permissions__list-container', { - 'connected-accounts-permissions__list-container--expanded': expanded, + 'connected-accounts-permissions__list-container--expanded': + expanded, }, )} > diff --git a/ui/components/app/connected-sites-list/connected-sites-list.component.js b/ui/components/app/connected-sites-list/connected-sites-list.component.js index 7b23820c0..00372f64e 100644 --- a/ui/components/app/connected-sites-list/connected-sites-list.component.js +++ b/ui/components/app/connected-sites-list/connected-sites-list.component.js @@ -33,7 +33,12 @@ export default class ConnectedSitesList extends Component { className="connected-sites-list__content-row" >
- + { - const store = configureMockStore([])({ metamask: {} }); + const store = configureMockStore([])({ + metamask: { provider: { chainId: '0x0' } }, + }); describe('given searchForContacts', () => { const selectRecipient = () => null; diff --git a/ui/components/app/contact-list/recipient-group/recipient-group.component.js b/ui/components/app/contact-list/recipient-group/recipient-group.component.js index a8fd589db..9edd49a3c 100644 --- a/ui/components/app/contact-list/recipient-group/recipient-group.component.js +++ b/ui/components/app/contact-list/recipient-group/recipient-group.component.js @@ -37,10 +37,8 @@ export default function RecipientGroup({ address, selectedAddress, ), - 'send__select-recipient-wrapper__group-item--selected': addressesEqual( - address, - selectedAddress, - ), + 'send__select-recipient-wrapper__group-item--selected': + addressesEqual(address, selectedAddress), })} > diff --git a/ui/components/app/create-new-vault/create-new-vault.js b/ui/components/app/create-new-vault/create-new-vault.js index 126854308..f27e1a6e8 100644 --- a/ui/components/app/create-new-vault/create-new-vault.js +++ b/ui/components/app/create-new-vault/create-new-vault.js @@ -1,8 +1,6 @@ -import React, { useCallback, useContext, useState } from 'react'; +import React, { useCallback, useState } from 'react'; import PropTypes from 'prop-types'; -import { EVENT } from '../../../../shared/constants/metametrics'; import { useI18nContext } from '../../../hooks/useI18nContext'; -import { MetaMetricsContext } from '../../../contexts/metametrics'; import TextField from '../../ui/text-field'; import Button from '../../ui/button'; import CheckBox from '../../ui/check-box'; @@ -23,7 +21,6 @@ export default function CreateNewVault({ const [termsChecked, setTermsChecked] = useState(false); const t = useI18nContext(); - const trackEvent = useContext(MetaMetricsContext); const onPasswordChange = useCallback( (newPassword) => { @@ -83,17 +80,8 @@ export default function CreateNewVault({ ); const toggleTermsCheck = useCallback(() => { - trackEvent({ - category: EVENT.CATEGORIES.ONBOARDING, - event: 'Check ToS', - properties: { - action: 'Import Seed Phrase', - legacy_event: true, - }, - }); - setTermsChecked((currentTermsChecked) => !currentTermsChecked); - }, [trackEvent]); + }, []); const termsOfUse = t('acceptTermsOfUse', [ - {termsOfUse} + {termsOfUse}
) : null} diff --git a/ui/components/app/detected-token/detected-token-address/detected-token-address.js b/ui/components/app/detected-token/detected-token-address/detected-token-address.js index 3c4f012de..8002bf743 100644 --- a/ui/components/app/detected-token/detected-token-address/detected-token-address.js +++ b/ui/components/app/detected-token/detected-token-address/detected-token-address.js @@ -29,7 +29,8 @@ const DetectedTokenAddress = ({ tokenAddress }) => { {shortenAddress(tokenAddress)} diff --git a/ui/components/app/detected-token/detected-token-details/detected-token-details.test.js b/ui/components/app/detected-token/detected-token-details/detected-token-details.test.js index 559c568bc..456633317 100644 --- a/ui/components/app/detected-token/detected-token-details/detected-token-details.test.js +++ b/ui/components/app/detected-token/detected-token-details/detected-token-details.test.js @@ -33,7 +33,7 @@ describe('DetectedTokenDetails', () => { }, handleTokenSelection: jest.fn(), tokensListDetected: { - 0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f: { + '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f': { token: { name: 'Synthetix Network', address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', @@ -58,7 +58,7 @@ describe('DetectedTokenDetails', () => { }, selected: true, }, - 0x514910771af9ca656af840dff83e8264ecf986ca: { + '0x514910771af9ca656af840dff83e8264ecf986ca': { token: { name: 'ChainLink Token', address: '0x514910771af9ca656af840dff83e8264ecf986ca', diff --git a/ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.js b/ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.js index 25777ed49..341578415 100644 --- a/ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.js +++ b/ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.js @@ -1,5 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; +import classNames from 'classnames'; import { useI18nContext } from '../../../../hooks/useI18nContext'; import Popover from '../../../ui/popover'; @@ -8,6 +9,7 @@ import Typography from '../../../ui/typography/typography'; import { TYPOGRAPHY } from '../../../../helpers/constants/design-system'; const DetectedTokenIgnoredPopover = ({ + partiallyIgnoreDetectedTokens, onCancelIgnore, handleClearTokensSelection, }) => { @@ -34,22 +36,36 @@ const DetectedTokenIgnoredPopover = ({ return ( - {t('ignoreTokenWarning')} + {partiallyIgnoreDetectedTokens + ? t('importSelectedTokensDescription') + : t('ignoreTokenWarning')} ); }; DetectedTokenIgnoredPopover.propTypes = { + partiallyIgnoreDetectedTokens: PropTypes.bool.isRequired, onCancelIgnore: PropTypes.func.isRequired, handleClearTokensSelection: PropTypes.func.isRequired, }; diff --git a/ui/components/app/detected-token/detected-token-ignored-popover/index.scss b/ui/components/app/detected-token/detected-token-ignored-popover/index.scss index 64e0d90bd..69fa05637 100644 --- a/ui/components/app/detected-token/detected-token-ignored-popover/index.scss +++ b/ui/components/app/detected-token/detected-token-ignored-popover/index.scss @@ -7,7 +7,15 @@ margin-inline-start: 8px; } - .popover-header { - margin-inline-start: 85px; + &--ignore { + .popover-header { + margin-inline-start: 85px; + } + } + + &--import { + .popover-header { + margin-inline-start: 50px; + } } } diff --git a/ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.js b/ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.js index afabb4ead..a72664086 100644 --- a/ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.js +++ b/ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.js @@ -27,9 +27,8 @@ const DetectedTokenSelectionPopover = ({ const trackEvent = useContext(MetaMetricsContext); const detectedTokens = useSelector(getDetectedTokensInCurrentNetwork); - const { selected: selectedTokens = [] } = sortingBasedOnTokenSelection( - tokensListDetected, - ); + const { selected: selectedTokens = [] } = + sortingBasedOnTokenSelection(tokensListDetected); const numOfTokensImporting = selectedTokens.length === detectedTokens.length ? `All` @@ -72,7 +71,11 @@ const DetectedTokenSelectionPopover = ({ return ( diff --git a/ui/components/app/detected-token/detected-token.js b/ui/components/app/detected-token/detected-token.js index 0bfede9d1..5031f218e 100644 --- a/ui/components/app/detected-token/detected-token.js +++ b/ui/components/app/detected-token/detected-token.js @@ -4,15 +4,17 @@ import { useSelector, useDispatch } from 'react-redux'; import { chain } from 'lodash'; import { - importTokens, + addImportedTokens, ignoreTokens, setNewTokensImported, } from '../../../store/actions'; import { getDetectedTokensInCurrentNetwork } from '../../../selectors'; import { MetaMetricsContext } from '../../../contexts/metametrics'; -import { TOKEN_STANDARDS } from '../../../helpers/constants/common'; -import { ASSET_TYPES } from '../../../../shared/constants/transaction'; +import { + ASSET_TYPES, + TOKEN_STANDARDS, +} from '../../../../shared/constants/transaction'; import { EVENT, EVENT_NAMES } from '../../../../shared/constants/metametrics'; import DetectedTokenSelectionPopover from './detected-token-selection-popover/detected-token-selection-popover'; import DetectedTokenIgnoredPopover from './detected-token-ignored-popover/detected-token-ignored-popover'; @@ -25,7 +27,12 @@ const sortingBasedOnTokenSelection = (tokensDetected) => { // create a new object with keys 'selected', 'deselected' and group the tokens .groupBy((token) => (token.selected ? 'selected' : 'deselected')) // ditch the 'selected' property and get just the tokens' - .mapValues((group) => group.map(({ token }) => token)) + .mapValues((group) => + group.map(({ token }) => { + const { address, symbol, decimals, aggregators } = token; + return { address, symbol, decimals, aggregators }; + }), + ) // Exit the chain and get the underlying value, an object. .value() ); @@ -43,10 +50,10 @@ const DetectedToken = ({ setShowDetectedTokens }) => { return tokenObj; }, {}), ); - const [ - showDetectedTokenIgnoredPopover, - setShowDetectedTokenIgnoredPopover, - ] = useState(false); + const [showDetectedTokenIgnoredPopover, setShowDetectedTokenIgnoredPopover] = + useState(false); + const [partiallyIgnoreDetectedTokens, setPartiallyIgnoreDetectedTokens] = + useState(false); const importSelectedTokens = async (selectedTokens) => { selectedTokens.forEach((importedToken) => { @@ -63,16 +70,14 @@ const DetectedToken = ({ setShowDetectedTokens }) => { }, }); }); - await dispatch(importTokens(selectedTokens)); + await dispatch(addImportedTokens(selectedTokens)); const tokenSymbols = selectedTokens.map(({ symbol }) => symbol); dispatch(setNewTokensImported(tokenSymbols.join(', '))); }; const handleClearTokensSelection = async () => { - const { - selected: selectedTokens = [], - deselected: deSelectedTokens = [], - } = sortingBasedOnTokenSelection(tokensListDetected); + const { selected: selectedTokens = [], deselected: deSelectedTokens = [] } = + sortingBasedOnTokenSelection(tokensListDetected); if (deSelectedTokens.length < detectedTokens.length) { await importSelectedTokens(selectedTokens); @@ -90,8 +95,17 @@ const DetectedToken = ({ setShowDetectedTokens }) => { asset_type: ASSET_TYPES.TOKEN, }, }); - await dispatch(ignoreTokens(deSelectedTokens)); + const deSelectedTokensAddresses = deSelectedTokens.map( + ({ address }) => address, + ); + await dispatch( + ignoreTokens({ + tokensToIgnore: deSelectedTokensAddresses, + dontShowLoadingIndicator: true, + }), + ); setShowDetectedTokens(false); + setPartiallyIgnoreDetectedTokens(false); }; const handleTokenSelection = (token) => { @@ -105,12 +119,12 @@ const DetectedToken = ({ setShowDetectedTokens }) => { }; const onImport = async () => { - const { selected: selectedTokens = [] } = sortingBasedOnTokenSelection( - tokensListDetected, - ); + const { selected: selectedTokens = [] } = + sortingBasedOnTokenSelection(tokensListDetected); if (selectedTokens.length < detectedTokens.length) { setShowDetectedTokenIgnoredPopover(true); + setPartiallyIgnoreDetectedTokens(true); } else { await importSelectedTokens(selectedTokens); setShowDetectedTokens(false); @@ -129,6 +143,7 @@ const DetectedToken = ({ setShowDetectedTokens }) => { const onCancelIgnore = () => { setShowDetectedTokenIgnoredPopover(false); + setPartiallyIgnoreDetectedTokens(false); }; return ( @@ -137,6 +152,7 @@ const DetectedToken = ({ setShowDetectedTokens }) => { )} { const { classList } = event.target; const isInClassList = (className) => classList.contains(className); - const notToggleElementIndex = notToggleElementClassnames.findIndex( - isInClassList, - ); + const notToggleElementIndex = + notToggleElementClassnames.findIndex(isInClassList); if (notToggleElementIndex === -1) { event.stopPropagation(); diff --git a/ui/components/app/dropdowns/network-dropdown.test.js b/ui/components/app/dropdowns/network-dropdown.test.js index 5067988ca..2d4d5a3dc 100644 --- a/ui/components/app/dropdowns/network-dropdown.test.js +++ b/ui/components/app/dropdowns/network-dropdown.test.js @@ -1,15 +1,12 @@ import React from 'react'; import configureMockStore from 'redux-mock-store'; import thunk from 'redux-thunk'; -import Button from '../../ui/button'; -import { mountWithRouter } from '../../../../test/lib/render-helpers'; -import ColorIndicator from '../../ui/color-indicator'; +import { screen } from '@testing-library/react'; +import { renderWithProvider } from '../../../../test/lib/render-helpers'; import { LOCALHOST_RPC_URL } from '../../../../shared/constants/network'; import NetworkDropdown from './network-dropdown'; -import { DropdownMenuItem } from './dropdown'; describe('Network Dropdown', () => { - let wrapper; const createMockStore = configureMockStore([thunk]); describe('NetworkDropdown in appState in false', () => { @@ -32,15 +29,17 @@ describe('Network Dropdown', () => { const store = createMockStore(mockState); beforeEach(() => { - wrapper = mountWithRouter(); + renderWithProvider(, store); }); - it('checks for network droppo class', () => { - expect(wrapper.find('.network-droppo')).toHaveLength(1); + it('should not render menu dropdown when network dropdown is in false state', () => { + const menuDropdown = screen.queryByTestId('menu-dropdown'); + expect(menuDropdown).not.toBeInTheDocument(); }); - it('renders only one child when networkDropdown is false in state', () => { - expect(wrapper.children()).toHaveLength(1); + it('checks for network droppo class', () => { + const networkDropdown = screen.queryByTestId('network-droppo'); + expect(networkDropdown).toBeInTheDocument(); }); }); @@ -72,82 +71,52 @@ describe('Network Dropdown', () => { const store = createMockStore(mockState); - let testNetworkIndex = 1; - - const findTestNetworkFirstIndex = (_wrapper) => { - let i = 1; - let found = false; - while (!found) { - if ( - _wrapper.find(ColorIndicator).at(i).prop('color') === 'icon-muted' - ) { - i += 1; - } else { - found = true; - } - } - - testNetworkIndex = i; - }; - - beforeAll(() => { - wrapper = mountWithRouter(); - findTestNetworkFirstIndex(wrapper); + beforeEach(() => { + renderWithProvider(, store); }); it('checks background color for first ColorIndicator', () => { - const colorIndicator = wrapper.find(ColorIndicator).at(0); - expect(colorIndicator.prop('color')).toStrictEqual('mainnet'); + const mainnetColorIndicator = screen.queryByTestId('color-icon-mainnet'); + expect(mainnetColorIndicator).toBeInTheDocument(); }); it('checks background color for second ColorIndicator', () => { // find where test networks start in case there are custom RPCs - const colorIndicator = wrapper.find(ColorIndicator).at(testNetworkIndex); - expect(colorIndicator.prop('color')).toStrictEqual('ropsten'); + const ropstenColorIndicator = screen.queryByTestId('color-icon-ropsten'); + expect(ropstenColorIndicator).toBeInTheDocument(); }); it('checks background color for third ColorIndicator', () => { - const colorIndicator = wrapper - .find(ColorIndicator) - .at(testNetworkIndex + 1); - expect(colorIndicator.prop('color')).toStrictEqual('kovan'); + const kovanColorIndicator = screen.queryByTestId('color-icon-kovan'); + expect(kovanColorIndicator).toBeInTheDocument(); }); it('checks background color for fourth ColorIndicator', () => { - const colorIndicator = wrapper - .find(ColorIndicator) - .at(testNetworkIndex + 2); - expect(colorIndicator.prop('color')).toStrictEqual('rinkeby'); + const rinkebyColorIndicator = screen.queryByTestId('color-icon-rinkeby'); + expect(rinkebyColorIndicator).toBeInTheDocument(); }); it('checks background color for fifth ColorIndicator', () => { - const colorIndicator = wrapper - .find(ColorIndicator) - .at(testNetworkIndex + 3); - expect(colorIndicator.prop('color')).toStrictEqual('goerli'); + const goerliColorIndicator = screen.queryByTestId('color-icon-goerli'); + expect(goerliColorIndicator).toBeInTheDocument(); }); it('checks background color for sixth ColorIndicator', () => { - const colorIndicator = wrapper - .find(ColorIndicator) - .at(testNetworkIndex + 4); - expect(colorIndicator.prop('color')).toStrictEqual('localhost'); - expect( - wrapper - .find(DropdownMenuItem) - .at(testNetworkIndex + 4) - .text(), - ).toStrictEqual('✓localhost'); + const localhostColorIndicator = screen.queryByTestId( + 'color-icon-localhost', + ); + expect(localhostColorIndicator).toBeInTheDocument(); }); it('checks that Add Network button is rendered', () => { - expect(wrapper.find(Button).at(0).children().text()).toStrictEqual( - 'addNetwork', - ); + const addNetworkButton = screen.queryByText('Add network'); + expect(addNetworkButton).toBeInTheDocument(); }); it('shows test networks in the dropdown', () => { - expect(wrapper.find('.network-dropdown-list li')).toHaveLength(8); + const networkItems = screen.queryAllByTestId(/network-item/u); + + expect(networkItems).toHaveLength(8); }); }); @@ -178,26 +147,24 @@ describe('Network Dropdown', () => { const store = createMockStore(mockState); - beforeAll(() => { - wrapper = mountWithRouter(); + beforeEach(() => { + renderWithProvider(, store); }); it('checks background color for first ColorIndicator', () => { - const colorIndicator = wrapper.find(ColorIndicator).at(0); - expect(colorIndicator.prop('color')).toStrictEqual('mainnet'); - expect(wrapper.find(DropdownMenuItem).at(0).text()).toStrictEqual( - '✓mainnet', - ); + const mainnetColorIndicator = screen.queryByTestId('color-icon-mainnet'); + expect(mainnetColorIndicator).toBeInTheDocument(); }); it('checks that Add Network button is rendered', () => { - expect(wrapper.find(Button).at(0).children().text()).toStrictEqual( - 'addNetwork', - ); + const addNetworkButton = screen.queryByText('Add network'); + expect(addNetworkButton).toBeInTheDocument(); }); it('does not show test networks in the dropdown', () => { - expect(wrapper.find('.network-dropdown-list li')).toHaveLength(3); + const networkItems = screen.queryAllByTestId(/network-item/u); + + expect(networkItems).toHaveLength(3); }); }); }); diff --git a/ui/components/app/edit-gas-display-education/edit-gas-display-education.component.js b/ui/components/app/edit-gas-display-education/edit-gas-display-education.component.js index 0433f9a10..2287f07e9 100644 --- a/ui/components/app/edit-gas-display-education/edit-gas-display-education.component.js +++ b/ui/components/app/edit-gas-display-education/edit-gas-display-education.component.js @@ -15,7 +15,7 @@ export default function EditGasDisplayEducation() { return (
@@ -29,7 +29,7 @@ export default function EditGasDisplayEducation() { {t('editGasHigh')} @@ -43,7 +43,7 @@ export default function EditGasDisplayEducation() { {t('editGasMedium')} @@ -57,7 +57,7 @@ export default function EditGasDisplayEducation() { {t('editGasLow')} diff --git a/ui/components/app/edit-gas-display/edit-gas-display.component.js b/ui/components/app/edit-gas-display/edit-gas-display.component.js index 2025ee30a..c81abab58 100644 --- a/ui/components/app/edit-gas-display/edit-gas-display.component.js +++ b/ui/components/app/edit-gas-display/edit-gas-display.component.js @@ -99,9 +99,8 @@ export default function EditGasDisplay({ } }, [showAdvancedForm]); - const dappSuggestedAndTxParamGasFeesAreTheSame = areDappSuggestedAndTxParamGasFeesTheSame( - transaction, - ); + const dappSuggestedAndTxParamGasFeesAreTheSame = + areDappSuggestedAndTxParamGasFeesTheSame(transaction); const requireDappAcknowledgement = Boolean( transaction?.dappSuggestedGasFees && @@ -197,17 +196,13 @@ export default function EditGasDisplay({ supportsEIP1559 && estimatedMaximumFiat !== undefined && ( <> - + {t('editGasSubTextFeeLabel')} - + {estimatedMaximumFiat} - + {`(${estimatedMaximumNative})`} @@ -280,7 +275,7 @@ export default function EditGasDisplay({ onClick={() => { setShowAdvancedForm(!showAdvancedForm); trackEvent({ - event: 'Clicked "Advanced Options"', + event: 'Clicked "Advanced options"', category: EVENT.CATEGORIES.TRANSACTIONS, properties: { action: 'Edit Screen', diff --git a/ui/components/app/edit-gas-fee-popover/edit-gas-fee-popover.js b/ui/components/app/edit-gas-fee-popover/edit-gas-fee-popover.js index 0eade1419..7e38471a5 100644 --- a/ui/components/app/edit-gas-fee-popover/edit-gas-fee-popover.js +++ b/ui/components/app/edit-gas-fee-popover/edit-gas-fee-popover.js @@ -8,7 +8,6 @@ import { useI18nContext } from '../../../hooks/useI18nContext'; import { useTransactionModalContext } from '../../../contexts/transaction-modal'; import Box from '../../ui/box'; import ErrorMessage from '../../ui/error-message'; -import I18nValue from '../../ui/i18n-value'; import Popover from '../../ui/popover'; import Typography from '../../ui/typography/typography'; @@ -16,18 +15,15 @@ import { COLORS, TYPOGRAPHY } from '../../../helpers/constants/design-system'; import { INSUFFICIENT_FUNDS_ERROR_KEY } from '../../../helpers/constants/error-keys'; import { useGasFeeContext } from '../../../contexts/gasFee'; import AppLoadingSpinner from '../app-loading-spinner'; +import ZENDESK_URLS from '../../../helpers/constants/zendesk-url'; import EditGasItem from './edit-gas-item'; import NetworkStatistics from './network-statistics'; const EditGasFeePopover = () => { const { balanceError, editGasMode } = useGasFeeContext(); const t = useI18nContext(); - const { - closeAllModals, - closeModal, - currentModal, - openModalCount, - } = useTransactionModalContext(); + const { closeAllModals, closeModal, currentModal, openModalCount } = + useTransactionModalContext(); if (currentModal !== 'editGasFee') { return null; @@ -60,15 +56,13 @@ const EditGasFeePopover = () => { )}
- + {t('gasOption')} - {editGasMode !== EDIT_GAS_MODES.SWAPS && ( - - )} + {editGasMode !== EDIT_GAS_MODES.SWAPS && t('time')} - + {t('maxFee')}
{(editGasMode === EDIT_GAS_MODES.CANCEL || @@ -97,19 +91,16 @@ const EditGasFeePopover = () => { tag={TYPOGRAPHY.Paragraph} variant={TYPOGRAPHY.H7} > - - -
, - ]} - /> + {t('learmMoreAboutGas', [ + + {t('learnMore')} + , + ])}
diff --git a/ui/components/app/edit-gas-fee-popover/edit-gas-item/edit-gas-item.js b/ui/components/app/edit-gas-fee-popover/edit-gas-item/edit-gas-item.js index e8ffe93e1..e3fbc9eb9 100644 --- a/ui/components/app/edit-gas-fee-popover/edit-gas-item/edit-gas-item.js +++ b/ui/components/app/edit-gas-fee-popover/edit-gas-item/edit-gas-item.js @@ -13,7 +13,6 @@ import { useGasFeeContext } from '../../../../contexts/gasFee'; import { useI18nContext } from '../../../../hooks/useI18nContext'; import { useTransactionEventFragment } from '../../../../hooks/useTransactionEventFragment'; import { useTransactionModalContext } from '../../../../contexts/transaction-modal'; -import I18nValue from '../../../ui/i18n-value'; import InfoTooltip from '../../../ui/info-tooltip'; import LoadingHeartBeat from '../../../ui/loading-heartbeat'; import UserPreferencedCurrencyDisplay from '../../user-preferenced-currency-display'; @@ -121,7 +120,7 @@ const EditGasItem = ({ priorityLevel }) => { {PRIORITY_LEVEL_ICON_MAP[icon]} )} - + {t(title)} { maxPriorityFeePerGas: maxPriorityFeePerGasValue, transaction, } = useGasFeeContext(); - const [estimateGreaterThanGasUse, setEstimateGreaterThanGasUse] = useState( - false, - ); + const [estimateGreaterThanGasUse, setEstimateGreaterThanGasUse] = + useState(false); const advancedGasFeeValues = useSelector(getAdvancedGasFeeValues); let maxFeePerGas; diff --git a/ui/components/app/edit-gas-fee-popover/network-statistics/network-statistics.js b/ui/components/app/edit-gas-fee-popover/network-statistics/network-statistics.js index 548490b2e..e10816447 100644 --- a/ui/components/app/edit-gas-fee-popover/network-statistics/network-statistics.js +++ b/ui/components/app/edit-gas-fee-popover/network-statistics/network-statistics.js @@ -32,7 +32,8 @@ const NetworkStatistics = () => { {t('networkStatus')} diff --git a/ui/components/app/edit-gas-fee-popover/network-statistics/status-slider/status-slider.js b/ui/components/app/edit-gas-fee-popover/network-statistics/status-slider/status-slider.js index 13987af3b..35889b687 100644 --- a/ui/components/app/edit-gas-fee-popover/network-statistics/status-slider/status-slider.js +++ b/ui/components/app/edit-gas-fee-popover/network-statistics/status-slider/status-slider.js @@ -2,7 +2,7 @@ import React from 'react'; import { NETWORK_CONGESTION_THRESHOLDS } from '../../../../../../shared/constants/gas'; import { useGasFeeContext } from '../../../../../contexts/gasFee'; -import I18nValue from '../../../../ui/i18n-value'; +import { useI18nContext } from '../../../../../hooks/useI18nContext'; import { NetworkStabilityTooltip } from '../tooltips'; const GRADIENT_COLORS = [ @@ -49,6 +49,7 @@ const determineStatusInfo = (givenNetworkCongestion) => { }; const StatusSlider = () => { + const t = useI18nContext(); const { gasFeeEstimates } = useGasFeeContext(); const statusInfo = determineStatusInfo(gasFeeEstimates.networkCongestion); @@ -81,7 +82,7 @@ const StatusSlider = () => { style={{ color: statusInfo.color }} data-testid="status-slider-label" > - + {t(statusInfo.statusLabel)} diff --git a/ui/components/app/edit-gas-popover/edit-gas-popover.component.js b/ui/components/app/edit-gas-popover/edit-gas-popover.component.js index 9d8ca4ac1..cf4c21301 100644 --- a/ui/components/app/edit-gas-popover/edit-gas-popover.component.js +++ b/ui/components/app/edit-gas-popover/edit-gas-popover.component.js @@ -63,10 +63,8 @@ export default function EditGasPopover({ supportsEIP1559; const [showEducationContent, setShowEducationContent] = useState(false); - const [ - dappSuggestedGasFeeAcknowledged, - setDappSuggestedGasFeeAcknowledged, - ] = useState(false); + const [dappSuggestedGasFeeAcknowledged, setDappSuggestedGasFeeAcknowledged] = + useState(false); const minimumGasLimitDec = hexToDecimal(minimumGasLimit); const updatedCustomGasSettings = useIncrementedGasFees(transaction); diff --git a/ui/components/app/edit-gas-popover/index.scss b/ui/components/app/edit-gas-popover/index.scss index a3fe4b5d9..e81e9d382 100644 --- a/ui/components/app/edit-gas-popover/index.scss +++ b/ui/components/app/edit-gas-popover/index.scss @@ -1,6 +1,6 @@ .edit-gas-popover { &__wrapper { - @media screen and (min-width: $break-large) { + @include screen-sm-min { max-height: 84vh; } } diff --git a/ui/components/app/flask/experimental-area/experimental-area.js b/ui/components/app/flask/experimental-area/experimental-area.js index 15160c395..b6b05f5da 100644 --- a/ui/components/app/flask/experimental-area/experimental-area.js +++ b/ui/components/app/flask/experimental-area/experimental-area.js @@ -15,7 +15,8 @@ function lineBreaksToBr(source) { }); } -const METAMASK_LOGO = lineBreaksToBr(`MMm*mmMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMmm*mMM +const METAMASK_LOGO = + lineBreaksToBr(`MMm*mmMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMmm*mMM MM*./***mMMMMMMMMMMMMMMMMMMMMMMMMMMm***/.*MM MM/...///*mMMMMMMMMMMMMMMMMMMMMMMm*///.../MM Mm.....//../*mMMMMMMMMMMMMMMMMm*/..//.....mM @@ -57,7 +58,8 @@ MMMMMMMMMMMMMMMMMm/....../mMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMmmmmmmmmMMMMMMMMMMMMMMMMMM`); /* eslint-disable no-irregular-whitespace */ -const EXPERIMENTAL_AREA = lineBreaksToBr(`█▄█ █▀█ █░█ ▀ █▀█ █▀▀   █▀▀ █▄░█ ▀█▀ █▀▀ █▀█ █ █▄░█ █▀▀   ▄▀█ █▄░█ +const EXPERIMENTAL_AREA = + lineBreaksToBr(`█▄█ █▀█ █░█ ▀ █▀█ █▀▀   █▀▀ █▄░█ ▀█▀ █▀▀ █▀█ █ █▄░█ █▀▀   ▄▀█ █▄░█ ░█░ █▄█ █▄█ ░ █▀▄ ██▄   ██▄ █░▀█ ░█░ ██▄ █▀▄ █ █░▀█ █▄█   █▀█ █░▀█ █▀▀ ▀▄▀ █▀█ █▀▀ █▀█ █ █▀▄▀█ █▀▀ █▄░█ ▀█▀ ▄▀█ █░░   ▄▀█ █▀█ █▀▀ ▄▀█ diff --git a/ui/components/app/flask/snap-install-warning/index.scss b/ui/components/app/flask/snap-install-warning/index.scss index 53f5ed74b..bc7d078bd 100644 --- a/ui/components/app/flask/snap-install-warning/index.scss +++ b/ui/components/app/flask/snap-install-warning/index.scss @@ -5,6 +5,11 @@ display: flex; align-items: flex-start; gap: 0 16px; + margin-top: 16px; + + &--first { + margin-top: 0; + } } &__footer { diff --git a/ui/components/app/flask/snap-install-warning/snap-install-warning.js b/ui/components/app/flask/snap-install-warning/snap-install-warning.js index 942ee2c25..a4957b2e2 100644 --- a/ui/components/app/flask/snap-install-warning/snap-install-warning.js +++ b/ui/components/app/flask/snap-install-warning/snap-install-warning.js @@ -1,5 +1,7 @@ -import React, { useCallback, useState } from 'react'; +import React, { useCallback, useReducer } from 'react'; import PropTypes from 'prop-types'; +import { produce } from 'immer'; +import classnames from 'classnames'; import { useI18nContext } from '../../../../hooks/useI18nContext'; import CheckBox from '../../../ui/check-box/check-box.component'; import Typography from '../../../ui/typography/typography'; @@ -7,14 +9,34 @@ import { TYPOGRAPHY } from '../../../../helpers/constants/design-system'; import Popover from '../../../ui/popover'; import Button from '../../../ui/button'; -export default function SnapInstallWarning({ onCancel, onSubmit, snapName }) { +/** + * a very simple reducer using produce from Immer to keep checkboxes state manipulation + * immutable and painless. + */ +const checkboxStateReducer = produce((state, action) => { + switch (action.type) { + case 'check': + state[action.checkboxId] = state[action.checkboxId] + ? !state[action.checkboxId] + : true; + + break; + default: + throw new Error( + 'You must provide a type when dispatching an action for checkboxState', + ); + } +}); + +export default function SnapInstallWarning({ onCancel, onSubmit, warnings }) { const t = useI18nContext(); - const [isConfirmed, setIsConfirmed] = useState(false); + const [checkboxState, dispatch] = useReducer(checkboxStateReducer, {}); - const onCheckboxClicked = useCallback( - () => setIsConfirmed((confirmedState) => !confirmedState), - [], - ); + const isAllChecked = warnings.every((warning) => checkboxState[warning.id]); + + const onCheckboxClicked = useCallback((checkboxId) => { + dispatch({ type: 'check', checkboxId }); + }, []); const SnapInstallWarningFooter = () => { return ( @@ -29,7 +51,7 @@ export default function SnapInstallWarning({ onCancel, onSubmit, snapName }) {